@rstest/core 0.8.5 → 0.9.1
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/LICENSE.md +2 -2
- package/dist/0~130.js +0 -1
- package/dist/0~1472.js +2 -2
- package/dist/0~2173.js +104 -74
- package/dist/{0~3919.js → 0~262.js} +31 -30
- package/dist/0~3062.js +1 -1
- package/dist/0~3346.js +1 -1
- package/dist/0~5835.js +17 -4
- package/dist/0~6923.js +11 -3
- package/dist/0~7583.js +2 -2
- package/dist/0~7882.js +37 -36
- package/dist/0~89.js +50 -31
- package/dist/0~9634.js +5 -5
- package/dist/0~9744.js +1014 -0
- package/dist/1294.js +1 -0
- package/dist/3160.js +14 -64
- package/dist/{5960.js → 4597.js} +0 -1
- package/dist/6151.js +3119 -51
- package/dist/9131.js +178 -100
- package/dist/browser-runtime/389.js +3398 -362
- package/dist/browser-runtime/index.d.ts +40 -10
- package/dist/browser.d.ts +53 -10
- package/dist/index.d.ts +44 -79
- package/dist/mockRuntimeCode.js +15 -9
- package/dist/worker.d.ts +13 -1521
- package/dist/worker.js +14 -8
- package/package.json +18 -15
- package/dist/0~1981.js +0 -2
- package/dist/0~9348.js +0 -951
- package/dist/721.js +0 -8
package/dist/worker.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
|
-
import { basename, isAbsolute,
|
|
3
|
+
import { basename, isAbsolute, color, dirname, resolve as pathe_M_eThtNZ_resolve, join } from "./3160.js";
|
|
4
4
|
import "./487.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createWorkerMetaMessage, createBirpc } from "./4597.js";
|
|
6
6
|
import { createCoverageProvider } from "./5734.js";
|
|
7
7
|
import { formatTestError, setRealTimers, getRealTimers } from "./1294.js";
|
|
8
8
|
import { globalApis } from "./1157.js";
|
|
9
9
|
const processSend = process.send.bind(process);
|
|
10
10
|
const processOn = process.on.bind(process);
|
|
11
11
|
const processOff = process.off.bind(process);
|
|
12
|
-
function createForksRpcOptions({
|
|
12
|
+
function createForksRpcOptions({ dispose = [] }) {
|
|
13
13
|
return {
|
|
14
|
-
serialize: nodeV8.serialize,
|
|
15
|
-
deserialize: (v)=>nodeV8.deserialize(Buffer.from(v)),
|
|
16
14
|
post (v) {
|
|
17
15
|
processSend(v);
|
|
18
16
|
},
|
|
@@ -104,7 +102,10 @@ const registerGlobalApi = (api)=>globalApis.reduce((apis, key)=>{
|
|
|
104
102
|
const globalCleanups = [];
|
|
105
103
|
let isTeardown = false;
|
|
106
104
|
const setupEnv = (env)=>{
|
|
107
|
-
if (env) Object.
|
|
105
|
+
if (env) Object.entries(env).forEach(([key, value])=>{
|
|
106
|
+
if (void 0 === value) delete process.env[key];
|
|
107
|
+
else process.env[key] = value;
|
|
108
|
+
});
|
|
108
109
|
};
|
|
109
110
|
const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot, context })=>{
|
|
110
111
|
globalCleanups.forEach((fn)=>{
|
|
@@ -112,7 +113,6 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
|
|
|
112
113
|
});
|
|
113
114
|
globalCleanups.length = 0;
|
|
114
115
|
setRealTimers();
|
|
115
|
-
context.runtimeConfig = undoSerializableConfig(context.runtimeConfig);
|
|
116
116
|
process.env.RSTEST_WORKER_ID = String(process.__tinypool_state__.workerId || context.taskId);
|
|
117
117
|
const cleanupFns = [];
|
|
118
118
|
const disposeFns = [];
|
|
@@ -380,7 +380,13 @@ const runInPool = async (options)=>{
|
|
|
380
380
|
}
|
|
381
381
|
if (coverageProvider) {
|
|
382
382
|
const coverageMap = coverageProvider.collect();
|
|
383
|
-
if (coverageMap)
|
|
383
|
+
if (coverageMap) {
|
|
384
|
+
results.coverage = {};
|
|
385
|
+
Object.entries(coverageMap.toJSON()).forEach(([key, value])=>{
|
|
386
|
+
if ('toJSON' in value) results.coverage[key] = value.toJSON();
|
|
387
|
+
else results.coverage[key] = value;
|
|
388
|
+
});
|
|
389
|
+
}
|
|
384
390
|
coverageProvider.cleanup();
|
|
385
391
|
}
|
|
386
392
|
return results;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rstest/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "The Rsbuild-based test tool.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rstest/issues"
|
|
@@ -54,19 +54,21 @@
|
|
|
54
54
|
"importMeta.d.ts"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@rsbuild/core": "^
|
|
57
|
+
"@rsbuild/core": "^2.0.0-beta.6",
|
|
58
58
|
"@types/chai": "^5.2.3",
|
|
59
|
-
"tinypool": "^
|
|
59
|
+
"tinypool": "^2.1.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
62
|
+
"@rsbuild/plugin-less": "^1.6.0",
|
|
63
|
+
"@rsbuild/plugin-sass": "^1.5.0",
|
|
64
|
+
"@babel/code-frame": "^7.29.0",
|
|
65
|
+
"@clack/prompts": "^1.1.0",
|
|
64
66
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
65
|
-
"@microsoft/api-extractor": "^7.
|
|
66
|
-
"@rsbuild/plugin-node-polyfill": "^1.
|
|
67
|
-
"@rslib/core": "^0.19.
|
|
67
|
+
"@microsoft/api-extractor": "^7.57.6",
|
|
68
|
+
"@rsbuild/plugin-node-polyfill": "^1.4.4",
|
|
69
|
+
"@rslib/core": "^0.19.6",
|
|
68
70
|
"@sinonjs/fake-timers": "^15.1.0",
|
|
69
|
-
"@types/babel__code-frame": "^7.0
|
|
71
|
+
"@types/babel__code-frame": "^7.27.0",
|
|
70
72
|
"@types/istanbul-lib-coverage": "^2.0.6",
|
|
71
73
|
"@types/istanbul-lib-report": "^3.0.3",
|
|
72
74
|
"@types/istanbul-reports": "^3.0.4",
|
|
@@ -77,19 +79,19 @@
|
|
|
77
79
|
"@vitest/expect": "^3.2.4",
|
|
78
80
|
"@vitest/snapshot": "^3.2.4",
|
|
79
81
|
"birpc": "^4.0.0",
|
|
80
|
-
"cac": "^
|
|
81
|
-
"chai": "^
|
|
82
|
+
"cac": "^7.0.0",
|
|
83
|
+
"chai": "^6.2.2",
|
|
82
84
|
"chokidar": "^4.0.3",
|
|
83
|
-
"happy-dom": "^20.0
|
|
85
|
+
"happy-dom": "^20.7.0",
|
|
84
86
|
"jest-diff": "^30.2.0",
|
|
85
87
|
"jsdom": "^26.1.0",
|
|
86
|
-
"memfs": "^4.
|
|
88
|
+
"memfs": "^4.56.10",
|
|
87
89
|
"package-manager-detector": "^1.6.0",
|
|
88
90
|
"pathe": "^2.0.3",
|
|
89
91
|
"picocolors": "^1.1.1",
|
|
90
92
|
"picomatch": "^4.0.3",
|
|
91
93
|
"pretty-format": "^30.2.0",
|
|
92
|
-
"rslog": "^
|
|
94
|
+
"rslog": "^2.0.0",
|
|
93
95
|
"source-map-support": "^0.5.21",
|
|
94
96
|
"stacktrace-parser": "0.1.11",
|
|
95
97
|
"std-env": "^3.10.0",
|
|
@@ -98,6 +100,7 @@
|
|
|
98
100
|
"tinyspy": "^4.0.4",
|
|
99
101
|
"url-extras": "^0.1.0",
|
|
100
102
|
"webpack-license-plugin": "^4.5.1",
|
|
103
|
+
"webpack": "^5.105.2",
|
|
101
104
|
"@rstest/browser-ui": "0.0.0",
|
|
102
105
|
"@rstest/tsconfig": "0.0.1"
|
|
103
106
|
},
|
|
@@ -114,7 +117,7 @@
|
|
|
114
117
|
}
|
|
115
118
|
},
|
|
116
119
|
"engines": {
|
|
117
|
-
"node": ">=
|
|
120
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
118
121
|
},
|
|
119
122
|
"publishConfig": {
|
|
120
123
|
"access": "public",
|
package/dist/0~1981.js
DELETED