Skip to content

Commit c9ba041

Browse files
committed
test: cover test case of actions with different signatures
1 parent 4aef000 commit c9ba041

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/typeless/__tests__/type/Epic.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ function createAction<T extends ActionMap>(acts: T) {
66
return createModule(Symbol('test')).withActions(acts)[1];
77
}
88
TT.describe('onMany', () => {
9-
const m1 = createAction({ foo: () => ({ payload: 1 }) });
10-
const m2 = createAction({ foo: () => ({ payload: true }) });
9+
const m1 = createAction({ foo: (num: number) => ({ payload: { num } }) });
10+
const m2 = createAction({ foo: (boo: boolean) => ({ payload: { boo } }) });
1111
const m3 = createAction({ foo: () => ({ payload: 'bar' }) });
1212
const m4 = createAction({ foo: () => ({ payload: Symbol('baz') }) });
13-
const m5 = createAction({ foo: () => ({ payload: { obj: 'foo' } }) });
13+
const m5 = createAction({ foo: (str: string) => ({ payload: { str } }) });
1414
const m6 = createAction({ foo: () => ({ payload: ['array'] }) });
1515

1616
TT.describe('should error called with', () => {
@@ -27,11 +27,11 @@ TT.describe('onMany', () => {
2727
TT.it('called with many arguments', () => {
2828
new Epic().onMany([m1.foo, m2.foo, m3.foo, m4.foo, m5.foo, m6.foo], p => {
2929
type Expected =
30-
| number
31-
| boolean
30+
| { num: number }
31+
| { boo: boolean }
3232
| string
3333
| symbol
34-
| { obj: string }
34+
| { str: string }
3535
| string[];
3636
TT.assert<TT.Eq<typeof p, Expected>>();
3737

0 commit comments

Comments
 (0)