testeranto 0.49.3 → 0.49.5

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.
@@ -7,9 +7,12 @@ import ReactDom from "react-dom/client";
7
7
 
8
8
  import { ITTestShape, ITestImplementation, ITestSpecification } from "../../../core";
9
9
  import {
10
- IInput, ISelection, IStore, ISubject, IThenShape, IWhenShape, IState
10
+ IInput, ISelection, IStore,
11
+ IThenShape, IWhenShape, IState
11
12
  } from ".";
12
13
 
14
+ export type ISubject = HTMLElement;
15
+
13
16
  export default <ITestShape extends ITTestShape>(
14
17
  testImplementations: ITestImplementation<
15
18
  IState,
@@ -32,7 +35,7 @@ export default <ITestShape extends ITTestShape>(
32
35
  const rootElement = document.getElementById("root");
33
36
  if (rootElement) {
34
37
 
35
- const TesterantoComponent = function ({ done, innerComp }: { done: (ref: React.MutableRefObject<any>) => any, innerComp: ISubject }) {
38
+ const TesterantoComponent = function ({ done, innerComp }: { done: (ref: React.MutableRefObject<any>) => any, innerComp: IInput }) {
36
39
  const myContainer = useRef<any>(null);
37
40
  useEffect(() => {
38
41
  console.log(
@@ -44,7 +47,7 @@ export default <ITestShape extends ITTestShape>(
44
47
  return React.createElement(
45
48
  'div',
46
49
  { ref: myContainer },
47
- innerComp
50
+ innerComp()
48
51
  );
49
52
  };
50
53
 
@@ -62,6 +65,16 @@ export default <ITestShape extends ITTestShape>(
62
65
  testSpecifications,
63
66
  testImplementations,
64
67
  {
68
+ beforeAll: async (
69
+ input,
70
+ artificer
71
+ ): Promise<ISubject> => {
72
+ console.log("beforeAll", input);
73
+ return await new Promise((resolve, rej) => {
74
+ resolve(rootElement);
75
+ })
76
+ },
77
+
65
78
  beforeEach: async (
66
79
  subject,
67
80
  ndx,
@@ -78,7 +91,7 @@ export default <ITestShape extends ITTestShape>(
78
91
  React.createElement(
79
92
  TesterantoComponent, {
80
93
  done: (reactElement: any) => resolve(reactElement),
81
- innerComp: subject
94
+ innerComp: testInput
82
95
  },
83
96
  []));
84
97
  });