testeranto 0.49.10 → 0.62.0
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/.nvmrc +1 -0
- package/README.md +71 -9
- package/dist/cjs-shim.js +12 -0
- package/dist/common/Features.js +2 -3
- package/dist/common/Node.js +53 -61
- package/dist/common/Project.js +272 -606
- package/dist/common/SubPackages/puppeteer.js +19 -0
- package/dist/common/{subPackages → SubPackages}/react/component/node.js +4 -4
- package/dist/common/{subPackages → SubPackages}/react/component/web.js +4 -4
- package/dist/common/SubPackages/react/jsx/index.js +13 -0
- package/dist/common/SubPackages/react/jsx/node.js +10 -0
- package/dist/common/SubPackages/react/jsx/web.js +10 -0
- package/dist/common/{subPackages → SubPackages}/react-dom/component/node.js +6 -6
- package/dist/common/{subPackages → SubPackages}/react-dom/component/web.js +11 -12
- package/dist/common/SubPackages/react-dom/jsx/node.js +39 -0
- package/dist/common/{subPackages → SubPackages}/react-dom/jsx/web.js +5 -14
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +2 -2
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/component/index.js +26 -15
- package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/component}/node.js +3 -5
- package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/component}/web.js +3 -5
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/fc/node.js +4 -4
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/fc/web.js +4 -4
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +8 -2
- package/dist/common/{subPackages/react-test-renderer/jsx-promised → SubPackages/react-test-renderer/jsx}/node.js +4 -4
- package/dist/common/{subPackages/react → SubPackages/react-test-renderer}/jsx/web.js +4 -4
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +2 -2
- package/dist/common/{subPackages/react/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +2 -2
- package/dist/common/Types.js +32 -0
- package/dist/common/Web.js +41 -112
- package/dist/common/electron.js +188 -44
- package/dist/common/esbuildConfigs/features.js +14 -0
- package/dist/common/esbuildConfigs/index.js +20 -0
- package/dist/common/esbuildConfigs/node.js +35 -0
- package/dist/common/esbuildConfigs/report.js +48 -0
- package/dist/common/esbuildConfigs/tests.js +14 -0
- package/dist/common/esbuildConfigs/web.js +50 -0
- package/dist/common/lib/abstractBase.js +193 -0
- package/dist/common/lib/basebuilder.js +86 -0
- package/dist/common/lib/browser.js +26 -0
- package/dist/common/lib/classBuilder.js +41 -0
- package/dist/common/lib/core.js +52 -0
- package/dist/common/lib/index.js +19 -0
- package/dist/common/nodeWriterElectron.js +55 -0
- package/dist/common/preload.js +22 -21
- package/dist/common/report.html.js +31 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/common/web.html.js +22 -0
- package/dist/module/Features.js +2 -3
- package/dist/module/Node.js +53 -61
- package/dist/module/Project.js +272 -583
- package/dist/module/SubPackages/puppeteer.js +14 -0
- package/dist/module/{subPackages → SubPackages}/react/component/node.js +3 -3
- package/dist/module/{subPackages → SubPackages}/react/component/web.js +3 -3
- package/dist/module/SubPackages/react/jsx/index.js +10 -0
- package/dist/module/SubPackages/react/jsx/node.js +5 -0
- package/dist/module/SubPackages/react/jsx/web.js +5 -0
- package/dist/module/{subPackages → SubPackages}/react-dom/component/node.js +5 -5
- package/dist/module/{subPackages → SubPackages}/react-dom/component/web.js +10 -11
- package/dist/module/SubPackages/react-dom/jsx/node.js +31 -0
- package/dist/module/{subPackages → SubPackages}/react-dom/jsx/web.js +4 -13
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +2 -2
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/index.js +23 -15
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/node.js +2 -2
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/web.js +2 -2
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/fc/node.js +3 -3
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/fc/web.js +3 -3
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +8 -2
- 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/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +2 -2
- package/dist/module/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +1 -1
- package/dist/module/Types.js +30 -1
- package/dist/module/Web.js +41 -112
- package/dist/module/electron.js +189 -45
- package/dist/module/esbuildConfigs/features.js +12 -0
- package/dist/module/esbuildConfigs/index.js +18 -0
- package/dist/module/esbuildConfigs/node.js +30 -0
- package/dist/module/esbuildConfigs/report.js +48 -0
- package/dist/module/esbuildConfigs/tests.js +12 -0
- package/dist/module/esbuildConfigs/web.js +45 -0
- package/dist/module/lib/abstractBase.js +185 -0
- package/dist/module/lib/basebuilder.js +82 -0
- package/dist/module/lib/browser.js +22 -0
- package/dist/module/lib/classBuilder.js +37 -0
- package/dist/module/lib/core.js +49 -0
- package/dist/module/lib/index.js +15 -0
- package/dist/module/nodeWriterElectron.js +52 -0
- package/dist/module/preload.js +22 -21
- package/dist/module/report.html.js +29 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/module/web.html.js +20 -0
- package/dist/prebuild/Report.css +10326 -0
- package/dist/prebuild/Report.js +37456 -0
- package/dist/types/Features.d.ts +5 -5
- package/dist/types/Node.d.ts +4 -11
- package/dist/types/NodeWriter.d.ts +1 -1
- package/dist/types/Project.d.ts +2 -27
- package/dist/types/SubPackages/puppeteer.d.ts +6 -0
- package/dist/types/SubPackages/react/component/node.d.ts +7 -0
- package/dist/types/SubPackages/react/component/web.d.ts +7 -0
- package/dist/types/SubPackages/react/jsx/index.d.ts +15 -0
- package/dist/types/SubPackages/react/jsx/node.d.ts +4 -0
- package/dist/types/SubPackages/react/jsx/web.d.ts +4 -0
- package/dist/types/{subPackages → SubPackages}/react-dom/component/node.d.ts +2 -4
- package/dist/types/SubPackages/react-dom/component/web.d.ts +5 -0
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +6 -0
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +5 -0
- package/dist/types/{subPackages → SubPackages}/react-test-renderer/component/index.d.ts +6 -6
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +4 -0
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +8 -0
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +8 -0
- package/dist/types/{subPackages → SubPackages}/react-test-renderer/jsx/index.d.ts +5 -4
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +9 -0
- package/dist/types/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.d.ts +4 -4
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +5 -0
- package/dist/types/Types.d.ts +116 -3
- package/dist/types/Web.d.ts +4 -11
- package/dist/types/esbuildConfigs/features.d.ts +4 -0
- package/dist/types/esbuildConfigs/index.d.ts +4 -0
- package/dist/types/esbuildConfigs/node.d.ts +4 -0
- package/dist/types/esbuildConfigs/report.d.ts +0 -0
- package/dist/types/esbuildConfigs/tests.d.ts +4 -0
- package/dist/types/esbuildConfigs/web.d.ts +4 -0
- package/dist/types/lib/abstractBase.d.ts +102 -0
- package/dist/types/lib/basebuilder.d.ts +24 -0
- package/dist/types/lib/browser.d.ts +6 -0
- package/dist/types/lib/classBuilder.d.ts +6 -0
- package/dist/types/lib/core.d.ts +7 -0
- package/dist/types/lib/index.d.ts +57 -0
- package/dist/types/nodeWriterElectron.d.ts +2 -0
- package/dist/types/report.html.d.ts +2 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/web.html.d.ts +2 -0
- package/electronBuild.ts +32 -0
- package/index.html +30 -0
- package/package.json +120 -85
- package/src/Features.ts +2 -4
- package/src/Node.ts +114 -160
- package/src/NodeWriter.ts +1 -4
- package/src/Project.ts +610 -753
- package/src/Report.tsx +30 -15
- package/src/SubPackages/puppeteer.ts +46 -0
- package/src/{subPackages → SubPackages}/react/component/node.ts +12 -32
- package/src/SubPackages/react/component/web.ts +53 -0
- package/src/SubPackages/react/jsx/index.ts +43 -0
- package/src/SubPackages/react/jsx/node.ts +29 -0
- package/src/SubPackages/react/jsx/web.ts +28 -0
- package/src/{subPackages → SubPackages}/react-dom/component/node.ts +11 -25
- package/src/{subPackages → SubPackages}/react-dom/component/web.ts +27 -32
- package/src/{subPackages → SubPackages}/react-dom/jsx/index.ts +0 -1
- package/src/SubPackages/react-dom/jsx/node.ts +68 -0
- package/src/{subPackages → SubPackages}/react-dom/jsx/web.ts +18 -54
- package/src/{subPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.ts +9 -28
- package/src/{subPackages → SubPackages}/react-test-renderer/component/index.ts +31 -29
- package/src/SubPackages/react-test-renderer/component/node.ts +22 -0
- package/src/SubPackages/react-test-renderer/component/web.ts +22 -0
- package/src/{subPackages → SubPackages}/react-test-renderer/fc/node.ts +14 -28
- package/src/{subPackages → SubPackages}/react-test-renderer/fc/web.ts +9 -25
- package/src/{subPackages → SubPackages}/react-test-renderer/jsx/index.ts +19 -16
- package/src/SubPackages/react-test-renderer/jsx/node.ts +24 -0
- package/src/SubPackages/react-test-renderer/jsx/web.ts +20 -0
- package/src/{subPackages → SubPackages}/react-test-renderer/jsx-promised/index.ts +7 -15
- package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +19 -0
- package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +22 -0
- package/src/Types.ts +334 -3
- package/src/Web.ts +104 -230
- package/src/cjs-shim.js +12 -0
- package/src/electron.ts +237 -46
- package/src/esbuildConfigs/features.ts +18 -0
- package/src/esbuildConfigs/index.ts +22 -0
- package/src/esbuildConfigs/node.ts +59 -0
- package/src/esbuildConfigs/report.ts +51 -0
- package/src/esbuildConfigs/tests.ts +20 -0
- package/src/esbuildConfigs/web.ts +73 -0
- package/src/lib/abstractBase.ts +459 -0
- package/src/lib/basebuilder.ts +253 -0
- package/src/lib/browser.ts +34 -0
- package/src/lib/classBuilder.ts +137 -0
- package/src/lib/core.ts +182 -0
- package/src/lib/index.ts +116 -0
- package/src/nodeWriterElectron.ts +71 -0
- package/src/preload.ts +23 -21
- package/src/report.html.ts +29 -0
- package/src/web.html.ts +20 -0
- package/tests/Rectangle.test.ts +189 -0
- package/tsconfig.json +19 -6
- package/tsconfig.module.json +15 -4
- package/tsconfig.types.json +14 -4
- package/yarn-error.log +3144 -0
- package/dist/common/core.js +0 -397
- package/dist/common/subPackages/react/jsx/index.js +0 -26
- package/dist/common/subPackages/react-dom/jsx/node.js +0 -95
- package/dist/common/subPackages/react-test-renderer/component/node.js +0 -8
- package/dist/common/subPackages/react-test-renderer/component/web.js +0 -8
- package/dist/module/Report.js +0 -186
- package/dist/module/core.js +0 -388
- package/dist/module/subPackages/react/jsx/index.js +0 -22
- package/dist/module/subPackages/react/jsx/node.js +0 -5
- package/dist/module/subPackages/react/jsx/web.js +0 -5
- package/dist/module/subPackages/react-dom/jsx/node.js +0 -87
- package/dist/module/subPackages/react-test-renderer/jsx/web.js +0 -5
- package/dist/module/subPackages/react-test-renderer/jsx-promised/node.js +0 -5
- package/dist/types/core.d.ts +0 -220
- package/dist/types/subPackages/react/component/node.d.ts +0 -12
- package/dist/types/subPackages/react/component/web.d.ts +0 -12
- package/dist/types/subPackages/react/jsx/index.d.ts +0 -15
- package/dist/types/subPackages/react/jsx/node.d.ts +0 -4
- package/dist/types/subPackages/react/jsx/web.d.ts +0 -4
- package/dist/types/subPackages/react-dom/component/web.d.ts +0 -19
- package/dist/types/subPackages/react-dom/jsx/node.d.ts +0 -8
- package/dist/types/subPackages/react-dom/jsx/web.d.ts +0 -5
- package/dist/types/subPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -8
- package/dist/types/subPackages/react-test-renderer/component/node.d.ts +0 -9
- package/dist/types/subPackages/react-test-renderer/component/web.d.ts +0 -9
- package/dist/types/subPackages/react-test-renderer/fc/node.d.ts +0 -9
- package/dist/types/subPackages/react-test-renderer/fc/web.d.ts +0 -9
- package/dist/types/subPackages/react-test-renderer/jsx/node.d.ts +0 -4
- package/dist/types/subPackages/react-test-renderer/jsx/web.d.ts +0 -4
- package/dist/types/subPackages/react-test-renderer/jsx-promised/node.d.ts +0 -4
- package/dist/types/subPackages/react-test-renderer/jsx-promised/web.d.ts +0 -4
- package/src/core.ts +0 -1399
- package/src/subPackages/react/component/web.ts +0 -80
- package/src/subPackages/react/jsx/index.ts +0 -64
- package/src/subPackages/react/jsx/node.ts +0 -29
- package/src/subPackages/react/jsx/web.ts +0 -29
- package/src/subPackages/react-dom/jsx/node.ts +0 -145
- package/src/subPackages/react-test-renderer/component/node.ts +0 -30
- package/src/subPackages/react-test-renderer/component/web.ts +0 -30
- package/src/subPackages/react-test-renderer/jsx/node.ts +0 -31
- package/src/subPackages/react-test-renderer/jsx/web.ts +0 -31
- package/src/subPackages/react-test-renderer/jsx-promised/node.ts +0 -31
- package/src/subPackages/react-test-renderer/jsx-promised/web.ts +0 -31
- /package/dist/common/{subPackages → SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/module/{subPackages → SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/module/{subPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/types/{subPackages → SubPackages}/react-dom/jsx/index.d.ts +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class TBrowser {
|
|
2
|
+
constructor(browser) {
|
|
3
|
+
this.browser = browser;
|
|
4
|
+
}
|
|
5
|
+
pages() {
|
|
6
|
+
return new Promise(async (res, rej) => {
|
|
7
|
+
res((await this.browser.pages()).map((p) => {
|
|
8
|
+
// const handler = {
|
|
9
|
+
// apply: function (target, thisArg, argumentsList) {
|
|
10
|
+
// console.log('screenshot was called with ' + JSON.stringify(argumentsList));
|
|
11
|
+
// const x: ScreenshotOptions = argumentsList[0]
|
|
12
|
+
// x.path = "./dist/" + x.path;
|
|
13
|
+
// console.log('x.path' + x.path, target, thisArg);
|
|
14
|
+
// return target(...argumentsList);
|
|
15
|
+
// }
|
|
16
|
+
// };
|
|
17
|
+
// p.screenshot = new Proxy(p.screenshot, handler);
|
|
18
|
+
return p;
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseBuilder } from "./basebuilder.js";
|
|
2
|
+
export class ClassBuilder extends BaseBuilder {
|
|
3
|
+
constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, checkKlasser, testResourceRequirement, logWriter) {
|
|
4
|
+
const classySuites = Object.entries(testImplementation.suites).reduce((a, [key], index) => {
|
|
5
|
+
a[key] = (somestring, givens, checks) => {
|
|
6
|
+
return new suiteKlasser.prototype.constructor(somestring, index, givens, checks);
|
|
7
|
+
};
|
|
8
|
+
return a;
|
|
9
|
+
}, {});
|
|
10
|
+
const classyGivens = Object.entries(testImplementation.givens)
|
|
11
|
+
.reduce((a, [key, givEn]) => {
|
|
12
|
+
a[key] = (features, whens, thens, givEn) => {
|
|
13
|
+
return new (givenKlasser.prototype).constructor(key, features, whens, thens, testImplementation.givens[key], givEn);
|
|
14
|
+
};
|
|
15
|
+
return a;
|
|
16
|
+
}, {});
|
|
17
|
+
const classyWhens = Object.entries(testImplementation.whens).reduce((a, [key, whEn]) => {
|
|
18
|
+
a[key] = (payload) => {
|
|
19
|
+
return new whenKlasser.prototype.constructor(`${whEn.name}: ${payload && payload.toString()}`, whEn(payload));
|
|
20
|
+
};
|
|
21
|
+
return a;
|
|
22
|
+
}, {});
|
|
23
|
+
const classyThens = Object.entries(testImplementation.thens).reduce((a, [key, thEn]) => {
|
|
24
|
+
a[key] = (expected, x) => {
|
|
25
|
+
return new thenKlasser.prototype.constructor(`${thEn.name}: ${expected && expected.toString()}`, thEn(expected));
|
|
26
|
+
};
|
|
27
|
+
return a;
|
|
28
|
+
}, {});
|
|
29
|
+
const classyChecks = Object.entries(testImplementation.checks).reduce((a, [key, z]) => {
|
|
30
|
+
a[key] = (somestring, features, callback) => {
|
|
31
|
+
return new checkKlasser.prototype.constructor(somestring, features, callback, classyWhens, classyThens);
|
|
32
|
+
};
|
|
33
|
+
return a;
|
|
34
|
+
}, {});
|
|
35
|
+
super(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks, logWriter, testResourceRequirement, testSpecification);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DefaultTestInterface, defaultTestResourceRequirement } from "./index.js";
|
|
2
|
+
import { BaseSuite, BaseGiven, BaseWhen, BaseThen, BaseCheck } from "./abstractBase.js";
|
|
3
|
+
import { ClassBuilder } from "./classBuilder.js";
|
|
4
|
+
export default class Testeranto extends ClassBuilder {
|
|
5
|
+
constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, logWriter, testInterface) {
|
|
6
|
+
const fullTestInterface = DefaultTestInterface(testInterface);
|
|
7
|
+
super(testImplementation, testSpecification, input, class extends BaseSuite {
|
|
8
|
+
assertThat(t) {
|
|
9
|
+
fullTestInterface.assertThis(t);
|
|
10
|
+
}
|
|
11
|
+
async setup(s, artifactory, tr) {
|
|
12
|
+
return (fullTestInterface.beforeAll || (async (input, artifactory, tr) => input))(s, this.testResourceConfiguration, artifactory);
|
|
13
|
+
}
|
|
14
|
+
}, class Given extends BaseGiven {
|
|
15
|
+
async givenThat(subject, testResource, artifactory, initializer) {
|
|
16
|
+
return fullTestInterface.beforeEach(subject, initializer, (fPath, value) =>
|
|
17
|
+
// TODO does not work?
|
|
18
|
+
artifactory(`beforeEach/${fPath}`, value), testResource, this.initialValues);
|
|
19
|
+
}
|
|
20
|
+
afterEach(store, key, artifactory) {
|
|
21
|
+
return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) => artifactory(`after/${fPath}`, value))));
|
|
22
|
+
}
|
|
23
|
+
afterAll(store, artifactory, utils) {
|
|
24
|
+
return fullTestInterface.afterAll(store, (fPath, value) => { artifactory(`afterAll4-${this.name}/${fPath}`, value); }, utils);
|
|
25
|
+
}
|
|
26
|
+
}, class When extends BaseWhen {
|
|
27
|
+
async andWhen(store, whenCB, testResource) {
|
|
28
|
+
return await fullTestInterface.andWhen(store, whenCB, testResource);
|
|
29
|
+
}
|
|
30
|
+
}, class Then extends BaseThen {
|
|
31
|
+
async butThen(store, thenCB, testResourceConfiguration) {
|
|
32
|
+
return await fullTestInterface.butThen(store, thenCB, testResourceConfiguration);
|
|
33
|
+
}
|
|
34
|
+
}, class Check extends BaseCheck {
|
|
35
|
+
constructor(name, features, checkCallback, whens, thens, initialValues) {
|
|
36
|
+
super(name, features, checkCallback, whens, thens);
|
|
37
|
+
this.initialValues = initialValues;
|
|
38
|
+
}
|
|
39
|
+
async checkThat(subject, testResourceConfiguration, artifactory) {
|
|
40
|
+
return fullTestInterface.beforeEach(subject, this.initialValues, (fPath, value) => artifactory(`before/${fPath}`, value), testResourceConfiguration, this.initialValues);
|
|
41
|
+
}
|
|
42
|
+
afterEach(store, key, artifactory) {
|
|
43
|
+
return new Promise((res) => res(fullTestInterface.afterEach(store, key, (fPath, value) =>
|
|
44
|
+
// TODO does not work?
|
|
45
|
+
artifactory(`afterEach2-${this.name}/${fPath}`, value))));
|
|
46
|
+
}
|
|
47
|
+
}, testResourceRequirement, logWriter);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const BaseTestInterface = {
|
|
2
|
+
beforeAll: (async (s) => s),
|
|
3
|
+
beforeEach: async function (subject, initialValues, testResource) { return subject; },
|
|
4
|
+
afterEach: (async (s) => s),
|
|
5
|
+
afterAll: ((store) => undefined),
|
|
6
|
+
butThen: (async (store, thenCb) => thenCb(store)),
|
|
7
|
+
andWhen: ((a) => a),
|
|
8
|
+
assertThis: (() => null),
|
|
9
|
+
};
|
|
10
|
+
export const DefaultTestInterface = (p) => {
|
|
11
|
+
return Object.assign(Object.assign({}, BaseTestInterface), p);
|
|
12
|
+
};
|
|
13
|
+
export const defaultTestResourceRequirement = {
|
|
14
|
+
ports: 0
|
|
15
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// import fs from "fs";
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
// import path from "path";
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const fPaths = [];
|
|
6
|
+
export const NodeWriterElectron = {
|
|
7
|
+
createWriteStream: (filepath) => {
|
|
8
|
+
return fs.createWriteStream(filepath);
|
|
9
|
+
},
|
|
10
|
+
writeFileSync: (fp, contents) => {
|
|
11
|
+
fs.writeFileSync(fp, contents);
|
|
12
|
+
},
|
|
13
|
+
mkdirSync: async (fp) => {
|
|
14
|
+
await fs.mkdirSync(fp, { recursive: true });
|
|
15
|
+
},
|
|
16
|
+
testArtiFactoryfileWriter: (tLog, callback) => (fPath, value) => {
|
|
17
|
+
callback(new Promise((res, rej) => {
|
|
18
|
+
tLog("testArtiFactory =>", fPath);
|
|
19
|
+
const cleanPath = path.resolve(fPath);
|
|
20
|
+
fPaths.push(cleanPath.replace(process.cwd(), ``));
|
|
21
|
+
const targetDir = cleanPath.split("/").slice(0, -1).join("/");
|
|
22
|
+
fs.mkdir(targetDir, { recursive: true }, async (error) => {
|
|
23
|
+
if (error) {
|
|
24
|
+
console.error(`❗️testArtiFactory failed`, targetDir, error);
|
|
25
|
+
}
|
|
26
|
+
fs.writeFileSync(path.resolve(targetDir.split("/").slice(0, -1).join("/"), "manifest"), fPaths.join(`\n`), {
|
|
27
|
+
encoding: "utf-8",
|
|
28
|
+
});
|
|
29
|
+
if (Buffer.isBuffer(value)) {
|
|
30
|
+
fs.writeFileSync(fPath, value, "binary");
|
|
31
|
+
res();
|
|
32
|
+
}
|
|
33
|
+
else if (`string` === typeof value) {
|
|
34
|
+
fs.writeFileSync(fPath, value.toString(), {
|
|
35
|
+
encoding: "utf-8",
|
|
36
|
+
});
|
|
37
|
+
res();
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
/* @ts-ignore:next-line */
|
|
41
|
+
const pipeStream = value;
|
|
42
|
+
const myFile = fs.createWriteStream(fPath);
|
|
43
|
+
pipeStream.pipe(myFile);
|
|
44
|
+
pipeStream.on("close", () => {
|
|
45
|
+
myFile.close();
|
|
46
|
+
res();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
};
|
package/dist/module/preload.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { NodeWriter } from "./NodeWriter";
|
|
2
1
|
import { ipcRenderer } from "electron";
|
|
2
|
+
console.log("hello preloader");
|
|
3
|
+
import { NodeWriter } from "./NodeWriter";
|
|
3
4
|
window.NodeWriter = NodeWriter;
|
|
4
5
|
window.exit = (x) => {
|
|
5
6
|
ipcRenderer.invoke('quit-app', x);
|
|
6
7
|
};
|
|
7
|
-
var oldLog = console.log;
|
|
8
|
-
console.log = function (message) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
var oldLog = console.error;
|
|
13
|
-
console.error = function (message) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
var oldLog = console.warn;
|
|
18
|
-
console.warn = function (message) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
var oldLog = console.info;
|
|
23
|
-
console.info = function (message) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
8
|
+
// var oldLog = console.log;
|
|
9
|
+
// console.log = function (message) {
|
|
10
|
+
// ipcRenderer.invoke('web-log', message.toString());
|
|
11
|
+
// oldLog.apply(console, arguments);
|
|
12
|
+
// };
|
|
13
|
+
// var oldLog = console.error;
|
|
14
|
+
// console.error = function (message) {
|
|
15
|
+
// ipcRenderer.invoke('web-error', message.toString());
|
|
16
|
+
// oldLog.apply(console, arguments);
|
|
17
|
+
// };
|
|
18
|
+
// var oldLog = console.warn;
|
|
19
|
+
// console.warn = function (message) {
|
|
20
|
+
// ipcRenderer.invoke('web-warn', message.toString());
|
|
21
|
+
// oldLog.apply(console, arguments);
|
|
22
|
+
// };
|
|
23
|
+
// var oldLog = console.info;
|
|
24
|
+
// console.info = function (message) {
|
|
25
|
+
// ipcRenderer.invoke('web-info', message.toString());
|
|
26
|
+
// oldLog.apply(console, arguments);
|
|
27
|
+
// };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default () => `
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<meta name="description" content="Webpage description goes here" />
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<title>kokomoBay - testeranto</title>
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
|
+
<meta name="author" content="" />
|
|
11
|
+
|
|
12
|
+
<link rel="stylesheet" href="./Report.css">
|
|
13
|
+
|
|
14
|
+
<script type="importmap">
|
|
15
|
+
{
|
|
16
|
+
"imports": {
|
|
17
|
+
"features.test.js": "./features.test.js",
|
|
18
|
+
"testeranto.json": "./testeranto.json"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<script type="module" src="./Report.js"></script>
|
|
24
|
+
</head>
|
|
25
|
+
|
|
26
|
+
<body><div id="root">react is loading</div></body>
|
|
27
|
+
|
|
28
|
+
</html>
|
|
29
|
+
`;
|