@rstest/core 0.9.1 → 0.9.3
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 +1 -1
- package/dist/{0~89.js → 0~8843.js} +24 -28
- package/dist/{0~1472.js → 0~browserLoader.js} +11 -11
- package/dist/{0~7882.js → 0~browser~1.js} +60 -61
- package/dist/{0~8426.js → 0~checkThresholds.js} +6 -6
- package/dist/{0~7583.js → 0~chokidar.js} +113 -72
- package/dist/{0~130.js → 0~console.js} +19 -20
- package/dist/{0~9744.js → 0~dist.js} +57 -57
- package/dist/{0~4403.js → 0~generate.js} +9 -6
- package/dist/{0~4809.js → 0~happyDom.js} +2 -2
- package/dist/{0~3346.js → 0~interop.js} +0 -1
- package/dist/{0~62.js → 0~jsdom.js} +2 -2
- package/dist/{0~262.js → 0~lib.js} +4 -1
- package/dist/{0~9634.js → 0~listTests.js} +15 -24
- package/dist/{0~6923.js → 0~loadEsModule.js} +7 -7
- package/dist/{0~5835.js → 0~loadModule.js} +11 -11
- package/dist/{0~6907.js → 0~magic-string.es.js} +2 -1
- package/dist/0~mergeReports.js +127 -0
- package/dist/{0~2255.js → 0~plugin.js} +2 -4
- package/dist/{0~6588.js → 0~restart.js} +8 -12
- package/dist/{0~2173.js → 0~runTests.js} +51 -60
- package/dist/{487.js → 1255.js} +22 -15
- package/dist/{6151.js → 1949.js} +41 -25
- package/dist/{6973.js → 255.js} +9 -10
- package/dist/{9131.js → 3145.js} +229 -479
- package/dist/{1157.js → 4411.js} +37 -37
- package/dist/{4484.js → 5040.js} +1 -2
- package/dist/{3160.js → 6830.js} +429 -106
- package/dist/7011.js +1 -1
- package/dist/{1294.js → 7552.js} +106 -83
- package/dist/{5734.js → 7704.js} +7 -6
- package/dist/browser-runtime/{2~907.js → 2~magic-string.es.js} +18 -11
- package/dist/browser-runtime/{389.js → 723.js} +178 -134
- package/dist/browser-runtime/{389.js.LICENSE.txt → 723.js.LICENSE.txt} +0 -22
- package/dist/browser-runtime/index.d.ts +40 -5
- package/dist/browser-runtime/index.js +1 -1
- package/dist/browser-runtime/rslib-runtime.js +11 -3
- package/dist/browser.d.ts +40 -5
- package/dist/browser.js +9 -7
- package/dist/globalSetupWorker.js +7 -14
- package/dist/index.d.ts +53 -6
- package/dist/index.js +2 -2
- package/dist/rslib-runtime.js +5 -8
- package/dist/worker.d.ts +30 -3
- package/dist/worker.js +20 -46
- package/package.json +19 -18
- package/dist/3160.js.LICENSE.txt +0 -21
- package/dist/4881.js +0 -2
- package/dist/6198.js +0 -2
- /package/dist/{0~7583.js.LICENSE.txt → 0~chokidar.js.LICENSE.txt} +0 -0
- /package/dist/{0~3062.js → 0~utils.js} +0 -0
- /package/dist/{6151.js.LICENSE.txt → 1949.js.LICENSE.txt} +0 -0
- /package/dist/{4597.js → 1983.js} +0 -0
- /package/dist/{1294.js.LICENSE.txt → 7552.js.LICENSE.txt} +0 -0
package/dist/{6151.js → 1949.js}
RENAMED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*! LICENSE: 1949.js.LICENSE.txt */
|
|
2
2
|
import "node:module";
|
|
3
|
+
import * as __rspack_external_node_util_1b29d436 from "node:util";
|
|
3
4
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
-
import {
|
|
5
|
-
import { getRealTimers, TestRegisterError, formatTestError, formatName } from "./
|
|
6
|
-
import {
|
|
5
|
+
import { isatty } from "node:tty";
|
|
6
|
+
import { parseTemplateTable, getRealTimers, TestRegisterError, formatTestError, formatName, isTemplateStringsArray } from "./7552.js";
|
|
7
|
+
import { getTaskNameWithPrefix, isObject as helper_isObject, castArray, resolve as pathe_M_eThtNZ_resolve, normalize } from "./6830.js";
|
|
8
|
+
import { ROOT_SUITE_NAME } from "./4411.js";
|
|
7
9
|
import { parse } from "./1672.js";
|
|
8
10
|
import "./4899.js";
|
|
9
11
|
__webpack_require__.add({
|
|
@@ -188,7 +190,7 @@ __webpack_require__.add({
|
|
|
188
190
|
}
|
|
189
191
|
module.exports = valueToString;
|
|
190
192
|
},
|
|
191
|
-
"../../node_modules/.pnpm/@sinonjs+fake-timers@15.1.
|
|
193
|
+
"../../node_modules/.pnpm/@sinonjs+fake-timers@15.1.1/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
192
194
|
const globalObject = __webpack_require__("../../node_modules/.pnpm/@sinonjs+commons@3.0.1/node_modules/@sinonjs/commons/lib/index.js").global;
|
|
193
195
|
let timersModule, timersPromisesModule;
|
|
194
196
|
try {
|
|
@@ -217,7 +219,7 @@ __webpack_require__.add({
|
|
|
217
219
|
isPresent.hrtime = _global.process && "function" == typeof _global.process.hrtime;
|
|
218
220
|
isPresent.hrtimeBigint = isPresent.hrtime && "function" == typeof _global.process.hrtime.bigint;
|
|
219
221
|
isPresent.nextTick = _global.process && "function" == typeof _global.process.nextTick;
|
|
220
|
-
const utilPromisify = _global.process && __webpack_require__("
|
|
222
|
+
const utilPromisify = _global.process && __webpack_require__("util").promisify;
|
|
221
223
|
isPresent.performance = _global.performance && "function" == typeof _global.performance.now;
|
|
222
224
|
const hasPerformancePrototype = _global.Performance && (typeof _global.Performance).match(/^(function|object)$/);
|
|
223
225
|
const hasPerformanceConstructorPrototype = _global.performance && _global.performance.constructor && _global.performance.constructor.prototype;
|
|
@@ -1297,9 +1299,9 @@ __webpack_require__.add({
|
|
|
1297
1299
|
};
|
|
1298
1300
|
}
|
|
1299
1301
|
const defaultImplementation = withGlobal(globalObject);
|
|
1300
|
-
defaultImplementation.timers;
|
|
1301
|
-
defaultImplementation.createClock;
|
|
1302
|
-
defaultImplementation.install;
|
|
1302
|
+
exports.timers = defaultImplementation.timers;
|
|
1303
|
+
exports.createClock = defaultImplementation.createClock;
|
|
1304
|
+
exports.install = defaultImplementation.install;
|
|
1303
1305
|
exports.withGlobal = withGlobal;
|
|
1304
1306
|
},
|
|
1305
1307
|
"../../node_modules/.pnpm/type-detect@4.0.8/node_modules/type-detect/type-detect.js" (module) {
|
|
@@ -1366,6 +1368,9 @@ __webpack_require__.add({
|
|
|
1366
1368
|
}
|
|
1367
1369
|
return typeDetect;
|
|
1368
1370
|
});
|
|
1371
|
+
},
|
|
1372
|
+
util (module) {
|
|
1373
|
+
module.exports = __rspack_external_node_util_1b29d436;
|
|
1369
1374
|
}
|
|
1370
1375
|
});
|
|
1371
1376
|
var chunk_BVHSVHOK_f = {
|
|
@@ -1563,8 +1568,7 @@ function chunk_BVHSVHOK_p(n = !1) {
|
|
|
1563
1568
|
for (let [r, t] of chunk_BVHSVHOK_h)u[r] = e ? g(d(t[0]), d(t[1]), t[2]) : chunk_BVHSVHOK_a;
|
|
1564
1569
|
return u;
|
|
1565
1570
|
}
|
|
1566
|
-
|
|
1567
|
-
var node_r = void 0 !== process.env.FORCE_TTY || (0, external_node_tty_.isatty)(1);
|
|
1571
|
+
var node_r = void 0 !== process.env.FORCE_TTY || isatty(1);
|
|
1568
1572
|
var node_u = chunk_BVHSVHOK_p(node_r);
|
|
1569
1573
|
function _mergeNamespaces(n, m) {
|
|
1570
1574
|
m.forEach(function(e) {
|
|
@@ -13949,11 +13953,7 @@ function offsetToLineNumber(source, offset) {
|
|
|
13949
13953
|
return line + 1;
|
|
13950
13954
|
}
|
|
13951
13955
|
async function saveInlineSnapshots(environment, snapshots) {
|
|
13952
|
-
const MagicString = (await import("./0~
|
|
13953
|
-
Bundle: mod.Bundle,
|
|
13954
|
-
SourceMap: mod.SourceMap,
|
|
13955
|
-
default: mod.MagicString
|
|
13956
|
-
}))).default;
|
|
13956
|
+
const MagicString = (await import("./0~magic-string.es.js")).default;
|
|
13957
13957
|
const files = new Set(snapshots.map((i)=>i.file));
|
|
13958
13958
|
await Promise.all(Array.from(files).map(async (file)=>{
|
|
13959
13959
|
const snaps = snapshots.filter((i)=>i.file === file);
|
|
@@ -15922,16 +15922,24 @@ const createRuntimeAPI = ({ testPath, runtimeConfig, project })=>{
|
|
|
15922
15922
|
location: getLocation(),
|
|
15923
15923
|
runMode: condition ? 'skip' : options.runMode
|
|
15924
15924
|
});
|
|
15925
|
-
testFn.each = (
|
|
15925
|
+
testFn.each = (...args)=>{
|
|
15926
|
+
const location = getLocation();
|
|
15927
|
+
const cases = isTemplateStringsArray(args[0]) ? parseTemplateTable(args[0], ...args.slice(1)) : args[0];
|
|
15928
|
+
return runtimeInstance.each({
|
|
15926
15929
|
cases,
|
|
15927
15930
|
...options,
|
|
15928
|
-
location
|
|
15931
|
+
location
|
|
15929
15932
|
});
|
|
15930
|
-
|
|
15933
|
+
};
|
|
15934
|
+
testFn.for = (...args)=>{
|
|
15935
|
+
const location = getLocation();
|
|
15936
|
+
const cases = isTemplateStringsArray(args[0]) ? parseTemplateTable(args[0], ...args.slice(1)) : args[0];
|
|
15937
|
+
return runtimeInstance.for({
|
|
15931
15938
|
cases,
|
|
15932
15939
|
...options,
|
|
15933
|
-
location
|
|
15940
|
+
location
|
|
15934
15941
|
});
|
|
15942
|
+
};
|
|
15935
15943
|
return testFn;
|
|
15936
15944
|
};
|
|
15937
15945
|
const it = createTestAPI();
|
|
@@ -16001,16 +16009,24 @@ const createRuntimeAPI = ({ testPath, runtimeConfig, project })=>{
|
|
|
16001
16009
|
location: getLocation(),
|
|
16002
16010
|
runMode: condition ? options.runMode : 'skip'
|
|
16003
16011
|
});
|
|
16004
|
-
describeFn.each = (
|
|
16012
|
+
describeFn.each = (...args)=>{
|
|
16013
|
+
const location = getLocation();
|
|
16014
|
+
const cases = isTemplateStringsArray(args[0]) ? parseTemplateTable(args[0], ...args.slice(1)) : args[0];
|
|
16015
|
+
return runtimeInstance.describeEach({
|
|
16005
16016
|
cases,
|
|
16006
16017
|
...options,
|
|
16007
|
-
location
|
|
16018
|
+
location
|
|
16008
16019
|
});
|
|
16009
|
-
|
|
16020
|
+
};
|
|
16021
|
+
describeFn.for = (...args)=>{
|
|
16022
|
+
const location = getLocation();
|
|
16023
|
+
const cases = isTemplateStringsArray(args[0]) ? parseTemplateTable(args[0], ...args.slice(1)) : args[0];
|
|
16024
|
+
return runtimeInstance.describeFor({
|
|
16010
16025
|
cases,
|
|
16011
16026
|
...options,
|
|
16012
|
-
location
|
|
16027
|
+
location
|
|
16013
16028
|
});
|
|
16029
|
+
};
|
|
16014
16030
|
return describeFn;
|
|
16015
16031
|
};
|
|
16016
16032
|
const describe = createDescribeAPI();
|
|
@@ -16088,7 +16104,7 @@ function toTestInfo(test) {
|
|
|
16088
16104
|
runMode: test.runMode
|
|
16089
16105
|
};
|
|
16090
16106
|
}
|
|
16091
|
-
const fake_timers_src = __webpack_require__("../../node_modules/.pnpm/@sinonjs+fake-timers@15.1.
|
|
16107
|
+
const fake_timers_src = __webpack_require__("../../node_modules/.pnpm/@sinonjs+fake-timers@15.1.1/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js");
|
|
16092
16108
|
const fakeTimers_RealDate = Date;
|
|
16093
16109
|
class FakeTimers {
|
|
16094
16110
|
_clock;
|
package/dist/{6973.js → 255.js}
RENAMED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { formatTestEntryName } from "./
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { rspack } from "@rsbuild/core";
|
|
5
|
+
import { getAbsolutePath, color as logger_color } from "./6830.js";
|
|
6
|
+
import { formatTestEntryName } from "./4411.js";
|
|
7
7
|
import { posix } from "./7011.js";
|
|
8
|
-
const external_node_fs_ = __webpack_require__("node:fs");
|
|
9
8
|
const tryResolve = (request, rootPath)=>{
|
|
10
|
-
const { resolver } =
|
|
9
|
+
const { resolver } = rspack.experiments;
|
|
11
10
|
const esmFirstResolver = new resolver.ResolverFactory({
|
|
12
11
|
conditionNames: [
|
|
13
12
|
'node',
|
|
@@ -24,9 +23,9 @@ const getSetupFiles = (setups, rootPath)=>{
|
|
|
24
23
|
const setupFile = filePath.startsWith('file://') ? fileURLToPath(filePath) : filePath;
|
|
25
24
|
const setupFilePath = getAbsolutePath(rootPath, setupFile);
|
|
26
25
|
try {
|
|
27
|
-
if (!
|
|
28
|
-
let errorMessage = `Setup file ${
|
|
29
|
-
if (setupFilePath !== setupFile) errorMessage +=
|
|
26
|
+
if (!existsSync(setupFilePath)) {
|
|
27
|
+
let errorMessage = `Setup file ${logger_color.red(setupFile)} not found`;
|
|
28
|
+
if (setupFilePath !== setupFile) errorMessage += logger_color.gray(` (resolved path: ${setupFilePath})`);
|
|
30
29
|
throw errorMessage;
|
|
31
30
|
}
|
|
32
31
|
const relativePath = posix.relative(rootPath, setupFilePath);
|