testeranto 0.47.29 → 0.47.31
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/Node.js +13 -21
- package/dist/common/Project.js +228 -208
- package/dist/common/Web.js +59 -13
- package/dist/common/core.js +6 -1
- package/dist/common/electron.js +14 -2
- package/dist/common/preload.js +20 -0
- package/dist/common/subPackages/react/jsx/index.js +26 -0
- package/dist/common/subPackages/react/jsx/node.js +2 -11
- package/dist/common/subPackages/react/jsx/web.js +2 -11
- package/dist/common/subPackages/react-dom/component/node.js +78 -34
- package/dist/common/subPackages/react-dom/component/web.js +50 -46
- package/dist/common/subPackages/react-dom/jsx/node.js +101 -0
- package/dist/common/subPackages/react-test-renderer/component/index.js +78 -0
- package/dist/common/subPackages/react-test-renderer/component/node.js +8 -0
- package/dist/common/subPackages/react-test-renderer/component/web.js +8 -0
- package/dist/common/subPackages/{react-test-render/component/node.js → react-test-renderer/jsx/index.js} +3 -3
- package/dist/common/subPackages/react-test-renderer/jsx/node.js +10 -0
- package/dist/common/subPackages/react-test-renderer/jsx/web.js +10 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Node.js +13 -21
- package/dist/module/Project.js +228 -208
- package/dist/module/Web.js +59 -13
- package/dist/module/core.js +6 -1
- package/dist/module/electron.js +14 -2
- package/dist/module/preload.js +20 -0
- package/dist/module/subPackages/react/jsx/index.js +22 -0
- package/dist/module/subPackages/react/jsx/node.js +2 -11
- package/dist/module/subPackages/react/jsx/web.js +2 -11
- package/dist/module/subPackages/react-dom/component/node.js +75 -34
- package/dist/module/subPackages/react-dom/component/web.js +50 -46
- package/dist/module/subPackages/react-dom/jsx/node.js +93 -0
- package/dist/module/subPackages/react-test-renderer/component/index.js +52 -0
- package/dist/module/subPackages/react-test-renderer/component/node.js +3 -0
- package/dist/module/subPackages/react-test-renderer/component/web.js +3 -0
- package/dist/module/subPackages/{react-test-render/component/node.js → react-test-renderer/jsx/index.js} +2 -3
- package/dist/module/subPackages/react-test-renderer/jsx/node.js +5 -0
- package/dist/module/subPackages/react-test-renderer/jsx/web.js +5 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/Project.d.ts +2 -1
- package/dist/types/core.d.ts +1 -0
- package/dist/types/subPackages/react/jsx/index.d.ts +15 -0
- package/dist/types/subPackages/react/jsx/node.d.ts +3 -10
- package/dist/types/subPackages/react/jsx/web.d.ts +3 -11
- package/dist/types/subPackages/react-dom/component/node.d.ts +9 -14
- package/dist/types/subPackages/react-dom/component/web.d.ts +1 -1
- package/dist/types/subPackages/react-dom/jsx/node.d.ts +14 -0
- package/dist/types/subPackages/react-dom/jsx/web.d.ts +0 -1
- package/dist/types/subPackages/react-test-renderer/component/index.d.ts +20 -0
- package/dist/types/subPackages/react-test-renderer/component/node.d.ts +9 -0
- package/dist/types/subPackages/react-test-renderer/component/web.d.ts +9 -0
- package/dist/types/subPackages/react-test-renderer/jsx/index.d.ts +15 -0
- package/dist/types/subPackages/react-test-renderer/jsx/node.d.ts +4 -0
- package/dist/types/subPackages/react-test-renderer/jsx/web.d.ts +4 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +68 -8
- package/src/Node.ts +18 -30
- package/src/Project.ts +292 -274
- package/src/Web.ts +78 -16
- package/src/core.ts +7 -1
- package/src/electron.ts +18 -2
- package/src/preload.ts +23 -0
- package/src/subPackages/react/jsx/index.ts +64 -0
- package/src/subPackages/react/jsx/node.ts +7 -36
- package/src/subPackages/react/jsx/web.ts +7 -38
- package/src/subPackages/react-dom/component/node.ts +85 -54
- package/src/subPackages/react-dom/component/web.ts +86 -76
- package/src/subPackages/react-dom/jsx/node.ts +150 -0
- package/src/subPackages/react-test-renderer/component/index.ts +101 -0
- package/src/subPackages/react-test-renderer/component/node.ts +30 -0
- package/src/subPackages/react-test-renderer/component/web.ts +30 -0
- package/src/subPackages/react-test-renderer/jsx/index.ts +51 -0
- package/src/subPackages/react-test-renderer/jsx/node.ts +31 -0
- package/src/subPackages/react-test-renderer/jsx/web.ts +31 -0
- package/dist/common/subPackages/react-test-render/component/web.js +0 -44
- package/dist/common/subPackages/react-test-render/jsx/node.js +0 -46
- package/dist/common/subPackages/react-test-render/jsx/web.js +0 -46
- package/dist/module/subPackages/react-test-render/component/web.js +0 -16
- package/dist/module/subPackages/react-test-render/jsx/node.js +0 -16
- package/dist/module/subPackages/react-test-render/jsx/web.js +0 -16
- package/dist/types/subPackages/react-test-render/component/node.d.ts +0 -20
- package/dist/types/subPackages/react-test-render/component/web.d.ts +0 -20
- package/dist/types/subPackages/react-test-render/jsx/node.d.ts +0 -20
- package/dist/types/subPackages/react-test-render/jsx/web.d.ts +0 -20
- package/src/subPackages/react-test-render/component/node.ts +0 -78
- package/src/subPackages/react-test-render/component/web.ts +0 -78
- package/src/subPackages/react-test-render/jsx/node.ts +0 -75
- package/src/subPackages/react-test-render/jsx/web.ts +0 -75
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ReactTestRendererTesteranto = void 0;
|
|
30
|
-
const react_1 = __importDefault(require("react"));
|
|
31
|
-
const react_test_renderer_1 = __importStar(require("react-test-renderer"));
|
|
32
|
-
const Web_1 = __importDefault(require("../../../Web"));
|
|
33
|
-
const ReactTestRendererTesteranto = (testImplementations, testSpecifications, testInput) => (0, Web_1.default)(testInput, testSpecifications, testImplementations, {
|
|
34
|
-
beforeEach: function (CComponent, props) {
|
|
35
|
-
let component;
|
|
36
|
-
(0, react_test_renderer_1.act)(() => {
|
|
37
|
-
component = react_test_renderer_1.default.create(react_1.default.createElement(CComponent, props, []));
|
|
38
|
-
});
|
|
39
|
-
return component;
|
|
40
|
-
},
|
|
41
|
-
andWhen: async function (renderer, actioner) {
|
|
42
|
-
await (0, react_test_renderer_1.act)(() => actioner()(renderer));
|
|
43
|
-
return renderer;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
exports.ReactTestRendererTesteranto = ReactTestRendererTesteranto;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
import Testeranto from "../../../Web";
|
|
4
|
-
export default (testImplementations, testSpecifications, testInput) => Testeranto(testInput, testSpecifications, testImplementations, {
|
|
5
|
-
beforeEach: function (CComponent, props) {
|
|
6
|
-
let component;
|
|
7
|
-
act(() => {
|
|
8
|
-
component = renderer.create(React.createElement(CComponent, props, []));
|
|
9
|
-
});
|
|
10
|
-
return component;
|
|
11
|
-
},
|
|
12
|
-
andWhen: async function (renderer, actioner) {
|
|
13
|
-
await act(() => actioner()(renderer));
|
|
14
|
-
return renderer;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
import Testeranto from "../../../Web";
|
|
4
|
-
export const ReactTestRendererTesteranto = (testImplementations, testSpecifications, testInput) => Testeranto(testInput, testSpecifications, testImplementations, {
|
|
5
|
-
beforeEach: function (CComponent, props) {
|
|
6
|
-
let component;
|
|
7
|
-
act(() => {
|
|
8
|
-
component = renderer.create(React.createElement(CComponent, props, []));
|
|
9
|
-
});
|
|
10
|
-
return component;
|
|
11
|
-
},
|
|
12
|
-
andWhen: async function (renderer, actioner) {
|
|
13
|
-
await act(() => actioner()(renderer));
|
|
14
|
-
return renderer;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
import Testeranto from "../../../Web";
|
|
4
|
-
export const ReactTestRendererTesteranto = (testImplementations, testSpecifications, testInput) => Testeranto(testInput, testSpecifications, testImplementations, {
|
|
5
|
-
beforeEach: function (CComponent, props) {
|
|
6
|
-
let component;
|
|
7
|
-
act(() => {
|
|
8
|
-
component = renderer.create(React.createElement(CComponent, props, []));
|
|
9
|
-
});
|
|
10
|
-
return component;
|
|
11
|
-
},
|
|
12
|
-
andWhen: async function (renderer, actioner) {
|
|
13
|
-
await act(() => actioner()(renderer));
|
|
14
|
-
return renderer;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { CElement } from "react";
|
|
2
|
-
import renderer from "react-test-renderer";
|
|
3
|
-
import { ITestImplementation, ITestSpecification, ITTestShape } from "../../../core";
|
|
4
|
-
export declare type IInput = typeof React.Component;
|
|
5
|
-
export declare type InitialState = unknown;
|
|
6
|
-
export declare type IWhenShape = any;
|
|
7
|
-
export declare type IThenShape = any;
|
|
8
|
-
export declare type ISelection = {
|
|
9
|
-
htmlElement: HTMLElement;
|
|
10
|
-
reactElement: CElement<any, any>;
|
|
11
|
-
};
|
|
12
|
-
export declare type IStore = {
|
|
13
|
-
htmlElement: HTMLElement;
|
|
14
|
-
reactElement: CElement<any, any>;
|
|
15
|
-
};
|
|
16
|
-
export declare type ISubject = {
|
|
17
|
-
htmlElement: HTMLElement;
|
|
18
|
-
};
|
|
19
|
-
declare const _default: <ITestShape extends ITTestShape, IPropShape, IStateShape>(testImplementations: ITestImplementation<IPropShape, renderer.ReactTestRenderer, any, any, ITestShape>, testSpecifications: ITestSpecification<ITestShape, ISubject, IStore, ISelection, any>, testInput: IInput) => Promise<void>;
|
|
20
|
-
export default _default;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { CElement } from "react";
|
|
2
|
-
import renderer from "react-test-renderer";
|
|
3
|
-
import { ITestImplementation, ITestSpecification, ITTestShape } from "../../../core";
|
|
4
|
-
export declare type IInput = typeof React.Component;
|
|
5
|
-
export declare type InitialState = unknown;
|
|
6
|
-
export declare type IWhenShape = any;
|
|
7
|
-
export declare type IThenShape = any;
|
|
8
|
-
export declare type ISelection = {
|
|
9
|
-
htmlElement: HTMLElement;
|
|
10
|
-
reactElement: CElement<any, any>;
|
|
11
|
-
};
|
|
12
|
-
export declare type IStore = {
|
|
13
|
-
htmlElement: HTMLElement;
|
|
14
|
-
reactElement: CElement<any, any>;
|
|
15
|
-
};
|
|
16
|
-
export declare type ISubject = {
|
|
17
|
-
htmlElement: HTMLElement;
|
|
18
|
-
};
|
|
19
|
-
declare const _default: <ITestShape extends ITTestShape, IPropShape, IStateShape>(testImplementations: ITestImplementation<IPropShape, renderer.ReactTestRenderer, any, any, ITestShape>, testSpecifications: ITestSpecification<ITestShape, ISubject, IStore, ISelection, any>, testInput: IInput) => Promise<void>;
|
|
20
|
-
export default _default;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { CElement } from "react";
|
|
2
|
-
import renderer from "react-test-renderer";
|
|
3
|
-
import { ITestImplementation, ITestSpecification, ITTestShape } from "../../../core";
|
|
4
|
-
export declare type IInput = typeof React.Component;
|
|
5
|
-
export declare type InitialState = unknown;
|
|
6
|
-
export declare type IWhenShape = any;
|
|
7
|
-
export declare type IThenShape = any;
|
|
8
|
-
export declare type ISelection = {
|
|
9
|
-
htmlElement: HTMLElement;
|
|
10
|
-
reactElement: CElement<any, any>;
|
|
11
|
-
};
|
|
12
|
-
export declare type IStore = {
|
|
13
|
-
htmlElement: HTMLElement;
|
|
14
|
-
reactElement: CElement<any, any>;
|
|
15
|
-
};
|
|
16
|
-
export declare type ISubject = {
|
|
17
|
-
htmlElement: HTMLElement;
|
|
18
|
-
};
|
|
19
|
-
export {};
|
|
20
|
-
export declare const ReactTestRendererTesteranto: <ITestShape extends ITTestShape, PropShape, StateShape>(testImplementations: ITestImplementation<PropShape, renderer.ReactTestRenderer, any, any, ITestShape>, testSpecifications: ITestSpecification<ITestShape, ISubject, IStore, ISelection, any>, testInput: IInput) => Promise<void>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { CElement } from "react";
|
|
2
|
-
import renderer from "react-test-renderer";
|
|
3
|
-
import { ITTestShape, ITestImplementation, ITestSpecification } from "../../../core";
|
|
4
|
-
export declare type IInput = typeof React.Component;
|
|
5
|
-
export declare type IState = unknown;
|
|
6
|
-
export declare type IWhenShape = any;
|
|
7
|
-
export declare type IThenShape = any;
|
|
8
|
-
export declare type ISelection = {
|
|
9
|
-
htmlElement: HTMLElement;
|
|
10
|
-
reactElement: CElement<any, any>;
|
|
11
|
-
};
|
|
12
|
-
export declare type IStore = {
|
|
13
|
-
htmlElement: HTMLElement;
|
|
14
|
-
reactElement: CElement<any, any>;
|
|
15
|
-
};
|
|
16
|
-
export declare type ISubject = {
|
|
17
|
-
htmlElement: HTMLElement;
|
|
18
|
-
};
|
|
19
|
-
export {};
|
|
20
|
-
export declare const ReactTestRendererTesteranto: <ITestShape extends ITTestShape, IPropShape, IStateShape>(testImplementations: ITestImplementation<IPropShape, renderer.ReactTestRenderer, any, any, ITestShape>, testSpecifications: ITestSpecification<ITestShape, ISubject, IStore, ISelection, any>, testInput: IInput) => Promise<void>;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React, { CElement } from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
|
|
4
|
-
import Testeranto from "../../../Web";
|
|
5
|
-
import {
|
|
6
|
-
ITestImplementation,
|
|
7
|
-
ITestSpecification,
|
|
8
|
-
ITTestShape,
|
|
9
|
-
} from "../../../core";
|
|
10
|
-
|
|
11
|
-
export type IInput = typeof React.Component;
|
|
12
|
-
export type InitialState = unknown;
|
|
13
|
-
export type IWhenShape = any;
|
|
14
|
-
export type IThenShape = any;
|
|
15
|
-
export type ISelection = {
|
|
16
|
-
htmlElement: HTMLElement,
|
|
17
|
-
reactElement: CElement<any, any>,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type IStore = {
|
|
21
|
-
htmlElement: HTMLElement,
|
|
22
|
-
reactElement: CElement<any, any>,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export type ISubject = {
|
|
26
|
-
htmlElement: HTMLElement
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default <
|
|
30
|
-
ITestShape extends ITTestShape,
|
|
31
|
-
IPropShape,
|
|
32
|
-
IStateShape
|
|
33
|
-
>(
|
|
34
|
-
testImplementations: ITestImplementation<
|
|
35
|
-
IPropShape,
|
|
36
|
-
renderer.ReactTestRenderer,
|
|
37
|
-
IWhenShape,
|
|
38
|
-
IThenShape,
|
|
39
|
-
ITestShape
|
|
40
|
-
>,
|
|
41
|
-
testSpecifications: ITestSpecification<
|
|
42
|
-
ITestShape,
|
|
43
|
-
ISubject,
|
|
44
|
-
IStore,
|
|
45
|
-
ISelection,
|
|
46
|
-
IThenShape
|
|
47
|
-
>,
|
|
48
|
-
testInput: IInput,
|
|
49
|
-
) =>
|
|
50
|
-
Testeranto<
|
|
51
|
-
ITestShape,
|
|
52
|
-
IInput,
|
|
53
|
-
any,
|
|
54
|
-
any,
|
|
55
|
-
any,
|
|
56
|
-
any,
|
|
57
|
-
any,
|
|
58
|
-
any
|
|
59
|
-
>(
|
|
60
|
-
testInput,
|
|
61
|
-
testSpecifications,
|
|
62
|
-
testImplementations,
|
|
63
|
-
{
|
|
64
|
-
beforeEach: function (CComponent, props): Promise<renderer.ReactTestRenderer> {
|
|
65
|
-
let component;
|
|
66
|
-
act(() => {
|
|
67
|
-
component = renderer.create(
|
|
68
|
-
React.createElement(CComponent, props, [])
|
|
69
|
-
);
|
|
70
|
-
});
|
|
71
|
-
return component;
|
|
72
|
-
},
|
|
73
|
-
andWhen: async function (renderer: renderer.ReactTestRenderer, actioner: any): Promise<renderer.ReactTestRenderer> {
|
|
74
|
-
await act(() => actioner()(renderer));
|
|
75
|
-
return renderer
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
)
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React, { CElement } from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
|
|
4
|
-
import Testeranto from "../../../Web";
|
|
5
|
-
import {
|
|
6
|
-
ITestImplementation,
|
|
7
|
-
ITestSpecification,
|
|
8
|
-
ITTestShape,
|
|
9
|
-
} from "../../../core";
|
|
10
|
-
|
|
11
|
-
export type IInput = typeof React.Component;
|
|
12
|
-
export type InitialState = unknown;
|
|
13
|
-
export type IWhenShape = any;
|
|
14
|
-
export type IThenShape = any;
|
|
15
|
-
export type ISelection = {
|
|
16
|
-
htmlElement: HTMLElement,
|
|
17
|
-
reactElement: CElement<any, any>,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type IStore = {
|
|
21
|
-
htmlElement: HTMLElement,
|
|
22
|
-
reactElement: CElement<any, any>,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export type ISubject = {
|
|
26
|
-
htmlElement: HTMLElement
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default <
|
|
30
|
-
ITestShape extends ITTestShape,
|
|
31
|
-
IPropShape,
|
|
32
|
-
IStateShape
|
|
33
|
-
>(
|
|
34
|
-
testImplementations: ITestImplementation<
|
|
35
|
-
IPropShape,
|
|
36
|
-
renderer.ReactTestRenderer,
|
|
37
|
-
IWhenShape,
|
|
38
|
-
IThenShape,
|
|
39
|
-
ITestShape
|
|
40
|
-
>,
|
|
41
|
-
testSpecifications: ITestSpecification<
|
|
42
|
-
ITestShape,
|
|
43
|
-
ISubject,
|
|
44
|
-
IStore,
|
|
45
|
-
ISelection,
|
|
46
|
-
IThenShape
|
|
47
|
-
>,
|
|
48
|
-
testInput: IInput,
|
|
49
|
-
) =>
|
|
50
|
-
Testeranto<
|
|
51
|
-
ITestShape,
|
|
52
|
-
IInput,
|
|
53
|
-
any,
|
|
54
|
-
any,
|
|
55
|
-
any,
|
|
56
|
-
any,
|
|
57
|
-
any,
|
|
58
|
-
any
|
|
59
|
-
>(
|
|
60
|
-
testInput,
|
|
61
|
-
testSpecifications,
|
|
62
|
-
testImplementations,
|
|
63
|
-
{
|
|
64
|
-
beforeEach: function (CComponent, props): Promise<renderer.ReactTestRenderer> {
|
|
65
|
-
let component;
|
|
66
|
-
act(() => {
|
|
67
|
-
component = renderer.create(
|
|
68
|
-
React.createElement(CComponent, props, [])
|
|
69
|
-
);
|
|
70
|
-
});
|
|
71
|
-
return component;
|
|
72
|
-
},
|
|
73
|
-
andWhen: async function (renderer: renderer.ReactTestRenderer, actioner: any): Promise<renderer.ReactTestRenderer> {
|
|
74
|
-
await act(() => actioner()(renderer));
|
|
75
|
-
return renderer
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
)
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React, { CElement } from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
|
|
4
|
-
import Testeranto from "../../../Web";
|
|
5
|
-
import { ITestImplementation, ITestSpecification, ITTestShape } from "../../../core";
|
|
6
|
-
|
|
7
|
-
export type IInput = typeof React.Component;
|
|
8
|
-
export type InitialState = unknown;
|
|
9
|
-
export type IWhenShape = any;
|
|
10
|
-
export type IThenShape = any;
|
|
11
|
-
export type ISelection = {
|
|
12
|
-
htmlElement: HTMLElement,
|
|
13
|
-
reactElement: CElement<any, any>,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type IStore = {
|
|
17
|
-
htmlElement: HTMLElement,
|
|
18
|
-
reactElement: CElement<any, any>,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type ISubject = {
|
|
22
|
-
htmlElement: HTMLElement
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export { };
|
|
26
|
-
export const ReactTestRendererTesteranto = <
|
|
27
|
-
ITestShape extends ITTestShape,
|
|
28
|
-
PropShape,
|
|
29
|
-
StateShape
|
|
30
|
-
>(
|
|
31
|
-
testImplementations: ITestImplementation<
|
|
32
|
-
PropShape,
|
|
33
|
-
renderer.ReactTestRenderer,
|
|
34
|
-
IWhenShape,
|
|
35
|
-
IThenShape,
|
|
36
|
-
ITestShape
|
|
37
|
-
>,
|
|
38
|
-
testSpecifications: ITestSpecification<
|
|
39
|
-
ITestShape,
|
|
40
|
-
ISubject,
|
|
41
|
-
IStore,
|
|
42
|
-
ISelection,
|
|
43
|
-
IThenShape
|
|
44
|
-
>,
|
|
45
|
-
testInput: IInput,
|
|
46
|
-
) =>
|
|
47
|
-
Testeranto<
|
|
48
|
-
ITestShape,
|
|
49
|
-
IInput,
|
|
50
|
-
any,
|
|
51
|
-
any,
|
|
52
|
-
any,
|
|
53
|
-
any,
|
|
54
|
-
any,
|
|
55
|
-
any
|
|
56
|
-
>(
|
|
57
|
-
testInput,
|
|
58
|
-
testSpecifications,
|
|
59
|
-
testImplementations,
|
|
60
|
-
{
|
|
61
|
-
beforeEach: function (CComponent, props): Promise<renderer.ReactTestRenderer> {
|
|
62
|
-
let component;
|
|
63
|
-
act(() => {
|
|
64
|
-
component = renderer.create(
|
|
65
|
-
React.createElement(CComponent, props, [])
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
return component;
|
|
69
|
-
},
|
|
70
|
-
andWhen: async function (renderer: renderer.ReactTestRenderer, actioner: any): Promise<renderer.ReactTestRenderer> {
|
|
71
|
-
await act(() => actioner()(renderer));
|
|
72
|
-
return renderer
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
)
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React, { CElement } from "react";
|
|
2
|
-
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
|
|
4
|
-
import Testeranto from "../../../Web";
|
|
5
|
-
import { ITTestShape, ITestImplementation, ITestSpecification } from "../../../core";
|
|
6
|
-
|
|
7
|
-
export type IInput = typeof React.Component;
|
|
8
|
-
export type IState = unknown;
|
|
9
|
-
export type IWhenShape = any;
|
|
10
|
-
export type IThenShape = any;
|
|
11
|
-
export type ISelection = {
|
|
12
|
-
htmlElement: HTMLElement,
|
|
13
|
-
reactElement: CElement<any, any>,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type IStore = {
|
|
17
|
-
htmlElement: HTMLElement,
|
|
18
|
-
reactElement: CElement<any, any>,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type ISubject = {
|
|
22
|
-
htmlElement: HTMLElement
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export { };
|
|
26
|
-
|
|
27
|
-
export const ReactTestRendererTesteranto = <
|
|
28
|
-
ITestShape extends ITTestShape,
|
|
29
|
-
IPropShape,
|
|
30
|
-
IStateShape
|
|
31
|
-
>(
|
|
32
|
-
testImplementations: ITestImplementation<
|
|
33
|
-
IPropShape,
|
|
34
|
-
renderer.ReactTestRenderer,
|
|
35
|
-
IWhenShape,
|
|
36
|
-
IThenShape,
|
|
37
|
-
ITestShape
|
|
38
|
-
>,
|
|
39
|
-
testSpecifications: ITestSpecification<
|
|
40
|
-
ITestShape,
|
|
41
|
-
ISubject,
|
|
42
|
-
IStore,
|
|
43
|
-
ISelection,
|
|
44
|
-
IThenShape>,
|
|
45
|
-
testInput: IInput,
|
|
46
|
-
) =>
|
|
47
|
-
Testeranto<
|
|
48
|
-
ITestShape,
|
|
49
|
-
IInput,
|
|
50
|
-
any,
|
|
51
|
-
any,
|
|
52
|
-
any,
|
|
53
|
-
any,
|
|
54
|
-
any,
|
|
55
|
-
any
|
|
56
|
-
>(
|
|
57
|
-
testInput,
|
|
58
|
-
testSpecifications,
|
|
59
|
-
testImplementations,
|
|
60
|
-
{
|
|
61
|
-
beforeEach: function (CComponent, props): Promise<renderer.ReactTestRenderer> {
|
|
62
|
-
let component;
|
|
63
|
-
act(() => {
|
|
64
|
-
component = renderer.create(
|
|
65
|
-
React.createElement(CComponent, props, [])
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
return component;
|
|
69
|
-
},
|
|
70
|
-
andWhen: async function (renderer: renderer.ReactTestRenderer, actioner: any): Promise<renderer.ReactTestRenderer> {
|
|
71
|
-
await act(() => actioner()(renderer));
|
|
72
|
-
return renderer
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
)
|