@rstest/core 0.2.0 → 0.2.2
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/{72.js → 171.js} +2 -1
- package/dist/{920.js → 33.js} +36 -33
- package/dist/{44.js → 350.js} +6 -5
- package/dist/{813.js → 607.js} +16 -15
- package/dist/{208.js → 655.js} +61 -60
- package/dist/{359.js → 698.js} +74 -66
- 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} +56 -55
- package/dist/{668.js → 928.js} +3 -2
- package/dist/{25.js → 967.js} +8 -7
- package/dist/{64.js → 969.js} +2 -1
- package/dist/{285.js → 971.js} +12 -11
- package/dist/{854.js → 985.js} +14 -13
- package/dist/index.js +85 -85
- package/dist/worker.js +41 -39
- package/dist-types/index.d.ts +1 -0
- package/dist-types/worker.d.ts +1 -0
- package/package.json +4 -4
- /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/worker.js
CHANGED
|
@@ -4900,7 +4900,7 @@ var __webpack_modules__ = {
|
|
|
4900
4900
|
},
|
|
4901
4901
|
"../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
4902
4902
|
const os = __webpack_require__("node:os");
|
|
4903
|
-
const tty = __webpack_require__("tty");
|
|
4903
|
+
const tty = __webpack_require__("node:tty");
|
|
4904
4904
|
const hasFlag = __webpack_require__("../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js");
|
|
4905
4905
|
const { env } = process;
|
|
4906
4906
|
let forceColor;
|
|
@@ -4967,11 +4967,11 @@ var __webpack_modules__ = {
|
|
|
4967
4967
|
},
|
|
4968
4968
|
"./src/runtime/util.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4969
4969
|
__webpack_require__.d(__webpack_exports__, {
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4970
|
+
zH: ()=>setRealTimers,
|
|
4971
|
+
nD: ()=>formatName,
|
|
4972
|
+
o9: ()=>formatTestError,
|
|
4973
|
+
si: ()=>TestRegisterError,
|
|
4974
|
+
rZ: ()=>getRealTimers
|
|
4975
4975
|
});
|
|
4976
4976
|
var external_node_util_ = __webpack_require__("node:util");
|
|
4977
4977
|
var build = __webpack_require__("../../node_modules/.pnpm/jest-diff@30.0.5/node_modules/jest-diff/build/index.js");
|
|
@@ -5045,9 +5045,9 @@ var __webpack_modules__ = {
|
|
|
5045
5045
|
},
|
|
5046
5046
|
"./src/utils/constants.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5047
5047
|
__webpack_require__.d(__webpack_exports__, {
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5048
|
+
TE: ()=>globalApis,
|
|
5049
|
+
q_: ()=>ROOT_SUITE_NAME,
|
|
5050
|
+
vO: ()=>TEST_DELIMITER
|
|
5051
5051
|
});
|
|
5052
5052
|
const TEST_DELIMITER = '>';
|
|
5053
5053
|
const ROOT_SUITE_NAME = 'Rstest:_internal_root_suite';
|
|
@@ -5067,12 +5067,12 @@ var __webpack_modules__ = {
|
|
|
5067
5067
|
},
|
|
5068
5068
|
"./src/utils/helper.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5069
5069
|
__webpack_require__.d(__webpack_exports__, {
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5070
|
+
Gv: ()=>isObject,
|
|
5071
|
+
bg: ()=>castArray,
|
|
5072
|
+
fN: ()=>getTaskNameWithPrefix,
|
|
5073
|
+
gy: ()=>undoSerializableConfig,
|
|
5074
|
+
kV: ()=>prettyTime,
|
|
5075
|
+
yW: ()=>picocolors__WEBPACK_IMPORTED_MODULE_2___default.a
|
|
5076
5076
|
});
|
|
5077
5077
|
__webpack_require__("pathe");
|
|
5078
5078
|
var picocolors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
@@ -5104,7 +5104,7 @@ var __webpack_modules__ = {
|
|
|
5104
5104
|
return time;
|
|
5105
5105
|
};
|
|
5106
5106
|
const getTaskNames = (test)=>(test.parentNames || []).concat(test.name).filter(Boolean);
|
|
5107
|
-
const getTaskNameWithPrefix = (test, delimiter = _constants__WEBPACK_IMPORTED_MODULE_1__.
|
|
5107
|
+
const getTaskNameWithPrefix = (test, delimiter = _constants__WEBPACK_IMPORTED_MODULE_1__.vO)=>getTaskNames(test).join(` ${delimiter} `);
|
|
5108
5108
|
const REGEXP_FLAG_PREFIX = 'RSTEST_REGEXP:';
|
|
5109
5109
|
const unwrapRegex = (value)=>{
|
|
5110
5110
|
if (value.startsWith(REGEXP_FLAG_PREFIX)) {
|
|
@@ -5127,10 +5127,10 @@ var __webpack_modules__ = {
|
|
|
5127
5127
|
},
|
|
5128
5128
|
"./src/utils/logger.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5129
5129
|
__webpack_require__.d(__webpack_exports__, {
|
|
5130
|
-
|
|
5130
|
+
v: ()=>src_logger
|
|
5131
5131
|
});
|
|
5132
5132
|
var external_node_os_ = __webpack_require__("node:os");
|
|
5133
|
-
var external_node_tty_ = __webpack_require__("tty");
|
|
5133
|
+
var external_node_tty_ = __webpack_require__("node:tty");
|
|
5134
5134
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : node_process.argv) {
|
|
5135
5135
|
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
5136
5136
|
const position = argv.indexOf(prefix + flag);
|
|
@@ -5398,8 +5398,8 @@ var __webpack_modules__ = {
|
|
|
5398
5398
|
src_logger.override({
|
|
5399
5399
|
debug: (message, ...args)=>{
|
|
5400
5400
|
if ('verbose' !== src_logger.level) return;
|
|
5401
|
-
const time = helper
|
|
5402
|
-
console.log(` ${helper
|
|
5401
|
+
const time = helper.yW.gray(getTime());
|
|
5402
|
+
console.log(` ${helper.yW.magenta('rstest')} ${time} ${message}`, ...args);
|
|
5403
5403
|
}
|
|
5404
5404
|
});
|
|
5405
5405
|
},
|
|
@@ -5433,7 +5433,7 @@ var __webpack_modules__ = {
|
|
|
5433
5433
|
"node:path": function(module) {
|
|
5434
5434
|
module.exports = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__;
|
|
5435
5435
|
},
|
|
5436
|
-
tty: function(module) {
|
|
5436
|
+
"node:tty": function(module) {
|
|
5437
5437
|
module.exports = __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__;
|
|
5438
5438
|
},
|
|
5439
5439
|
"node:util": function(module) {
|
|
@@ -5533,7 +5533,7 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
5533
5533
|
})();
|
|
5534
5534
|
(()=>{
|
|
5535
5535
|
var installedChunks = {
|
|
5536
|
-
|
|
5536
|
+
270: 0
|
|
5537
5537
|
};
|
|
5538
5538
|
var installChunk = (data)=>{
|
|
5539
5539
|
var __webpack_ids__ = data.__webpack_ids__;
|
|
@@ -5641,7 +5641,7 @@ const createRequire = (filename, distPath, rstestContext, assetFiles, interopDef
|
|
|
5641
5641
|
interopDefault
|
|
5642
5642
|
});
|
|
5643
5643
|
} catch (err) {
|
|
5644
|
-
logger.
|
|
5644
|
+
logger.v.error(`load file ${joinedPath} failed:\n`, err instanceof Error ? err.message : err);
|
|
5645
5645
|
}
|
|
5646
5646
|
const resolved = _require.resolve(id);
|
|
5647
5647
|
return _require(resolved);
|
|
@@ -5804,20 +5804,20 @@ class RstestSnapshotEnvironment extends NodeSnapshotEnvironment {
|
|
|
5804
5804
|
return `// Rstest Snapshot v${this.getVersion()}`;
|
|
5805
5805
|
}
|
|
5806
5806
|
}
|
|
5807
|
-
const getGlobalApi = (api)=>constants.
|
|
5807
|
+
const getGlobalApi = (api)=>constants.TE.reduce((apis, key)=>{
|
|
5808
5808
|
apis[key] = api[key];
|
|
5809
5809
|
return apis;
|
|
5810
5810
|
}, {});
|
|
5811
5811
|
const listeners = [];
|
|
5812
5812
|
let isTeardown = false;
|
|
5813
5813
|
const preparePool = async ({ entryInfo: { distPath, testPath }, sourceMaps, updateSnapshot, context })=>{
|
|
5814
|
-
(0, util.
|
|
5815
|
-
context.runtimeConfig = (0, helper.
|
|
5814
|
+
(0, util.zH)();
|
|
5815
|
+
context.runtimeConfig = (0, helper.gy)(context.runtimeConfig);
|
|
5816
5816
|
const cleanupFns = [];
|
|
5817
5817
|
const { rpc } = createRuntimeRpc(createForksRpcOptions());
|
|
5818
5818
|
const { runtimeConfig: { globals, printConsoleTrace, disableConsoleIntercept, testEnvironment } } = context;
|
|
5819
5819
|
if (!disableConsoleIntercept) {
|
|
5820
|
-
const { createCustomConsole } = await __webpack_require__.e("
|
|
5820
|
+
const { createCustomConsole } = await __webpack_require__.e("607").then(__webpack_require__.bind(__webpack_require__, "./src/runtime/worker/console.ts"));
|
|
5821
5821
|
global.console = createCustomConsole({
|
|
5822
5822
|
rpc,
|
|
5823
5823
|
testPath,
|
|
@@ -5836,10 +5836,10 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, sourceMaps, upda
|
|
|
5836
5836
|
environment: 'node'
|
|
5837
5837
|
};
|
|
5838
5838
|
const { createRstestRuntime } = await Promise.all([
|
|
5839
|
-
__webpack_require__.e("
|
|
5840
|
-
__webpack_require__.e("
|
|
5839
|
+
__webpack_require__.e("655"),
|
|
5840
|
+
__webpack_require__.e("85")
|
|
5841
5841
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/runtime/api/index.ts"));
|
|
5842
|
-
const { install } = await __webpack_require__.e("
|
|
5842
|
+
const { install } = await __webpack_require__.e("969").then(__webpack_require__.t.bind(__webpack_require__, "../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js", 23));
|
|
5843
5843
|
install({
|
|
5844
5844
|
retrieveSourceMap: (source)=>{
|
|
5845
5845
|
if (sourceMaps[source]) return {
|
|
@@ -5849,14 +5849,16 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, sourceMaps, upda
|
|
|
5849
5849
|
return null;
|
|
5850
5850
|
}
|
|
5851
5851
|
});
|
|
5852
|
-
listeners.forEach((fn)=>
|
|
5852
|
+
listeners.forEach((fn)=>{
|
|
5853
|
+
fn();
|
|
5854
|
+
});
|
|
5853
5855
|
listeners.length = 0;
|
|
5854
5856
|
const unhandledErrors = [];
|
|
5855
5857
|
const handleError = (e, type)=>{
|
|
5856
5858
|
const error = 'string' == typeof e ? new Error(e) : e;
|
|
5857
5859
|
error.name = type;
|
|
5858
5860
|
if (isTeardown) {
|
|
5859
|
-
error.stack = `${helper
|
|
5861
|
+
error.stack = `${helper.yW.yellow('Caught error after test environment was torn down:')}\n\n${error.stack}`;
|
|
5860
5862
|
console.error(error);
|
|
5861
5863
|
} else {
|
|
5862
5864
|
console.error(error);
|
|
@@ -5877,14 +5879,14 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, sourceMaps, upda
|
|
|
5877
5879
|
break;
|
|
5878
5880
|
case 'jsdom':
|
|
5879
5881
|
{
|
|
5880
|
-
const { environment } = await __webpack_require__.e("
|
|
5882
|
+
const { environment } = await __webpack_require__.e("711").then(__webpack_require__.bind(__webpack_require__, "./src/runtime/worker/env/jsdom.ts"));
|
|
5881
5883
|
const { teardown } = await environment.setup(global, {});
|
|
5882
5884
|
cleanupFns.push(()=>teardown(global));
|
|
5883
5885
|
break;
|
|
5884
5886
|
}
|
|
5885
5887
|
case 'happy-dom':
|
|
5886
5888
|
{
|
|
5887
|
-
const { environment } = await __webpack_require__.e("
|
|
5889
|
+
const { environment } = await __webpack_require__.e("350").then(__webpack_require__.bind(__webpack_require__, "./src/runtime/worker/env/happyDom.ts"));
|
|
5888
5890
|
const { teardown } = await environment.setup(global, {});
|
|
5889
5891
|
cleanupFns.push(async ()=>teardown(global));
|
|
5890
5892
|
break;
|
|
@@ -5958,7 +5960,7 @@ const runInPool = async (options)=>{
|
|
|
5958
5960
|
});
|
|
5959
5961
|
process.off('SIGTERM', onExit);
|
|
5960
5962
|
const teardown = async ()=>{
|
|
5961
|
-
await new Promise((resolve)=>(0, util.
|
|
5963
|
+
await new Promise((resolve)=>(0, util.rZ)().setTimeout(resolve));
|
|
5962
5964
|
await Promise.all(cleanups.map((fn)=>fn()));
|
|
5963
5965
|
isTeardown = true;
|
|
5964
5966
|
process.once('SIGTERM', onExit);
|
|
@@ -5979,13 +5981,13 @@ const runInPool = async (options)=>{
|
|
|
5979
5981
|
return {
|
|
5980
5982
|
testPath,
|
|
5981
5983
|
tests,
|
|
5982
|
-
errors: (0, util.
|
|
5984
|
+
errors: (0, util.o9)(unhandledErrors)
|
|
5983
5985
|
};
|
|
5984
5986
|
} catch (err) {
|
|
5985
5987
|
return {
|
|
5986
5988
|
testPath,
|
|
5987
5989
|
tests: [],
|
|
5988
|
-
errors: (0, util.
|
|
5990
|
+
errors: (0, util.o9)(err)
|
|
5989
5991
|
};
|
|
5990
5992
|
} finally{
|
|
5991
5993
|
await teardown();
|
|
@@ -6015,7 +6017,7 @@ const runInPool = async (options)=>{
|
|
|
6015
6017
|
}, api);
|
|
6016
6018
|
if (unhandledErrors.length > 0) {
|
|
6017
6019
|
results.status = 'fail';
|
|
6018
|
-
results.errors = (results.errors || []).concat(...(0, util.
|
|
6020
|
+
results.errors = (results.errors || []).concat(...(0, util.o9)(unhandledErrors));
|
|
6019
6021
|
}
|
|
6020
6022
|
return results;
|
|
6021
6023
|
} catch (err) {
|
|
@@ -6024,7 +6026,7 @@ const runInPool = async (options)=>{
|
|
|
6024
6026
|
status: 'fail',
|
|
6025
6027
|
name: '',
|
|
6026
6028
|
results: [],
|
|
6027
|
-
errors: (0, util.
|
|
6029
|
+
errors: (0, util.o9)(err)
|
|
6028
6030
|
};
|
|
6029
6031
|
} finally{
|
|
6030
6032
|
await teardown();
|
package/dist-types/index.d.ts
CHANGED
package/dist-types/worker.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rstest/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "The Rsbuild-based test tool.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rstest/issues"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"chai": "^5.2.1",
|
|
48
48
|
"@types/chai": "^5.2.2",
|
|
49
|
-
"@rsbuild/core": "1.4
|
|
49
|
+
"@rsbuild/core": "1.5.0-beta.4",
|
|
50
50
|
"birpc": "2.5.0",
|
|
51
51
|
"pathe": "^2.0.3",
|
|
52
52
|
"std-env": "^3.9.0",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"@vitest/expect": "^3.2.4",
|
|
57
57
|
"@vitest/snapshot": "^3.2.4",
|
|
58
58
|
"@babel/code-frame": "^7.27.1",
|
|
59
|
-
"@jridgewell/trace-mapping": "0.3.
|
|
59
|
+
"@jridgewell/trace-mapping": "0.3.30",
|
|
60
60
|
"@microsoft/api-extractor": "^7.52.10",
|
|
61
|
-
"@rslib/core": "0.
|
|
61
|
+
"@rslib/core": "0.12.2",
|
|
62
62
|
"@sinonjs/fake-timers": "^14.0.0",
|
|
63
63
|
"@types/babel__code-frame": "^7.0.6",
|
|
64
64
|
"@types/jsdom": "^21.1.7",
|
|
File without changes
|
|
File without changes
|