Skip to content

Commit edb92ae

Browse files
author
Eduardo Campaña
committed
fixes tests
1 parent 009c502 commit edb92ae

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

packages/types/src/__tests__/action.tests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Action from "../action";
1+
import { Action, AsyncAction } from "../action";
22
import Package from "../package";
33
import Derived from "../derived";
44

@@ -23,11 +23,11 @@ interface Package1 extends Package {
2323
actions: {
2424
namespace1: {
2525
action1: Action<Package1>;
26-
action2: Action<Package1>;
26+
action2: AsyncAction<Package1>;
2727
};
2828
namespace2: {
2929
action3: Action<Package1, string>;
30-
action4: Action<Package1, number>;
30+
action4: AsyncAction<Package1, number>;
3131
};
3232
};
3333
libraries: {

packages/types/src/__tests__/connect.tests.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import React, {
66
} from "react";
77
import Connect, { ConnectFunction } from "../connect";
88
import { FilterInjectedProps } from "../utils";
9-
import Action from "../action";
9+
import { Action, AsyncAction } from "../action";
1010
import Package from "../package";
1111
import Derived from "../derived";
1212

@@ -31,11 +31,11 @@ interface Package1 extends Package {
3131
actions: {
3232
namespace1: {
3333
action1: Action<Package1>;
34-
action2: Action<Package1>;
34+
action2: AsyncAction<Package1>;
3535
};
3636
namespace2: {
3737
action3: Action<Package1, string>;
38-
action4: Action<Package1, number>;
38+
action4: AsyncAction<Package1, number>;
3939
};
4040
};
4141
libraries: {
@@ -98,13 +98,13 @@ const internalProps: Connect<Package1, OwnProps> = {
9898
actions: {
9999
namespace1: {
100100
action1: () => {},
101-
action2: () => {}
101+
action2: async () => {}
102102
},
103103
namespace2: {
104104
action3: str => {
105105
const str2: string = str;
106106
},
107-
action4: num => {
107+
action4: async num => {
108108
const num2: number = num;
109109
}
110110
}

packages/types/src/__tests__/package.tests.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Settings from "../settings";
22
import Package from "../package";
3-
import Action from "../action";
3+
import { Action, AsyncAction } from "../action";
44
import Derived from "../derived";
55

66
// Custom package extending from Package.
@@ -21,9 +21,11 @@ interface Package1 extends Package {
2121
actions: {
2222
namespace1: {
2323
action1: Action<Package1>;
24+
action2: AsyncAction<Package1>;
2425
};
2526
namespace2: {
26-
action2: Action<Package1, string>;
27+
action3: Action<Package1, string>;
28+
action4: AsyncAction<Package1, string>;
2729
};
2830
};
2931
libraries: {
@@ -50,10 +52,14 @@ const package1: Package1 = {
5052
},
5153
actions: {
5254
namespace1: {
53-
action1: ({ state, actions, libraries }) => {}
55+
action1: ({ state, actions, libraries }) => {},
56+
action2: async ({ state, actions, libraries }) => {}
5457
},
5558
namespace2: {
56-
action2: ({ state }) => str => {
59+
action3: ({ state }) => str => {
60+
str.startsWith("");
61+
},
62+
action4: ({ state }) => async str => {
5763
str.startsWith("");
5864
}
5965
}

0 commit comments

Comments
 (0)