@rstest/core 0.2.1 → 0.3.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/dist/{359.js → 12.js} +156 -94
- package/dist/{72.js → 171.js} +2 -1
- package/dist/223.js +135 -0
- package/dist/{920.js → 33.js} +125 -81
- package/dist/{44.js → 350.js} +6 -5
- package/dist/{813.js → 607.js} +16 -15
- package/dist/{208.js → 655.js} +60 -59
- package/dist/{355.js → 704.js} +17 -16
- package/dist/{965.js → 711.js} +6 -5
- package/dist/{443.js → 755.js} +2 -1
- package/dist/{723.js → 829.js} +5 -4
- package/dist/{867.js → 85.js} +140 -67
- package/dist/{668.js → 928.js} +3 -2
- package/dist/{25.js → 967.js} +19 -14
- package/dist/{64.js → 969.js} +2 -1
- package/dist/{285.js → 971.js} +66 -33
- package/dist/{854.js → 985.js} +153 -81
- package/dist/index.js +93 -121
- package/dist/worker.js +45 -38
- package/dist-types/index.d.ts +55 -3
- package/dist-types/worker.d.ts +124 -4
- package/globals.d.ts +2 -0
- package/package.json +6 -6
- /package/dist/{208.js.LICENSE.txt → 655.js.LICENSE.txt} +0 -0
- /package/dist/{668.js.LICENSE.txt → 928.js.LICENSE.txt} +0 -0
package/dist/{920.js → 33.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "33";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"33"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"./src/core/runTests.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -10,7 +11,7 @@ export const __webpack_modules__ = {
|
|
|
10
11
|
});
|
|
11
12
|
var src_pool = __webpack_require__("./src/pool/index.ts");
|
|
12
13
|
var utils = __webpack_require__("./src/utils/index.ts");
|
|
13
|
-
const isCliShortcutsEnabled = ()=>(0, utils.
|
|
14
|
+
const isCliShortcutsEnabled = ()=>(0, utils.Un)('stdin');
|
|
14
15
|
async function setupCliShortcuts({ closeServer, runAll, updateSnapshot, runFailedTests, runWithTestNamePattern, runWithFileFilters }) {
|
|
15
16
|
const { createInterface, emitKeypressEvents } = await import("node:readline");
|
|
16
17
|
const rl = createInterface({
|
|
@@ -67,28 +68,28 @@ export const __webpack_modules__ = {
|
|
|
67
68
|
const shortcuts = [
|
|
68
69
|
{
|
|
69
70
|
key: 'f',
|
|
70
|
-
description: `${utils
|
|
71
|
+
description: `${utils.yW.bold('f')} ${utils.yW.dim('rerun failed tests')}`,
|
|
71
72
|
action: async ()=>{
|
|
72
73
|
await runFailedTests();
|
|
73
74
|
}
|
|
74
75
|
},
|
|
75
76
|
{
|
|
76
77
|
key: 'a',
|
|
77
|
-
description: `${utils
|
|
78
|
+
description: `${utils.yW.bold('a')} ${utils.yW.dim('rerun all tests')}`,
|
|
78
79
|
action: async ()=>{
|
|
79
80
|
await runAll();
|
|
80
81
|
}
|
|
81
82
|
},
|
|
82
83
|
{
|
|
83
84
|
key: 'u',
|
|
84
|
-
description: `${utils
|
|
85
|
+
description: `${utils.yW.bold('u')} ${utils.yW.dim('update snapshot')}`,
|
|
85
86
|
action: async ()=>{
|
|
86
87
|
await updateSnapshot();
|
|
87
88
|
}
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
91
|
key: 't',
|
|
91
|
-
description: `${utils
|
|
92
|
+
description: `${utils.yW.bold('t')} ${utils.yW.dim('filter by a test name regex pattern')}`,
|
|
92
93
|
action: async ()=>{
|
|
93
94
|
clearCurrentInputLine();
|
|
94
95
|
await promptInput('Enter test name pattern (empty to clear): ', async (pattern)=>{
|
|
@@ -98,7 +99,7 @@ export const __webpack_modules__ = {
|
|
|
98
99
|
},
|
|
99
100
|
{
|
|
100
101
|
key: 'p',
|
|
101
|
-
description: `${utils
|
|
102
|
+
description: `${utils.yW.bold('p')} ${utils.yW.dim('filter by a filename regex pattern')}`,
|
|
102
103
|
action: async ()=>{
|
|
103
104
|
clearCurrentInputLine();
|
|
104
105
|
await promptInput('Enter file name pattern (empty to clear): ', async (input)=>{
|
|
@@ -109,14 +110,14 @@ export const __webpack_modules__ = {
|
|
|
109
110
|
},
|
|
110
111
|
{
|
|
111
112
|
key: 'c',
|
|
112
|
-
description: `${utils
|
|
113
|
+
description: `${utils.yW.bold('c')} ${utils.yW.dim('clear screen')}`,
|
|
113
114
|
action: ()=>{
|
|
114
|
-
|
|
115
|
+
(0, utils.mT)(true);
|
|
115
116
|
}
|
|
116
117
|
},
|
|
117
118
|
{
|
|
118
119
|
key: 'q',
|
|
119
|
-
description: `${utils
|
|
120
|
+
description: `${utils.yW.bold('q')} ${utils.yW.dim('quit process')}`,
|
|
120
121
|
action: async ()=>{
|
|
121
122
|
try {
|
|
122
123
|
await closeServer();
|
|
@@ -136,9 +137,9 @@ export const __webpack_modules__ = {
|
|
|
136
137
|
}
|
|
137
138
|
if ('h' === str) {
|
|
138
139
|
clearCurrentInputLine();
|
|
139
|
-
let message =
|
|
140
|
+
let message = ` ${utils.yW.bold(utils.yW.blue('Shortcuts:'))}\n`;
|
|
140
141
|
for (const shortcut of shortcuts)message += ` ${shortcut.description}\n`;
|
|
141
|
-
utils.
|
|
142
|
+
utils.vF.log(message);
|
|
142
143
|
}
|
|
143
144
|
};
|
|
144
145
|
process.stdin.on('keypress', handleKeypress);
|
|
@@ -153,10 +154,11 @@ export const __webpack_modules__ = {
|
|
|
153
154
|
}
|
|
154
155
|
var rsbuild = __webpack_require__("./src/core/rsbuild.ts");
|
|
155
156
|
async function runTests(context) {
|
|
156
|
-
const {
|
|
157
|
+
const { rootPath, reporters, projects, snapshotManager, command } = context;
|
|
157
158
|
const entriesCache = new Map();
|
|
158
|
-
const globTestSourceEntries = async ()=>{
|
|
159
|
-
const
|
|
159
|
+
const globTestSourceEntries = async (name)=>{
|
|
160
|
+
const { include, exclude, includeSource, root } = projects.find((p)=>p.environmentName === name).normalizedConfig;
|
|
161
|
+
const entries = await (0, utils.tG)({
|
|
160
162
|
include,
|
|
161
163
|
exclude,
|
|
162
164
|
includeSource,
|
|
@@ -167,86 +169,125 @@ export const __webpack_modules__ = {
|
|
|
167
169
|
entries,
|
|
168
170
|
fileFilters: context.fileFilters
|
|
169
171
|
});
|
|
170
|
-
if (!Object.keys(entries).length) {
|
|
171
|
-
utils.kg.log(utils.$_.red('No test files found.'));
|
|
172
|
-
utils.kg.log('');
|
|
173
|
-
if (context.fileFilters?.length) utils.kg.log(utils.$_.gray('filter: '), context.fileFilters.join(utils.$_.gray(', ')));
|
|
174
|
-
utils.kg.log(utils.$_.gray('include:'), include.join(utils.$_.gray(', ')));
|
|
175
|
-
utils.kg.log(utils.$_.gray('exclude:'), exclude.join(utils.$_.gray(', ')));
|
|
176
|
-
utils.kg.log('');
|
|
177
|
-
}
|
|
178
172
|
return entries;
|
|
179
173
|
};
|
|
180
|
-
const setupFiles = (
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
174
|
+
const setupFiles = Object.fromEntries(context.projects.map((project)=>{
|
|
175
|
+
const { environmentName, rootPath, normalizedConfig: { setupFiles } } = project;
|
|
176
|
+
return [
|
|
177
|
+
environmentName,
|
|
178
|
+
(0, utils.pr)(setupFiles, rootPath)
|
|
179
|
+
];
|
|
180
|
+
}));
|
|
181
|
+
const rsbuildInstance = await (0, rsbuild.zh)(context, globTestSourceEntries, setupFiles);
|
|
182
|
+
const { getRsbuildStats, closeServer } = await (0, rsbuild.XD)({
|
|
184
183
|
normalizedConfig: context.normalizedConfig,
|
|
185
|
-
globTestSourceEntries: 'watch' === command ? globTestSourceEntries : async ()=>{
|
|
184
|
+
globTestSourceEntries: 'watch' === command ? globTestSourceEntries : async (name)=>{
|
|
186
185
|
if (entriesCache.has(name)) return entriesCache.get(name).entries;
|
|
187
|
-
return globTestSourceEntries();
|
|
186
|
+
return globTestSourceEntries(name);
|
|
188
187
|
},
|
|
189
188
|
setupFiles,
|
|
190
189
|
rsbuildInstance,
|
|
191
190
|
rootPath
|
|
192
191
|
});
|
|
193
192
|
const recommendWorkerCount = 'watch' === command ? 1 / 0 : Array.from(entriesCache.values()).reduce((acc, entry)=>acc + Object.keys(entry.entries).length, 0);
|
|
194
|
-
const pool = await (0, src_pool.
|
|
193
|
+
const pool = await (0, src_pool.b)({
|
|
195
194
|
context,
|
|
196
195
|
recommendWorkerCount
|
|
197
196
|
});
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
197
|
+
const run = async ({ fileFilters, mode = 'all' } = {})=>{
|
|
198
|
+
let testStart;
|
|
199
|
+
const buildStart = Date.now();
|
|
200
|
+
const currentEntries = [];
|
|
201
|
+
const currentDeletedEntries = [];
|
|
202
|
+
const returns = await Promise.all(context.projects.map(async (p)=>{
|
|
203
|
+
const { entries, setupEntries, assetFiles, sourceMaps, affectedEntries, deletedEntries } = await getRsbuildStats({
|
|
204
|
+
environmentName: p.environmentName,
|
|
205
|
+
fileFilters
|
|
206
|
+
});
|
|
207
|
+
testStart ??= Date.now();
|
|
208
|
+
currentDeletedEntries.push(...deletedEntries);
|
|
209
|
+
let finalEntries = entries;
|
|
210
|
+
if ('on-demand' === mode) {
|
|
211
|
+
if (0 === affectedEntries.length) utils.vF.debug(utils.yW.yellow(`No test files need re-run in project(${p.environmentName}).`));
|
|
212
|
+
else utils.vF.debug(utils.yW.yellow(`Test files to re-run in project(${p.environmentName}):\n`) + affectedEntries.map((e)=>e.testPath).join('\n') + '\n');
|
|
213
|
+
finalEntries = affectedEntries;
|
|
214
|
+
} else utils.vF.debug(utils.yW.yellow(fileFilters?.length ? `Run filtered tests in project(${p.environmentName}).\n` : `Run all tests in project(${p.environmentName}).\n`));
|
|
215
|
+
currentEntries.push(...finalEntries);
|
|
216
|
+
const { results, testResults } = await pool.runTests({
|
|
217
|
+
entries: finalEntries,
|
|
218
|
+
sourceMaps,
|
|
219
|
+
setupEntries,
|
|
220
|
+
assetFiles,
|
|
221
|
+
project: p,
|
|
222
|
+
updateSnapshot: context.snapshotManager.options.updateSnapshot
|
|
223
|
+
});
|
|
224
|
+
return {
|
|
225
|
+
results,
|
|
226
|
+
testResults,
|
|
227
|
+
sourceMaps
|
|
228
|
+
};
|
|
229
|
+
}));
|
|
230
|
+
const buildTime = testStart - buildStart;
|
|
214
231
|
const testTime = Date.now() - testStart;
|
|
215
232
|
const duration = {
|
|
216
|
-
totalTime: testTime +
|
|
217
|
-
buildTime
|
|
233
|
+
totalTime: testTime + buildTime,
|
|
234
|
+
buildTime,
|
|
218
235
|
testTime
|
|
219
236
|
};
|
|
220
|
-
|
|
221
|
-
|
|
237
|
+
const results = returns.flatMap((r)=>r.results);
|
|
238
|
+
const testResults = returns.flatMap((r)=>r.testResults);
|
|
239
|
+
const sourceMaps = Object.assign({}, ...returns.map((r)=>r.sourceMaps));
|
|
240
|
+
context.updateReporterResultState(results, testResults, currentDeletedEntries);
|
|
241
|
+
if (0 === results.length) {
|
|
242
|
+
if ('watch' === command) if ('on-demand' === mode) utils.vF.log(utils.yW.yellow('No test files need re-run.'));
|
|
243
|
+
else utils.vF.log(utils.yW.yellow('No test files found.'));
|
|
244
|
+
else {
|
|
245
|
+
const code = context.normalizedConfig.passWithNoTests ? 0 : 1;
|
|
246
|
+
utils.vF.log(utils.yW[code ? 'red' : 'yellow'](`No test files found, exiting with code ${code}.`));
|
|
247
|
+
process.exitCode = code;
|
|
248
|
+
}
|
|
249
|
+
if ('all' === mode) {
|
|
250
|
+
if (context.fileFilters?.length) utils.vF.log(utils.yW.gray('filter: '), context.fileFilters.join(utils.yW.gray(', ')));
|
|
251
|
+
context.projects.forEach((p)=>{
|
|
252
|
+
if (context.projects.length > 1) {
|
|
253
|
+
utils.vF.log('');
|
|
254
|
+
utils.vF.log(utils.yW.gray('project:'), p.name);
|
|
255
|
+
}
|
|
256
|
+
utils.vF.log(utils.yW.gray('include:'), p.normalizedConfig.include.join(utils.yW.gray(', ')));
|
|
257
|
+
utils.vF.log(utils.yW.gray('exclude:'), p.normalizedConfig.exclude.join(utils.yW.gray(', ')));
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
222
261
|
if (results.some((r)=>'fail' === r.status)) process.exitCode = 1;
|
|
223
262
|
for (const reporter of reporters)await reporter.onTestRunEnd?.({
|
|
224
|
-
results,
|
|
225
|
-
testResults,
|
|
263
|
+
results: context.reporterResults.results,
|
|
264
|
+
testResults: context.reporterResults.testResults,
|
|
226
265
|
snapshotSummary: snapshotManager.summary,
|
|
227
266
|
duration,
|
|
228
|
-
getSourcemap
|
|
267
|
+
getSourcemap: (name)=>sourceMaps[name] || null,
|
|
268
|
+
filterRerunTestPaths: currentEntries.length ? currentEntries.map((e)=>e.testPath) : void 0
|
|
229
269
|
});
|
|
230
270
|
};
|
|
231
271
|
if ('watch' === command) {
|
|
232
272
|
const enableCliShortcuts = isCliShortcutsEnabled();
|
|
233
273
|
const afterTestsWatchRun = ()=>{
|
|
234
|
-
utils.
|
|
235
|
-
if (enableCliShortcuts) if (snapshotManager.summary.unmatched) utils.
|
|
236
|
-
else utils.
|
|
237
|
-
};
|
|
238
|
-
const clearLogs = ()=>{
|
|
239
|
-
console.clear();
|
|
274
|
+
utils.vF.log(utils.yW.green(' Waiting for file changes...'));
|
|
275
|
+
if (enableCliShortcuts) if (snapshotManager.summary.unmatched) utils.vF.log(` ${utils.yW.dim('press')} ${utils.yW.yellow(utils.yW.bold('u'))} ${utils.yW.dim('to update snapshot')}${utils.yW.dim(', press')} ${utils.yW.bold('h')} ${utils.yW.dim('to show help')}\n`);
|
|
276
|
+
else utils.vF.log(` ${utils.yW.dim('press')} ${utils.yW.bold('h')} ${utils.yW.dim('to show help')}${utils.yW.dim(', press')} ${utils.yW.bold('q')} ${utils.yW.dim('to quit')}\n`);
|
|
240
277
|
};
|
|
241
|
-
const { onBeforeRestart } = await __webpack_require__.e("
|
|
278
|
+
const { onBeforeRestart } = await __webpack_require__.e("967").then(__webpack_require__.bind(__webpack_require__, "./src/core/restart.ts"));
|
|
242
279
|
onBeforeRestart(async ()=>{
|
|
243
280
|
await pool.close();
|
|
244
281
|
await closeServer();
|
|
245
282
|
});
|
|
246
|
-
rsbuildInstance.
|
|
247
|
-
if (!isFirstCompile)
|
|
283
|
+
rsbuildInstance.onBeforeDevCompile(({ isFirstCompile })=>{
|
|
284
|
+
if (!isFirstCompile) (0, utils.mT)();
|
|
285
|
+
});
|
|
286
|
+
rsbuildInstance.onAfterDevCompile(async ({ isFirstCompile })=>{
|
|
248
287
|
snapshotManager.clear();
|
|
249
|
-
await run(
|
|
288
|
+
await run({
|
|
289
|
+
mode: isFirstCompile ? 'all' : 'on-demand'
|
|
290
|
+
});
|
|
250
291
|
if (isFirstCompile && enableCliShortcuts) {
|
|
251
292
|
const closeCliShortcuts = await setupCliShortcuts({
|
|
252
293
|
closeServer: async ()=>{
|
|
@@ -254,49 +295,52 @@ export const __webpack_modules__ = {
|
|
|
254
295
|
await closeServer();
|
|
255
296
|
},
|
|
256
297
|
runAll: async ()=>{
|
|
257
|
-
|
|
298
|
+
(0, utils.mT)();
|
|
258
299
|
snapshotManager.clear();
|
|
259
300
|
context.normalizedConfig.testNamePattern = void 0;
|
|
260
301
|
context.fileFilters = void 0;
|
|
261
|
-
await run(
|
|
302
|
+
await run({
|
|
303
|
+
mode: 'all'
|
|
304
|
+
});
|
|
262
305
|
afterTestsWatchRun();
|
|
263
306
|
},
|
|
264
307
|
runWithTestNamePattern: async (pattern)=>{
|
|
265
|
-
|
|
308
|
+
(0, utils.mT)();
|
|
266
309
|
context.normalizedConfig.testNamePattern = pattern;
|
|
267
|
-
if (pattern) utils.
|
|
268
|
-
else utils.
|
|
310
|
+
if (pattern) utils.vF.log(`\n${utils.yW.dim('Applied testNamePattern:')} ${utils.yW.bold(pattern)}\n`);
|
|
311
|
+
else utils.vF.log(`\n${utils.yW.dim('Cleared testNamePattern filter')}\n`);
|
|
269
312
|
snapshotManager.clear();
|
|
270
313
|
await run();
|
|
271
314
|
afterTestsWatchRun();
|
|
272
315
|
},
|
|
273
316
|
runWithFileFilters: async (filters)=>{
|
|
274
|
-
|
|
275
|
-
if (filters && filters.length > 0) utils.
|
|
276
|
-
else utils.
|
|
317
|
+
(0, utils.mT)();
|
|
318
|
+
if (filters && filters.length > 0) utils.vF.log(`\n${utils.yW.dim('Applied file filters:')} ${utils.yW.bold(filters.join(', '))}\n`);
|
|
319
|
+
else utils.vF.log(`\n${utils.yW.dim('Cleared file filters')}\n`);
|
|
277
320
|
snapshotManager.clear();
|
|
278
321
|
context.fileFilters = filters;
|
|
279
|
-
const entries = await globTestSourceEntries();
|
|
280
|
-
if (!
|
|
322
|
+
const entries = await Promise.all(projects.map(async (p)=>globTestSourceEntries(p.environmentName))).then((entries)=>entries.reduce((acc, entry)=>acc.concat(...Object.values(entry)), []));
|
|
323
|
+
if (!entries.length) return void utils.vF.log(filters ? utils.yW.yellow(`\nNo matching test files to run with current file filters: ${filters.join(',')}\n`) : utils.yW.yellow('\nNo matching test files to run.\n'));
|
|
281
324
|
await run({
|
|
282
|
-
fileFilters:
|
|
325
|
+
fileFilters: entries
|
|
283
326
|
});
|
|
284
327
|
afterTestsWatchRun();
|
|
285
328
|
},
|
|
286
329
|
runFailedTests: async ()=>{
|
|
287
|
-
const failedTests =
|
|
288
|
-
if (!failedTests.length) return void utils.
|
|
289
|
-
|
|
330
|
+
const failedTests = context.reporterResults.results.filter((result)=>'fail' === result.status).map((r)=>r.testPath);
|
|
331
|
+
if (!failedTests.length) return void utils.vF.log(utils.yW.yellow('\nNo failed tests were found that needed to be rerun.'));
|
|
332
|
+
(0, utils.mT)();
|
|
290
333
|
snapshotManager.clear();
|
|
291
334
|
await run({
|
|
292
|
-
fileFilters: failedTests
|
|
335
|
+
fileFilters: failedTests,
|
|
336
|
+
mode: 'all'
|
|
293
337
|
});
|
|
294
338
|
afterTestsWatchRun();
|
|
295
339
|
},
|
|
296
340
|
updateSnapshot: async ()=>{
|
|
297
|
-
if (!snapshotManager.summary.unmatched) return void utils.
|
|
298
|
-
const failedTests =
|
|
299
|
-
|
|
341
|
+
if (!snapshotManager.summary.unmatched) return void utils.vF.log(utils.yW.yellow('\nNo snapshots were found that needed to be updated.'));
|
|
342
|
+
const failedTests = context.reporterResults.results.filter((result)=>result.snapshotResult?.unmatched).map((r)=>r.testPath);
|
|
343
|
+
(0, utils.mT)();
|
|
300
344
|
const originalUpdateSnapshot = snapshotManager.options.updateSnapshot;
|
|
301
345
|
snapshotManager.clear();
|
|
302
346
|
snapshotManager.options.updateSnapshot = 'all';
|
package/dist/{44.js → 350.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "350";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"350"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"./src/runtime/worker/env/happyDom.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -18,7 +19,7 @@ export const __webpack_modules__ = {
|
|
|
18
19
|
url: happyDom.url || 'http://localhost:3000',
|
|
19
20
|
console: console && global.console ? global.console : void 0
|
|
20
21
|
});
|
|
21
|
-
const cleanupGlobal = (0, _utils__WEBPACK_IMPORTED_MODULE_0__.
|
|
22
|
+
const cleanupGlobal = (0, _utils__WEBPACK_IMPORTED_MODULE_0__.p5)(global, win, {
|
|
22
23
|
additionalKeys: [
|
|
23
24
|
'Request',
|
|
24
25
|
'Response',
|
|
@@ -26,7 +27,7 @@ export const __webpack_modules__ = {
|
|
|
26
27
|
'fetch'
|
|
27
28
|
]
|
|
28
29
|
});
|
|
29
|
-
const cleanupHandler = (0, _utils__WEBPACK_IMPORTED_MODULE_0__.
|
|
30
|
+
const cleanupHandler = (0, _utils__WEBPACK_IMPORTED_MODULE_0__.d1)(global);
|
|
30
31
|
return {
|
|
31
32
|
async teardown () {
|
|
32
33
|
cleanupHandler();
|
|
@@ -42,8 +43,8 @@ export const __webpack_modules__ = {
|
|
|
42
43
|
},
|
|
43
44
|
"./src/runtime/worker/env/utils.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
44
45
|
__webpack_require__.d(__webpack_exports__, {
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
d1: ()=>addDefaultErrorHandler,
|
|
47
|
+
p5: ()=>installGlobal
|
|
47
48
|
});
|
|
48
49
|
const LIVING_KEYS = [
|
|
49
50
|
'DOMException',
|
package/dist/{813.js → 607.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "607";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"607"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"./src/runtime/worker/console.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -30,13 +31,13 @@ export const __webpack_modules__ = {
|
|
|
30
31
|
getPrettyName(type) {
|
|
31
32
|
switch(type){
|
|
32
33
|
case 'error':
|
|
33
|
-
return _utils__WEBPACK_IMPORTED_MODULE_3__
|
|
34
|
+
return _utils__WEBPACK_IMPORTED_MODULE_3__.yW.red(type);
|
|
34
35
|
case 'warn':
|
|
35
|
-
return _utils__WEBPACK_IMPORTED_MODULE_3__
|
|
36
|
+
return _utils__WEBPACK_IMPORTED_MODULE_3__.yW.yellow(type);
|
|
36
37
|
case 'info':
|
|
37
|
-
return _utils__WEBPACK_IMPORTED_MODULE_3__
|
|
38
|
+
return _utils__WEBPACK_IMPORTED_MODULE_3__.yW.cyan(type);
|
|
38
39
|
default:
|
|
39
|
-
return _utils__WEBPACK_IMPORTED_MODULE_3__
|
|
40
|
+
return _utils__WEBPACK_IMPORTED_MODULE_3__.yW.gray(type);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
_log(name, message, type = 'stdout') {
|
|
@@ -78,11 +79,11 @@ export const __webpack_modules__ = {
|
|
|
78
79
|
}
|
|
79
80
|
group(title, ...args) {
|
|
80
81
|
this._groupDepth++;
|
|
81
|
-
if (null != title || args.length > 0) this._log('group', _utils__WEBPACK_IMPORTED_MODULE_3__
|
|
82
|
+
if (null != title || args.length > 0) this._log('group', _utils__WEBPACK_IMPORTED_MODULE_3__.yW.bold((0, node_util__WEBPACK_IMPORTED_MODULE_2__.format)(title, ...args)));
|
|
82
83
|
}
|
|
83
84
|
groupCollapsed(title, ...args) {
|
|
84
85
|
this._groupDepth++;
|
|
85
|
-
if (null != title || args.length > 0) this._log('groupCollapsed', _utils__WEBPACK_IMPORTED_MODULE_3__
|
|
86
|
+
if (null != title || args.length > 0) this._log('groupCollapsed', _utils__WEBPACK_IMPORTED_MODULE_3__.yW.bold((0, node_util__WEBPACK_IMPORTED_MODULE_2__.format)(title, ...args)));
|
|
86
87
|
}
|
|
87
88
|
groupEnd() {
|
|
88
89
|
if (this._groupDepth > 0) this._groupDepth--;
|
|
@@ -102,7 +103,7 @@ export const __webpack_modules__ = {
|
|
|
102
103
|
if (null != startTime) {
|
|
103
104
|
const endTime = RealDate.now();
|
|
104
105
|
const time = endTime - startTime.getTime();
|
|
105
|
-
this._log('time', (0, node_util__WEBPACK_IMPORTED_MODULE_2__.format)(`${label}: ${(0, _utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
106
|
+
this._log('time', (0, node_util__WEBPACK_IMPORTED_MODULE_2__.format)(`${label}: ${(0, _utils__WEBPACK_IMPORTED_MODULE_3__.kV)(time)}`));
|
|
106
107
|
delete this._timers[label];
|
|
107
108
|
}
|
|
108
109
|
}
|
|
@@ -111,7 +112,7 @@ export const __webpack_modules__ = {
|
|
|
111
112
|
if (null != startTime) {
|
|
112
113
|
const endTime = new RealDate();
|
|
113
114
|
const time = endTime.getTime() - startTime.getTime();
|
|
114
|
-
this._log('time', (0, node_util__WEBPACK_IMPORTED_MODULE_2__.format)(`${label}: ${(0, _utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
115
|
+
this._log('time', (0, node_util__WEBPACK_IMPORTED_MODULE_2__.format)(`${label}: ${(0, _utils__WEBPACK_IMPORTED_MODULE_3__.kV)(time)}`, ...data));
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
warn(firstArg, ...args) {
|
|
@@ -124,12 +125,12 @@ export const __webpack_modules__ = {
|
|
|
124
125
|
},
|
|
125
126
|
"./src/utils/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
126
127
|
__webpack_require__.d(__webpack_exports__, {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
fN: ()=>helper.fN,
|
|
129
|
+
Gv: ()=>helper.Gv,
|
|
130
|
+
kV: ()=>helper.kV,
|
|
131
|
+
q_: ()=>constants.q_,
|
|
132
|
+
bg: ()=>helper.bg,
|
|
133
|
+
yW: ()=>helper.yW
|
|
133
134
|
});
|
|
134
135
|
var constants = __webpack_require__("./src/utils/constants.ts");
|
|
135
136
|
var helper = __webpack_require__("./src/utils/helper.ts");
|