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