testeranto 0.49.7 → 0.49.9
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.
- package/dist/common/Project.js +1 -1
- package/dist/common/Web.js +7 -1
- package/dist/common/subPackages/react-dom/jsx/web.js +39 -12
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Project.js +1 -1
- package/dist/module/Web.js +7 -1
- package/dist/module/subPackages/react-dom/jsx/web.js +39 -12
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/subPackages/react-dom/jsx/index.d.ts +2 -3
- package/dist/types/subPackages/react-dom/jsx/node.d.ts +1 -2
- package/dist/types/subPackages/react-dom/jsx/web.d.ts +1 -2
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Project.ts +3 -2
- package/src/Web.ts +6 -2
- package/src/preload.ts +1 -1
- package/src/subPackages/react-dom/jsx/index.ts +2 -2
- package/src/subPackages/react-dom/jsx/web.ts +47 -14
|
@@ -4,6 +4,7 @@ import React, {
|
|
|
4
4
|
useEffect, useRef,
|
|
5
5
|
} from "react";
|
|
6
6
|
import ReactDom from "react-dom/client";
|
|
7
|
+
import { createPortal } from 'react-dom';
|
|
7
8
|
|
|
8
9
|
import { ITTestShape, ITestImplementation, ITestSpecification } from "../../../core";
|
|
9
10
|
import {
|
|
@@ -39,8 +40,16 @@ export default <ITestShape extends ITTestShape>(
|
|
|
39
40
|
const myContainer = useRef<any>(null);
|
|
40
41
|
useEffect(() => {
|
|
41
42
|
console.log(
|
|
42
|
-
"useEffect called"
|
|
43
|
+
"useEffect called", myContainer.current
|
|
43
44
|
);
|
|
45
|
+
|
|
46
|
+
if (!myContainer.current) {
|
|
47
|
+
// do componentDidMount logic
|
|
48
|
+
myContainer.current = true;
|
|
49
|
+
} else {
|
|
50
|
+
// do componentDidUpdate logic
|
|
51
|
+
}
|
|
52
|
+
|
|
44
53
|
done(myContainer.current);
|
|
45
54
|
}, []);
|
|
46
55
|
|
|
@@ -85,32 +94,56 @@ export default <ITestShape extends ITTestShape>(
|
|
|
85
94
|
|
|
86
95
|
console.log("beforeEach", subject);
|
|
87
96
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
+
createPortal(
|
|
98
|
+
TesterantoComponent({
|
|
99
|
+
innerComp: testInput,
|
|
100
|
+
done: (reactElement: any) => {
|
|
101
|
+
process.nextTick(() => {
|
|
102
|
+
resolve(reactElement)// do something
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
,
|
|
107
|
+
),
|
|
108
|
+
|
|
109
|
+
// ignore this type error
|
|
110
|
+
// React.createElement(
|
|
111
|
+
// TesterantoComponent, {
|
|
112
|
+
// done: (reactElement: any) => {
|
|
113
|
+
// process.nextTick(() => {
|
|
114
|
+
// resolve(reactElement)// do something
|
|
115
|
+
// });
|
|
116
|
+
|
|
117
|
+
// },
|
|
118
|
+
// innerComp: testInput
|
|
119
|
+
// }),
|
|
120
|
+
rootElement
|
|
121
|
+
);
|
|
97
122
|
});
|
|
98
123
|
},
|
|
99
124
|
andWhen: function (s: IStore, actioner): Promise<ISelection> {
|
|
100
|
-
return
|
|
125
|
+
return new Promise((resolve, rej) => {
|
|
126
|
+
process.nextTick(() => { resolve(actioner()(s)) })
|
|
127
|
+
});
|
|
101
128
|
},
|
|
102
129
|
butThen: async function (s: IStore): Promise<ISelection> {
|
|
103
|
-
return
|
|
130
|
+
return new Promise((resolve, rej) => {
|
|
131
|
+
process.nextTick(() => { resolve(s) })
|
|
132
|
+
});
|
|
104
133
|
},
|
|
105
134
|
afterEach: async function (
|
|
106
135
|
store: IStore,
|
|
107
136
|
ndx,
|
|
108
137
|
artificer
|
|
109
138
|
) {
|
|
110
|
-
return {
|
|
139
|
+
return new Promise((resolve, rej) => {
|
|
140
|
+
process.nextTick(() => { resolve({}) })
|
|
141
|
+
});
|
|
111
142
|
},
|
|
112
143
|
afterAll: (store: IStore, artificer) => {
|
|
113
|
-
return
|
|
144
|
+
return new Promise((resolve, rej) => {
|
|
145
|
+
process.nextTick(() => { resolve({}) })
|
|
146
|
+
});
|
|
114
147
|
},
|
|
115
148
|
},
|
|
116
149
|
)
|