testeranto 0.49.0 → 0.49.2
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 +6 -4
- package/dist/common/subPackages/react-dom/jsx/index.js +2 -0
- package/dist/common/subPackages/react-dom/jsx/web.js +13 -17
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Project.js +6 -4
- package/dist/module/subPackages/react-dom/jsx/index.js +1 -0
- package/dist/module/subPackages/react-dom/jsx/web.js +13 -17
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/subPackages/react-dom/jsx/index.d.ts +8 -0
- package/dist/types/subPackages/react-dom/jsx/node.d.ts +2 -8
- package/dist/types/subPackages/react-dom/jsx/web.d.ts +3 -13
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +6 -2
- package/src/Project.ts +6 -4
- package/src/subPackages/react-dom/jsx/index.ts +9 -0
- package/src/subPackages/react-dom/jsx/node.ts +5 -9
- package/src/subPackages/react-dom/jsx/web.ts +22 -39
|
@@ -6,25 +6,13 @@ import React, {
|
|
|
6
6
|
import ReactDom from "react-dom/client";
|
|
7
7
|
|
|
8
8
|
import { ITTestShape, ITestImplementation, ITestSpecification } from "../../../core";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
type IWhenShape = any;
|
|
13
|
-
type IThenShape = any;
|
|
14
|
-
type ISelection = IStore;
|
|
15
|
-
|
|
16
|
-
type Prototype = () => JSX.Element;
|
|
17
|
-
type IStore = {
|
|
18
|
-
root: HTMLElement,
|
|
19
|
-
react: HTMLElement,
|
|
20
|
-
};
|
|
21
|
-
type ISubject = {
|
|
22
|
-
root: HTMLElement
|
|
23
|
-
};
|
|
9
|
+
import {
|
|
10
|
+
IInput, ISelection, IStore, ISubject, IThenShape, IWhenShape, IState
|
|
11
|
+
} from ".";
|
|
24
12
|
|
|
25
13
|
export default <ITestShape extends ITTestShape>(
|
|
26
14
|
testImplementations: ITestImplementation<
|
|
27
|
-
|
|
15
|
+
IState,
|
|
28
16
|
ISelection,
|
|
29
17
|
IWhenShape,
|
|
30
18
|
IThenShape,
|
|
@@ -37,59 +25,55 @@ export default <ITestShape extends ITTestShape>(
|
|
|
37
25
|
ISelection,
|
|
38
26
|
IThenShape
|
|
39
27
|
>,
|
|
40
|
-
testInput:
|
|
28
|
+
testInput: IInput
|
|
41
29
|
) => {
|
|
42
30
|
document.addEventListener("DOMContentLoaded", function () {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
console.log("DOMContentLoaded");
|
|
32
|
+
const rootElement = document.getElementById("root");
|
|
33
|
+
if (rootElement) {
|
|
34
|
+
const TesterantoComponent = function (innerProps) {
|
|
46
35
|
const myContainer = useRef(null);
|
|
47
|
-
|
|
48
36
|
useEffect(() => {
|
|
49
37
|
console.log(
|
|
50
|
-
"
|
|
38
|
+
"useEffect called"
|
|
51
39
|
);
|
|
52
|
-
|
|
53
|
-
props.done(myContainer.current);
|
|
40
|
+
innerProps.done(myContainer.current);
|
|
54
41
|
}, []);
|
|
55
42
|
|
|
56
|
-
return React.createElement(
|
|
43
|
+
return React.createElement(
|
|
44
|
+
'div',
|
|
45
|
+
{ ref: myContainer },
|
|
46
|
+
testInput()
|
|
47
|
+
);
|
|
57
48
|
};
|
|
58
49
|
|
|
59
50
|
Testeranto<
|
|
60
51
|
ITestShape,
|
|
61
|
-
|
|
52
|
+
IInput,
|
|
62
53
|
ISubject,
|
|
63
54
|
IStore,
|
|
64
55
|
ISelection,
|
|
65
56
|
IThenShape,
|
|
66
57
|
IWhenShape,
|
|
67
|
-
|
|
58
|
+
IState
|
|
68
59
|
>(
|
|
69
60
|
testInput,
|
|
70
61
|
testSpecifications,
|
|
71
62
|
testImplementations,
|
|
72
63
|
{
|
|
73
|
-
beforeAll: async (
|
|
74
|
-
prototype,
|
|
75
|
-
artificer
|
|
76
|
-
): Promise<ISubject> => {
|
|
77
|
-
return new Promise((resolve, rej) => {
|
|
78
|
-
resolve({ root: elem });
|
|
79
|
-
})
|
|
80
|
-
},
|
|
81
64
|
beforeEach: async (
|
|
82
|
-
|
|
65
|
+
subject,
|
|
83
66
|
ndx,
|
|
84
67
|
testRsource,
|
|
85
68
|
artificer
|
|
86
69
|
): Promise<IStore> => {
|
|
87
70
|
return new Promise((resolve, rej) => {
|
|
88
|
-
ReactDom.createRoot(
|
|
71
|
+
ReactDom.createRoot(rootElement).
|
|
89
72
|
render(
|
|
73
|
+
// ignore this type error
|
|
90
74
|
React.createElement(
|
|
91
75
|
TesterantoComponent, {
|
|
92
|
-
done: (
|
|
76
|
+
done: (reactElement: any) => resolve(reactElement)
|
|
93
77
|
}, []));
|
|
94
78
|
});
|
|
95
79
|
},
|
|
@@ -107,7 +91,6 @@ export default <ITestShape extends ITTestShape>(
|
|
|
107
91
|
return {};
|
|
108
92
|
},
|
|
109
93
|
afterAll: (store: IStore, artificer) => {
|
|
110
|
-
// store.page.browser().close();
|
|
111
94
|
return;
|
|
112
95
|
},
|
|
113
96
|
},
|