testeranto 0.48.0 → 0.48.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 +27 -49
- package/dist/common/subPackages/react-test-renderer/MemoExoticComponent/node.js +44 -0
- package/dist/common/subPackages/react-test-renderer/fc/node.js +50 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/Project.js +27 -49
- package/dist/module/subPackages/react-test-renderer/MemoExoticComponent/node.js +16 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/subPackages/react-test-renderer/MemoExoticComponent/node.d.ts +8 -0
- package/dist/types/subPackages/react-test-renderer/component/node.d.ts +1 -1
- package/dist/types/subPackages/react-test-renderer/component/web.d.ts +1 -1
- package/dist/types/subPackages/react-test-renderer/fc/node.d.ts +9 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +5 -1
- package/src/Project.ts +39 -57
- package/src/subPackages/react-test-renderer/MemoExoticComponent/node.ts +67 -0
- /package/src/subPackages/react-test-renderer/fc/{node.tsx → node.ts} +0 -0
package/dist/common/Project.js
CHANGED
|
@@ -128,7 +128,6 @@ class ITProject {
|
|
|
128
128
|
});
|
|
129
129
|
const testPath = `${process.cwd()}/${config.tests}`;
|
|
130
130
|
const featurePath = `${process.cwd()}/${config.features}`;
|
|
131
|
-
// q to quit, x to kill
|
|
132
131
|
process.stdin.on('keypress', (str, key) => {
|
|
133
132
|
if (key.name === 'q') {
|
|
134
133
|
this.initiateShutdown("'q' command");
|
|
@@ -140,14 +139,10 @@ class ITProject {
|
|
|
140
139
|
process.exit(-1);
|
|
141
140
|
}
|
|
142
141
|
});
|
|
143
|
-
// process.on('SIGINT', () => this.initiateShutdown("CTRL+C"));
|
|
144
|
-
// process.on('SIGQUIT', () => this.initiateShutdown("Keyboard quit"));
|
|
145
|
-
// process.on('SIGTERM', () => this.initiateShutdown("'kill' command"));
|
|
146
142
|
Promise.resolve().then(() => __importStar(require(testPath))).then((tests) => {
|
|
147
143
|
this.tests = tests.default;
|
|
148
144
|
Promise.resolve().then(() => __importStar(require(featurePath))).then((features) => {
|
|
149
145
|
this.features = features.default;
|
|
150
|
-
// Make html files for webtests. Is this necessary?
|
|
151
146
|
Promise.resolve(Promise.all([
|
|
152
147
|
...this.getSecondaryEndpointsPoints("web")
|
|
153
148
|
]
|
|
@@ -209,18 +204,16 @@ class ITProject {
|
|
|
209
204
|
},
|
|
210
205
|
plugins: [
|
|
211
206
|
...(config.nodePlugins || []),
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
// }
|
|
223
|
-
// },
|
|
207
|
+
{
|
|
208
|
+
name: 'rebuild-notify',
|
|
209
|
+
setup(build) {
|
|
210
|
+
build.onEnd(result => {
|
|
211
|
+
console.log(`node build ended with ${result.errors.length} errors`);
|
|
212
|
+
console.log(result);
|
|
213
|
+
result.errors.length !== 0 && process.exit(-1);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
},
|
|
224
217
|
],
|
|
225
218
|
};
|
|
226
219
|
const esbuildConfigWeb = {
|
|
@@ -232,14 +225,14 @@ class ITProject {
|
|
|
232
225
|
react: path_1.default.resolve("./node_modules/react")
|
|
233
226
|
},
|
|
234
227
|
external: [
|
|
228
|
+
"tests.test.js",
|
|
229
|
+
"features.test.js",
|
|
235
230
|
// "url",
|
|
231
|
+
// "react",
|
|
236
232
|
"electron",
|
|
237
233
|
"path",
|
|
238
234
|
"fs",
|
|
239
|
-
// "react",
|
|
240
235
|
"stream",
|
|
241
|
-
"tests.test.js",
|
|
242
|
-
"features.test.js"
|
|
243
236
|
],
|
|
244
237
|
platform: "browser",
|
|
245
238
|
outbase: config.outbase,
|
|
@@ -260,18 +253,16 @@ class ITProject {
|
|
|
260
253
|
},
|
|
261
254
|
plugins: [
|
|
262
255
|
...(config.webPlugins || []),
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
// }
|
|
274
|
-
// },
|
|
256
|
+
{
|
|
257
|
+
name: 'rebuild-notify',
|
|
258
|
+
setup(build) {
|
|
259
|
+
build.onEnd(result => {
|
|
260
|
+
console.log(`web build ended with ${result.errors.length} errors`);
|
|
261
|
+
console.log(result);
|
|
262
|
+
result.errors.length !== 0 && process.exit(-1);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
},
|
|
275
266
|
],
|
|
276
267
|
};
|
|
277
268
|
esbuild_1.default.build({
|
|
@@ -317,10 +308,12 @@ class ITProject {
|
|
|
317
308
|
</html>
|
|
318
309
|
`);
|
|
319
310
|
Promise.all([
|
|
320
|
-
esbuild_1.default.context(esbuildConfigNode)
|
|
311
|
+
esbuild_1.default.context(esbuildConfigNode)
|
|
312
|
+
.then(async (nodeContext) => {
|
|
321
313
|
await nodeContext.watch();
|
|
322
314
|
}),
|
|
323
|
-
esbuild_1.default.context(esbuildConfigWeb)
|
|
315
|
+
esbuild_1.default.context(esbuildConfigWeb)
|
|
316
|
+
.then(async (esbuildWeb) => {
|
|
324
317
|
await esbuildWeb.watch();
|
|
325
318
|
})
|
|
326
319
|
]).then(() => {
|
|
@@ -344,30 +337,16 @@ class ITProject {
|
|
|
344
337
|
});
|
|
345
338
|
webSocketServer.on('open', () => {
|
|
346
339
|
console.log('open');
|
|
347
|
-
// process.exit()
|
|
348
340
|
});
|
|
349
341
|
webSocketServer.on('close', (data) => {
|
|
350
342
|
console.log('webSocketServer close: %s', data);
|
|
351
|
-
// process.exit()
|
|
352
343
|
});
|
|
353
344
|
webSocketServer.on('listening', () => {
|
|
354
345
|
console.log("webSocketServer listening", webSocketServer.address());
|
|
355
|
-
// process.exit()
|
|
356
346
|
});
|
|
357
347
|
webSocketServer.on('connection', (webSocket) => {
|
|
358
|
-
console.log('webSocketServer connection');
|
|
359
348
|
webSocket.on('message', (webSocketData) => {
|
|
360
|
-
// console.log('webSocket message: %s', webSocketData);
|
|
361
349
|
const payload = JSON.parse(webSocketData.valueOf().toString());
|
|
362
|
-
// console.log('webSocket payload', JSON.stringify(payload.data.testResourceConfiguration.name, null, 2));
|
|
363
|
-
// as {
|
|
364
|
-
// type: string,
|
|
365
|
-
// data: ITTestResourceRequirement & {
|
|
366
|
-
// testResourceConfiguration: {
|
|
367
|
-
// name: string;
|
|
368
|
-
// }
|
|
369
|
-
// }
|
|
370
|
-
// };
|
|
371
350
|
const messageType = payload.type;
|
|
372
351
|
if (messageType === "testeranto:hola") {
|
|
373
352
|
const name = payload.data.requirement.name;
|
|
@@ -405,7 +384,6 @@ class ITProject {
|
|
|
405
384
|
clearInterval(bootInterval);
|
|
406
385
|
pm2_1.default.launchBus((err, pm2_bus) => {
|
|
407
386
|
pm2_bus.on("testeranto:hola", (packet) => {
|
|
408
|
-
console.log("hola IPC", packet);
|
|
409
387
|
this.requestResource(packet.data.requirement, 'ipc');
|
|
410
388
|
});
|
|
411
389
|
pm2_bus.on("testeranto:adios", (payload) => {
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
const Node_1 = __importDefault(require("../../../Node"));
|
|
30
|
+
const react_1 = __importDefault(require("react"));
|
|
31
|
+
const react_test_renderer_1 = __importStar(require("react-test-renderer"));
|
|
32
|
+
exports.default = (testImplementations, testSpecifications, testInput) => (0, Node_1.default)(testInput, testSpecifications, testImplementations, {
|
|
33
|
+
beforeEach: function (CComponent, props) {
|
|
34
|
+
let component;
|
|
35
|
+
(0, react_test_renderer_1.act)(() => {
|
|
36
|
+
component = react_test_renderer_1.default.create(react_1.default.createElement(CComponent, props, []));
|
|
37
|
+
});
|
|
38
|
+
return component;
|
|
39
|
+
},
|
|
40
|
+
andWhen: async function (renderer, actioner) {
|
|
41
|
+
await (0, react_test_renderer_1.act)(() => actioner()(renderer));
|
|
42
|
+
return renderer;
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
const Node_1 = __importDefault(require("../../../Node"));
|
|
30
|
+
const react_1 = __importDefault(require("react"));
|
|
31
|
+
const react_test_renderer_1 = __importStar(require("react-test-renderer"));
|
|
32
|
+
exports.default = (testImplementations, testSpecifications, testInput) => (0, Node_1.default)(testInput, testSpecifications, testImplementations, {
|
|
33
|
+
beforeEach: function (CComponent, props) {
|
|
34
|
+
return new Promise((res, rej) => {
|
|
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
|
+
res(component);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
andWhen: async function (renderer, actioner) {
|
|
43
|
+
await (0, react_test_renderer_1.act)(() => actioner()(renderer));
|
|
44
|
+
return renderer;
|
|
45
|
+
},
|
|
46
|
+
afterEach: async (store, key, artificer) => {
|
|
47
|
+
console.log("afterall");
|
|
48
|
+
store.unmount();
|
|
49
|
+
},
|
|
50
|
+
});
|