testeranto 0.198.0 → 0.200.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/bin/test_runner +0 -0
- package/bin/testeranto +0 -0
- package/bundle.js +2 -2
- package/cmd/test_runner/main.go +65 -0
- package/cmd/testeranto/main.go +37 -0
- package/dist/common/src/PM/main.js +126 -11
- package/dist/common/src/PM/pitonoRunner.js +54 -0
- package/dist/common/src/components/pure/TestPageView.js +180 -65
- package/dist/common/src/components/stateful/TestPage.js +50 -11
- package/dist/common/src/lib/abstractBase.test/index.js +1 -0
- package/dist/common/src/run.js +48 -82
- package/dist/common/src/{build.js → testeranto.js} +107 -55
- package/dist/common/src/utils/golingvuMetafile.js +116 -0
- package/dist/common/src/utils/logFiles.js +2 -1
- package/dist/common/src/utils/pitonoMetafile.js +67 -0
- package/dist/common/src/utils.js +40 -1
- package/dist/common/testeranto.config.js +23 -21
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/PM/main.js +126 -11
- package/dist/module/src/PM/pitonoRunner.js +47 -0
- package/dist/module/src/components/pure/TestPageView.js +180 -65
- package/dist/module/src/components/stateful/TestPage.js +50 -11
- package/dist/module/src/lib/abstractBase.test/index.js +1 -0
- package/dist/module/src/run.js +49 -45
- package/dist/module/src/{build.js → testeranto.js} +107 -55
- package/dist/module/src/utils/golingvuMetafile.js +109 -0
- package/dist/module/src/utils/logFiles.js +2 -1
- package/dist/module/src/utils/pitonoMetafile.js +60 -0
- package/dist/module/src/utils.js +40 -1
- package/dist/module/testeranto.config.js +23 -21
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/App.js +81 -17
- package/dist/types/src/PM/main.d.ts +2 -0
- package/dist/types/src/PM/pitonoRunner.d.ts +7 -0
- package/dist/types/src/Types.d.ts +1 -1
- package/dist/types/src/run.d.ts +0 -1
- package/dist/types/src/utils/golingvuMetafile.d.ts +19 -0
- package/dist/types/src/utils/logFiles.d.ts +5 -1
- package/dist/types/src/utils/pitonoMetafile.d.ts +7 -0
- package/dist/types/src/utils.d.ts +5 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docs/index.md +13 -13
- package/example/test_example.py +106 -0
- package/go.mod +3 -0
- package/package.json +14 -14
- package/pitono/__init__.py +54 -0
- package/pitono/base_given.py +131 -0
- package/pitono/base_suite.py +95 -0
- package/pitono/base_then.py +50 -0
- package/pitono/base_when.py +52 -0
- package/pitono/core_generator.py +110 -0
- package/pitono/pitono.egg-info/PKG-INFO +17 -0
- package/pitono/pitono.egg-info/SOURCES.txt +7 -0
- package/pitono/pitono.egg-info/dependency_links.txt +1 -0
- package/pitono/pitono.egg-info/entry_points.txt +2 -0
- package/pitono/pitono.egg-info/top_level.txt +1 -0
- package/pitono/pyproject.toml +26 -0
- package/pitono/setup.py +40 -0
- package/pitono/simple_adapter.py +24 -0
- package/pitono/types.py +78 -0
- package/sampleMetafile.json +56 -0
- package/src/PM/main.ts +146 -17
- package/src/PM/pitonoRunner.ts +49 -0
- package/src/Types.ts +1 -1
- package/src/components/pure/TestPageView.tsx +175 -8
- package/src/components/stateful/TestPage.tsx +57 -16
- package/src/core/types.go +36 -0
- package/src/golingvu/README.md +3 -0
- package/src/golingvu/base_given.go +76 -0
- package/src/golingvu/base_suite.go +39 -0
- package/src/golingvu/base_suite_test.go +197 -0
- package/src/golingvu/base_then.go +21 -0
- package/src/golingvu/base_when.go +21 -0
- package/src/golingvu/golingvu.go +179 -0
- package/src/golingvu/test_adapter.go +33 -0
- package/src/golingvu/types.go +86 -0
- package/src/lib/abstractBase.test/index.ts +1 -0
- package/src/pitono/README.md +3 -0
- package/src/run.ts +48 -48
- package/src/templates/frontpage.html +26 -17
- package/src/{build.ts → testeranto.ts} +128 -58
- package/src/utils/golingvuMetafile.ts +165 -0
- package/src/utils/logFiles.ts +2 -1
- package/src/utils/pitonoMetafile.ts +68 -0
- package/src/utils.ts +38 -1
- package/testeranto/App.js +81 -17
- package/testeranto/metafiles/golang/core.json +72 -0
- package/testeranto/metafiles/node/core.json +21 -459
- package/testeranto/metafiles/pure/core.json +18 -119
- package/testeranto/metafiles/web/core.json +37 -16797
- package/testeranto/reports/core/config.json +8 -40
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +6 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/prompt.txt +12 -1
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +2 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +11 -1
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +2 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/prompt.txt +13 -3
- package/testeranto/reports/core/summary.json +9 -45
- package/testeranto.config.ts +25 -21
- package/tsc.log +46 -7
- package/dist/common/src/lib/mocks.test.js +0 -11
- package/dist/module/src/lib/mocks.test.js +0 -11
- package/dist/prebuild/build.mjs +0 -578
- package/dist/prebuild/run.mjs +0 -2290
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/src/lib/mocks.test.d.ts +0 -0
- package/src/lib/mocks.test.ts +0 -11
- package/testeranto/reports/core/src/Pure.test/pure/exit.log +0 -0
- package/testeranto/reports/core/src/Pure.test/pure/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/Pure.test/pure/message.txt +0 -17
- package/testeranto/reports/core/src/Pure.test/pure/prompt.txt +0 -14
- package/testeranto/reports/core/src/Pure.test/pure/type_errors.txt +0 -66
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/error.log +0 -67
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/exit.log +0 -1
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/info.log +0 -2
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/message.txt +0 -17
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/prompt.txt +0 -16
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/tests.json +0 -68
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/type_errors.txt +0 -56
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/error.log +0 -22
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/exit.log +0 -1
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/info.log +0 -2
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +0 -13
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/message.txt +0 -17
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +0 -16
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/tests.json +0 -88
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +0 -45
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/error.log +0 -0
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/exit.log +0 -1
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/info.log +0 -2
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/lint_errors.txt +0 -47
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/message.txt +0 -17
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/prompt.txt +0 -17
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/tests.json +0 -57
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/type_errors.txt +0 -99
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/exit.log +0 -1
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/message.txt +0 -17
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/prompt.txt +0 -17
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stderr.log +0 -18
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stdout.log +0 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/type_errors.txt +0 -32
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/exit.log +0 -1
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/lint_errors.txt +0 -15
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/message.txt +0 -17
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/prompt.txt +0 -17
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stderr.log +0 -66
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stdout.log +0 -10
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/type_errors.txt +0 -47
- /package/dist/types/src/{build.d.ts → testeranto.d.ts} +0 -0
package/dist/prebuild/build.mjs
DELETED
|
@@ -1,578 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/build.ts
|
|
4
|
-
import ansiC from "ansi-colors";
|
|
5
|
-
import fs4 from "fs";
|
|
6
|
-
import path4 from "path";
|
|
7
|
-
import readline from "readline";
|
|
8
|
-
import esbuild from "esbuild";
|
|
9
|
-
|
|
10
|
-
// src/utils.ts
|
|
11
|
-
import path from "path";
|
|
12
|
-
var getRunnables = (tests, projectName, payload = {
|
|
13
|
-
nodeEntryPoints: {},
|
|
14
|
-
nodeEntryPointSidecars: {},
|
|
15
|
-
webEntryPoints: {},
|
|
16
|
-
webEntryPointSidecars: {},
|
|
17
|
-
pureEntryPoints: {},
|
|
18
|
-
pureEntryPointSidecars: {}
|
|
19
|
-
}) => {
|
|
20
|
-
return tests.reduce((pt, cv, cndx, cry) => {
|
|
21
|
-
if (cv[1] === "node") {
|
|
22
|
-
pt.nodeEntryPoints[cv[0]] = path.resolve(
|
|
23
|
-
`./testeranto/bundles/node/${projectName}/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
24
|
-
);
|
|
25
|
-
} else if (cv[1] === "web") {
|
|
26
|
-
pt.webEntryPoints[cv[0]] = path.resolve(
|
|
27
|
-
`./testeranto/bundles/web/${projectName}/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
28
|
-
);
|
|
29
|
-
} else if (cv[1] === "pure") {
|
|
30
|
-
pt.pureEntryPoints[cv[0]] = path.resolve(
|
|
31
|
-
`./testeranto/bundles/pure/${projectName}/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
cv[3].filter((t) => t[1] === "node").forEach((t) => {
|
|
35
|
-
pt.nodeEntryPointSidecars[`${t[0]}`] = path.resolve(
|
|
36
|
-
`./testeranto/bundles/node/${projectName}/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
37
|
-
);
|
|
38
|
-
});
|
|
39
|
-
cv[3].filter((t) => t[1] === "web").forEach((t) => {
|
|
40
|
-
pt.webEntryPointSidecars[`${t[0]}`] = path.resolve(
|
|
41
|
-
`./testeranto/bundles/web/${projectName}/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
42
|
-
);
|
|
43
|
-
});
|
|
44
|
-
cv[3].filter((t) => t[1] === "pure").forEach((t) => {
|
|
45
|
-
pt.pureEntryPointSidecars[`${t[0]}`] = path.resolve(
|
|
46
|
-
`./testeranto/bundles/pure/${projectName}/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
47
|
-
);
|
|
48
|
-
});
|
|
49
|
-
return pt;
|
|
50
|
-
}, payload);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// src/utils/buildTemplates.ts
|
|
54
|
-
var getBaseHtml = (title) => `
|
|
55
|
-
<!DOCTYPE html>
|
|
56
|
-
<html lang="en">
|
|
57
|
-
<head>
|
|
58
|
-
<meta name="description" content="Webpage description goes here" />
|
|
59
|
-
<meta charset="utf-8" />
|
|
60
|
-
<title>${title} - testeranto</title>
|
|
61
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
62
|
-
<meta name="author" content="" />
|
|
63
|
-
|
|
64
|
-
<script>
|
|
65
|
-
function initApp() {
|
|
66
|
-
if (window.React && window.ReactDOM && window.App) {
|
|
67
|
-
const root = ReactDOM.createRoot(document.getElementById('root'));
|
|
68
|
-
root.render(React.createElement(App));
|
|
69
|
-
} else {
|
|
70
|
-
setTimeout(initApp, 100);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
window.addEventListener('DOMContentLoaded', initApp);
|
|
74
|
-
</script>
|
|
75
|
-
`;
|
|
76
|
-
var AppHtml = () => `
|
|
77
|
-
${getBaseHtml("Testeranto")}
|
|
78
|
-
|
|
79
|
-
<link rel="stylesheet" href="App.css" />
|
|
80
|
-
<script src="App.js"></script>
|
|
81
|
-
</head>
|
|
82
|
-
<body>
|
|
83
|
-
<div id="root"></div>
|
|
84
|
-
</body>
|
|
85
|
-
</html>
|
|
86
|
-
`;
|
|
87
|
-
|
|
88
|
-
// src/esbuildConfigs/index.ts
|
|
89
|
-
var esbuildConfigs_default = (config) => {
|
|
90
|
-
return {
|
|
91
|
-
// packages: "external",
|
|
92
|
-
target: "esnext",
|
|
93
|
-
format: "esm",
|
|
94
|
-
splitting: true,
|
|
95
|
-
outExtension: { ".js": ".mjs" },
|
|
96
|
-
outbase: ".",
|
|
97
|
-
jsx: "transform",
|
|
98
|
-
bundle: true,
|
|
99
|
-
minify: config.minify === true,
|
|
100
|
-
write: true,
|
|
101
|
-
loader: {
|
|
102
|
-
".js": "jsx",
|
|
103
|
-
".png": "binary",
|
|
104
|
-
".jpg": "binary"
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
// src/esbuildConfigs/inputFilesPlugin.ts
|
|
110
|
-
import fs from "fs";
|
|
111
|
-
var otherInputs = {};
|
|
112
|
-
var register = (entrypoint, sources) => {
|
|
113
|
-
if (!otherInputs[entrypoint]) {
|
|
114
|
-
otherInputs[entrypoint] = /* @__PURE__ */ new Set();
|
|
115
|
-
}
|
|
116
|
-
sources.forEach((s) => otherInputs[entrypoint].add(s));
|
|
117
|
-
};
|
|
118
|
-
var inputFilesPlugin_default = (platform, testName2) => {
|
|
119
|
-
const f = `testeranto/metafiles/${platform}/${testName2}.json`;
|
|
120
|
-
if (!fs.existsSync(`testeranto/metafiles/${platform}`)) {
|
|
121
|
-
fs.mkdirSync(`testeranto/metafiles/${platform}`, { recursive: true });
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
register,
|
|
125
|
-
inputFilesPluginFactory: {
|
|
126
|
-
name: "metafileWriter",
|
|
127
|
-
setup(build) {
|
|
128
|
-
build.onEnd((result) => {
|
|
129
|
-
fs.writeFileSync(f, JSON.stringify(result, null, 2));
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
// src/esbuildConfigs/featuresPlugin.ts
|
|
137
|
-
import path2 from "path";
|
|
138
|
-
var featuresPlugin_default = {
|
|
139
|
-
name: "feature-markdown",
|
|
140
|
-
setup(build) {
|
|
141
|
-
build.onResolve({ filter: /\.md$/ }, (args) => {
|
|
142
|
-
if (args.resolveDir === "")
|
|
143
|
-
return;
|
|
144
|
-
return {
|
|
145
|
-
path: path2.isAbsolute(args.path) ? args.path : path2.join(args.resolveDir, args.path),
|
|
146
|
-
namespace: "feature-markdown"
|
|
147
|
-
};
|
|
148
|
-
});
|
|
149
|
-
build.onLoad(
|
|
150
|
-
{ filter: /.*/, namespace: "feature-markdown" },
|
|
151
|
-
async (args) => {
|
|
152
|
-
return {
|
|
153
|
-
contents: `file://${args.path}`,
|
|
154
|
-
loader: "text"
|
|
155
|
-
// contents: JSON.stringify({ path: args.path }),
|
|
156
|
-
// loader: "json",
|
|
157
|
-
// contents: JSON.stringify({
|
|
158
|
-
// // html: markdownHTML,
|
|
159
|
-
// raw: markdownContent,
|
|
160
|
-
// filename: args.path, //path.basename(args.path),
|
|
161
|
-
// }),
|
|
162
|
-
// loader: "json",
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
// src/esbuildConfigs/rebuildPlugin.ts
|
|
170
|
-
import fs2 from "fs";
|
|
171
|
-
var rebuildPlugin_default = (r) => {
|
|
172
|
-
return {
|
|
173
|
-
name: "rebuild-notify",
|
|
174
|
-
setup: (build) => {
|
|
175
|
-
build.onEnd((result) => {
|
|
176
|
-
console.log(`${r} > build ended with ${result.errors.length} errors`);
|
|
177
|
-
if (result.errors.length > 0) {
|
|
178
|
-
fs2.writeFileSync(
|
|
179
|
-
`./testeranto/reports${r}_build_errors`,
|
|
180
|
-
JSON.stringify(result, null, 2)
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
// src/esbuildConfigs/node.ts
|
|
189
|
-
var node_default = (config, entryPoints, testName2) => {
|
|
190
|
-
const { inputFilesPluginFactory, register: register2 } = inputFilesPlugin_default(
|
|
191
|
-
"node",
|
|
192
|
-
testName2
|
|
193
|
-
);
|
|
194
|
-
return {
|
|
195
|
-
...esbuildConfigs_default(config),
|
|
196
|
-
splitting: true,
|
|
197
|
-
outdir: `testeranto/bundles/node/${testName2}/`,
|
|
198
|
-
inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
|
|
199
|
-
metafile: true,
|
|
200
|
-
supported: {
|
|
201
|
-
"dynamic-import": true
|
|
202
|
-
},
|
|
203
|
-
define: {
|
|
204
|
-
"process.env.FLUENTFFMPEG_COV": "0"
|
|
205
|
-
},
|
|
206
|
-
absWorkingDir: process.cwd(),
|
|
207
|
-
banner: {
|
|
208
|
-
js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`
|
|
209
|
-
},
|
|
210
|
-
platform: "node",
|
|
211
|
-
external: ["react", ...config.externals],
|
|
212
|
-
entryPoints: [...entryPoints],
|
|
213
|
-
plugins: [
|
|
214
|
-
featuresPlugin_default,
|
|
215
|
-
inputFilesPluginFactory,
|
|
216
|
-
rebuildPlugin_default("node"),
|
|
217
|
-
...config.nodePlugins.map((p) => p(register2, entryPoints)) || []
|
|
218
|
-
]
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
// src/esbuildConfigs/web.ts
|
|
223
|
-
import { polyfillNode } from "esbuild-plugin-polyfill-node";
|
|
224
|
-
import path3 from "path";
|
|
225
|
-
var web_default = (config, entryPoints, testName2) => {
|
|
226
|
-
const { inputFilesPluginFactory, register: register2 } = inputFilesPlugin_default(
|
|
227
|
-
"web",
|
|
228
|
-
testName2
|
|
229
|
-
);
|
|
230
|
-
return {
|
|
231
|
-
...esbuildConfigs_default(config),
|
|
232
|
-
treeShaking: true,
|
|
233
|
-
outdir: `testeranto/bundles/web/${testName2}`,
|
|
234
|
-
alias: {
|
|
235
|
-
react: path3.resolve("./node_modules/react")
|
|
236
|
-
},
|
|
237
|
-
metafile: true,
|
|
238
|
-
external: [
|
|
239
|
-
"path",
|
|
240
|
-
"fs",
|
|
241
|
-
"stream",
|
|
242
|
-
"http",
|
|
243
|
-
"constants",
|
|
244
|
-
"net",
|
|
245
|
-
"assert",
|
|
246
|
-
"tls",
|
|
247
|
-
"os",
|
|
248
|
-
"child_process",
|
|
249
|
-
"readline",
|
|
250
|
-
"zlib",
|
|
251
|
-
"crypto",
|
|
252
|
-
"https",
|
|
253
|
-
"util",
|
|
254
|
-
"process",
|
|
255
|
-
"dns"
|
|
256
|
-
],
|
|
257
|
-
platform: "browser",
|
|
258
|
-
entryPoints: [...entryPoints],
|
|
259
|
-
loader: config.webLoaders,
|
|
260
|
-
plugins: [
|
|
261
|
-
featuresPlugin_default,
|
|
262
|
-
inputFilesPluginFactory,
|
|
263
|
-
polyfillNode({
|
|
264
|
-
// You might need to configure specific Node.js modules you want to polyfill
|
|
265
|
-
// Example:
|
|
266
|
-
// modules: {
|
|
267
|
-
// 'util': true,
|
|
268
|
-
// 'fs': false,
|
|
269
|
-
// }
|
|
270
|
-
}),
|
|
271
|
-
rebuildPlugin_default("web"),
|
|
272
|
-
...(config.webPlugins || []).map((p) => p(register2, entryPoints)) || []
|
|
273
|
-
]
|
|
274
|
-
};
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
// src/esbuildConfigs/pure.ts
|
|
278
|
-
import { isBuiltin } from "node:module";
|
|
279
|
-
|
|
280
|
-
// src/esbuildConfigs/consoleDetectorPlugin.ts
|
|
281
|
-
import fs3 from "fs";
|
|
282
|
-
var consoleDetectorPlugin = {
|
|
283
|
-
name: "console-detector",
|
|
284
|
-
setup(build) {
|
|
285
|
-
build.onLoad({ filter: /\.(js|ts)$/ }, async (args) => {
|
|
286
|
-
const contents = await fs3.promises.readFile(args.path, "utf8");
|
|
287
|
-
const consolePattern = /console\.(log|error|warn|info|debug|trace|dir|dirxml|table|group|groupEnd|clear|count|countReset|assert|profile|profileEnd|time|timeLog|timeEnd|timeStamp|context|memory)/g;
|
|
288
|
-
const matches = contents.match(consolePattern);
|
|
289
|
-
if (matches) {
|
|
290
|
-
const uniqueMethods = [...new Set(matches)];
|
|
291
|
-
return {
|
|
292
|
-
warnings: uniqueMethods.map((method) => ({
|
|
293
|
-
text: `call of "${method}" was detected, which is not supported in the pure runtime.`
|
|
294
|
-
// location: {
|
|
295
|
-
// file: args.path,
|
|
296
|
-
// line:
|
|
297
|
-
// contents
|
|
298
|
-
// .split("\n")
|
|
299
|
-
// .findIndex((line) => line.includes(method)) + 1,
|
|
300
|
-
// column: 0,
|
|
301
|
-
// },
|
|
302
|
-
}))
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
return null;
|
|
306
|
-
});
|
|
307
|
-
build.onEnd((buildResult) => {
|
|
308
|
-
if (buildResult.warnings.find((br) => br.pluginName === "console-detector"))
|
|
309
|
-
console.warn(
|
|
310
|
-
`Warning: An unsupported method call was detected in a source file used to build for the pure runtime. It is possible that this method call is in a comment block. If you really want to use this function, change this test to the "node" runtime.`
|
|
311
|
-
);
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
// src/esbuildConfigs/pure.ts
|
|
317
|
-
var pure_default = (config, entryPoints, testName2) => {
|
|
318
|
-
const { inputFilesPluginFactory, register: register2 } = inputFilesPlugin_default(
|
|
319
|
-
"pure",
|
|
320
|
-
testName2
|
|
321
|
-
);
|
|
322
|
-
return {
|
|
323
|
-
...esbuildConfigs_default(config),
|
|
324
|
-
drop: [],
|
|
325
|
-
splitting: true,
|
|
326
|
-
outdir: `testeranto/bundles/pure/${testName2}/`,
|
|
327
|
-
// inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
|
|
328
|
-
metafile: true,
|
|
329
|
-
supported: {
|
|
330
|
-
"dynamic-import": true
|
|
331
|
-
},
|
|
332
|
-
define: {
|
|
333
|
-
"process.env.FLUENTFFMPEG_COV": "0"
|
|
334
|
-
},
|
|
335
|
-
absWorkingDir: process.cwd(),
|
|
336
|
-
banner: {
|
|
337
|
-
js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`
|
|
338
|
-
},
|
|
339
|
-
platform: "node",
|
|
340
|
-
external: ["react", ...config.externals],
|
|
341
|
-
entryPoints: [...entryPoints],
|
|
342
|
-
plugins: [
|
|
343
|
-
featuresPlugin_default,
|
|
344
|
-
inputFilesPluginFactory,
|
|
345
|
-
consoleDetectorPlugin,
|
|
346
|
-
// nativeImportDetectorPlugin,
|
|
347
|
-
{
|
|
348
|
-
name: "native-node-import-filter",
|
|
349
|
-
setup(build) {
|
|
350
|
-
build.onResolve({ filter: /fs/ }, (args) => {
|
|
351
|
-
if (isBuiltin(args.path)) {
|
|
352
|
-
throw new Error(
|
|
353
|
-
`You attempted to import a node module "${args.path}" into a "pure" test, which is not allowed. If you really want to use this package, convert this test from "pure" to "node"`
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
return { path: args.path };
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
rebuildPlugin_default("pure"),
|
|
361
|
-
...(config.nodePlugins || []).map((p) => p(register2, entryPoints)) || []
|
|
362
|
-
]
|
|
363
|
-
};
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
// src/web.html.ts
|
|
367
|
-
var web_html_default = (jsfilePath, htmlFilePath, cssfilePath) => `
|
|
368
|
-
<!DOCTYPE html>
|
|
369
|
-
<html lang="en">
|
|
370
|
-
|
|
371
|
-
<head>
|
|
372
|
-
<script type="module" src="${jsfilePath}"></script>
|
|
373
|
-
<link rel="stylesheet" href="${cssfilePath}">
|
|
374
|
-
</head>
|
|
375
|
-
|
|
376
|
-
<body>
|
|
377
|
-
<div id="root">
|
|
378
|
-
</div>
|
|
379
|
-
</body>
|
|
380
|
-
|
|
381
|
-
</html>
|
|
382
|
-
`;
|
|
383
|
-
|
|
384
|
-
// src/build.ts
|
|
385
|
-
readline.emitKeypressEvents(process.stdin);
|
|
386
|
-
if (process.stdin.isTTY)
|
|
387
|
-
process.stdin.setRawMode(true);
|
|
388
|
-
var testName = process.argv[2];
|
|
389
|
-
var mode = process.argv[3];
|
|
390
|
-
if (mode !== "once" && mode !== "dev") {
|
|
391
|
-
console.error(`The 4th argument should be 'dev' or 'once', not '${mode}'.`);
|
|
392
|
-
process.exit(-1);
|
|
393
|
-
}
|
|
394
|
-
import(process.cwd() + "/testeranto.config.ts").then(async (module) => {
|
|
395
|
-
const pckge = (await import(`${process.cwd()}/package.json`)).default;
|
|
396
|
-
const bigConfig = module.default;
|
|
397
|
-
const project = bigConfig.projects[testName];
|
|
398
|
-
if (!project) {
|
|
399
|
-
console.error("no project found for", testName, "in testeranto.config.ts");
|
|
400
|
-
process.exit(-1);
|
|
401
|
-
}
|
|
402
|
-
fs4.writeFileSync(
|
|
403
|
-
`${process.cwd()}/testeranto/projects.json`,
|
|
404
|
-
JSON.stringify(Object.keys(bigConfig.projects), null, 2)
|
|
405
|
-
);
|
|
406
|
-
const rawConfig = bigConfig.projects[testName];
|
|
407
|
-
const getSecondaryEndpointsPoints = (runtime) => {
|
|
408
|
-
const meta = (ts, st) => {
|
|
409
|
-
ts.forEach((t) => {
|
|
410
|
-
if (t[1] === runtime) {
|
|
411
|
-
st.add(t[0]);
|
|
412
|
-
}
|
|
413
|
-
if (Array.isArray(t[3])) {
|
|
414
|
-
meta(t[3], st);
|
|
415
|
-
}
|
|
416
|
-
});
|
|
417
|
-
return st;
|
|
418
|
-
};
|
|
419
|
-
return Array.from(meta(config.tests, /* @__PURE__ */ new Set()));
|
|
420
|
-
};
|
|
421
|
-
const config = {
|
|
422
|
-
...rawConfig,
|
|
423
|
-
buildDir: process.cwd() + "/testeranto/bundles/" + testName
|
|
424
|
-
};
|
|
425
|
-
console.log(
|
|
426
|
-
`Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`
|
|
427
|
-
);
|
|
428
|
-
process.stdin.on("keypress", (str, key) => {
|
|
429
|
-
if (key.name === "q") {
|
|
430
|
-
console.log("Testeranto-Build is shutting down...");
|
|
431
|
-
mode = "once";
|
|
432
|
-
onDone();
|
|
433
|
-
} else if (key.name === "x") {
|
|
434
|
-
console.log("Testeranto-Build is shutting down forcefully...");
|
|
435
|
-
process.exit(-1);
|
|
436
|
-
} else {
|
|
437
|
-
console.log(
|
|
438
|
-
`Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`
|
|
439
|
-
);
|
|
440
|
-
}
|
|
441
|
-
});
|
|
442
|
-
let nodeDone = false;
|
|
443
|
-
let webDone = false;
|
|
444
|
-
let importDone = false;
|
|
445
|
-
let status = "build";
|
|
446
|
-
const {
|
|
447
|
-
nodeEntryPoints,
|
|
448
|
-
nodeEntryPointSidecars,
|
|
449
|
-
webEntryPoints,
|
|
450
|
-
webEntryPointSidecars,
|
|
451
|
-
pureEntryPoints,
|
|
452
|
-
pureEntryPointSidecars
|
|
453
|
-
} = getRunnables(config.tests, testName);
|
|
454
|
-
const onNodeDone = () => {
|
|
455
|
-
nodeDone = true;
|
|
456
|
-
onDone();
|
|
457
|
-
};
|
|
458
|
-
const onWebDone = () => {
|
|
459
|
-
webDone = true;
|
|
460
|
-
onDone();
|
|
461
|
-
};
|
|
462
|
-
const onImportDone = () => {
|
|
463
|
-
importDone = true;
|
|
464
|
-
onDone();
|
|
465
|
-
};
|
|
466
|
-
const onDone = async () => {
|
|
467
|
-
if (nodeDone && webDone && importDone) {
|
|
468
|
-
status = "built";
|
|
469
|
-
}
|
|
470
|
-
if (nodeDone && webDone && importDone && mode === "once") {
|
|
471
|
-
console.log(
|
|
472
|
-
ansiC.inverse(
|
|
473
|
-
`${testName} was built and the builder exited successfully.`
|
|
474
|
-
)
|
|
475
|
-
);
|
|
476
|
-
process.exit();
|
|
477
|
-
}
|
|
478
|
-
};
|
|
479
|
-
fs4.writeFileSync(`${process.cwd()}/testeranto/projects.html`, AppHtml());
|
|
480
|
-
Object.keys(bigConfig.projects).forEach((projectName) => {
|
|
481
|
-
console.log(`testeranto/reports/${projectName}`);
|
|
482
|
-
if (!fs4.existsSync(`testeranto/reports/${projectName}`)) {
|
|
483
|
-
fs4.mkdirSync(`testeranto/reports/${projectName}`);
|
|
484
|
-
}
|
|
485
|
-
fs4.writeFileSync(
|
|
486
|
-
`testeranto/reports/${projectName}/config.json`,
|
|
487
|
-
JSON.stringify(config, null, 2)
|
|
488
|
-
);
|
|
489
|
-
});
|
|
490
|
-
Promise.resolve(
|
|
491
|
-
Promise.all(
|
|
492
|
-
[...getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
|
|
493
|
-
const sourceFileSplit = sourceFilePath.split("/");
|
|
494
|
-
const sourceDir = sourceFileSplit.slice(0, -1);
|
|
495
|
-
const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
|
|
496
|
-
const sourceFileNameMinusJs = sourceFileName.split(".").slice(0, -1).join(".");
|
|
497
|
-
const htmlFilePath = path4.normalize(
|
|
498
|
-
`${process.cwd()}/testeranto/bundles/web/${testName}/${sourceDir.join(
|
|
499
|
-
"/"
|
|
500
|
-
)}/${sourceFileNameMinusJs}.html`
|
|
501
|
-
);
|
|
502
|
-
const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
|
|
503
|
-
const cssFilePath = `./${sourceFileNameMinusJs}.css`;
|
|
504
|
-
return fs4.promises.mkdir(path4.dirname(htmlFilePath), { recursive: true }).then(
|
|
505
|
-
(x2) => fs4.writeFileSync(
|
|
506
|
-
htmlFilePath,
|
|
507
|
-
web_html_default(jsfilePath, htmlFilePath, cssFilePath)
|
|
508
|
-
)
|
|
509
|
-
);
|
|
510
|
-
})
|
|
511
|
-
)
|
|
512
|
-
);
|
|
513
|
-
const x = [
|
|
514
|
-
["pure", Object.keys(pureEntryPoints)],
|
|
515
|
-
["node", Object.keys(nodeEntryPoints)],
|
|
516
|
-
["web", Object.keys(webEntryPoints)]
|
|
517
|
-
];
|
|
518
|
-
x.forEach(async ([runtime, keys]) => {
|
|
519
|
-
keys.forEach(async (k) => {
|
|
520
|
-
const folder = `testeranto/reports/${testName}/${k.split(".").slice(0, -1).join(".")}/${runtime}`;
|
|
521
|
-
await fs4.mkdirSync(folder, { recursive: true });
|
|
522
|
-
});
|
|
523
|
-
});
|
|
524
|
-
[
|
|
525
|
-
[pureEntryPoints, pureEntryPointSidecars, "pure"],
|
|
526
|
-
[webEntryPoints, webEntryPointSidecars, "web"],
|
|
527
|
-
[nodeEntryPoints, nodeEntryPointSidecars, "node"]
|
|
528
|
-
].forEach(
|
|
529
|
-
([eps, eps2, runtime]) => {
|
|
530
|
-
[...Object.keys(eps), ...Object.keys(eps2)].forEach((ep) => {
|
|
531
|
-
const fp = path4.resolve(
|
|
532
|
-
`testeranto`,
|
|
533
|
-
`reports`,
|
|
534
|
-
testName,
|
|
535
|
-
ep.split(".").slice(0, -1).join("."),
|
|
536
|
-
runtime
|
|
537
|
-
);
|
|
538
|
-
fs4.mkdirSync(fp, { recursive: true });
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
);
|
|
542
|
-
await Promise.all([
|
|
543
|
-
...[
|
|
544
|
-
[
|
|
545
|
-
pure_default,
|
|
546
|
-
pureEntryPoints,
|
|
547
|
-
pureEntryPointSidecars,
|
|
548
|
-
onImportDone
|
|
549
|
-
],
|
|
550
|
-
[
|
|
551
|
-
node_default,
|
|
552
|
-
nodeEntryPoints,
|
|
553
|
-
nodeEntryPointSidecars,
|
|
554
|
-
onNodeDone
|
|
555
|
-
],
|
|
556
|
-
[web_default, webEntryPoints, webEntryPointSidecars, onWebDone]
|
|
557
|
-
].map(([configer, entryPoints, sidecars, done]) => {
|
|
558
|
-
esbuild.context(
|
|
559
|
-
configer(
|
|
560
|
-
config,
|
|
561
|
-
[...Object.keys(entryPoints), ...Object.keys(sidecars)],
|
|
562
|
-
testName
|
|
563
|
-
)
|
|
564
|
-
).then(async (ctx) => {
|
|
565
|
-
if (mode === "dev") {
|
|
566
|
-
await ctx.watch().then((v) => {
|
|
567
|
-
done();
|
|
568
|
-
});
|
|
569
|
-
} else {
|
|
570
|
-
ctx.rebuild().then((v) => {
|
|
571
|
-
done();
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
return ctx;
|
|
575
|
-
});
|
|
576
|
-
})
|
|
577
|
-
]);
|
|
578
|
-
});
|