@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/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, undoSerializableConfig, dirname, color, resolve as pathe_M_eThtNZ_resolve, join } from "./3160.js";
3
+ import { basename, isAbsolute, color, dirname, resolve as pathe_M_eThtNZ_resolve, join } from "./3160.js";
4
4
  import "./487.js";
5
- import { node_v8, createWorkerMetaMessage, createBirpc } from "./5960.js";
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({ nodeV8 = node_v8, dispose = [] }) {
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.assign(process.env, env);
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) results.coverage = coverageMap.toJSON();
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.8.5",
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": "^1.7.3",
57
+ "@rsbuild/core": "^2.0.0-beta.6",
58
58
  "@types/chai": "^5.2.3",
59
- "tinypool": "^1.1.1"
59
+ "tinypool": "^2.1.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@babel/code-frame": "^7.27.1",
63
- "@clack/prompts": "^0.10.1",
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.55.2",
66
- "@rsbuild/plugin-node-polyfill": "^1.3.0",
67
- "@rslib/core": "^0.19.0",
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.6",
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": "^6.7.14",
81
- "chai": "^5.3.3",
82
+ "cac": "^7.0.0",
83
+ "chai": "^6.2.2",
82
84
  "chokidar": "^4.0.3",
83
- "happy-dom": "^20.0.11",
85
+ "happy-dom": "^20.7.0",
84
86
  "jest-diff": "^30.2.0",
85
87
  "jsdom": "^26.1.0",
86
- "memfs": "^4.51.1",
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": "^1.3.2",
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": ">=18.12.0"
120
+ "node": "^20.19.0 || >=22.12.0"
118
121
  },
119
122
  "publishConfig": {
120
123
  "access": "public",
package/dist/0~1981.js DELETED
@@ -1,2 +0,0 @@
1
- import "node:module";
2
- export { Readable, Writable } from "node:stream";