testeranto 0.49.6 → 0.49.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,8 +39,16 @@ export default <ITestShape extends ITTestShape>(
39
39
  const myContainer = useRef<any>(null);
40
40
  useEffect(() => {
41
41
  console.log(
42
- "useEffect called"
42
+ "useEffect called", myContainer.current
43
43
  );
44
+
45
+ if (!myContainer.current) {
46
+ // do componentDidMount logic
47
+ myContainer.current = true;
48
+ } else {
49
+ // do componentDidUpdate logic
50
+ }
51
+
44
52
  done(myContainer.current);
45
53
  }, []);
46
54
 
@@ -90,27 +98,40 @@ export default <ITestShape extends ITTestShape>(
90
98
  // ignore this type error
91
99
  React.createElement(
92
100
  TesterantoComponent, {
93
- done: (reactElement: any) => resolve(reactElement),
101
+ done: (reactElement: any) => {
102
+ process.nextTick(() => {
103
+ resolve(reactElement)// do something
104
+ });
105
+
106
+ },
94
107
  innerComp: testInput
95
108
  },
96
109
  []));
97
110
  });
98
111
  },
99
112
  andWhen: function (s: IStore, actioner): Promise<ISelection> {
100
- return actioner()(s);
113
+ return new Promise((resolve, rej) => {
114
+ process.nextTick(() => { resolve(actioner()(s)) })
115
+ });
101
116
  },
102
117
  butThen: async function (s: IStore): Promise<ISelection> {
103
- return s;
118
+ return new Promise((resolve, rej) => {
119
+ process.nextTick(() => { resolve(s) })
120
+ });
104
121
  },
105
122
  afterEach: async function (
106
123
  store: IStore,
107
124
  ndx,
108
125
  artificer
109
126
  ) {
110
- return {};
127
+ return new Promise((resolve, rej) => {
128
+ process.nextTick(() => { resolve({}) })
129
+ });
111
130
  },
112
131
  afterAll: (store: IStore, artificer) => {
113
- return;
132
+ return new Promise((resolve, rej) => {
133
+ process.nextTick(() => { resolve({}) })
134
+ });
114
135
  },
115
136
  },
116
137
  )