@rstest/core 0.2.1 → 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} +35 -32
- 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/{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 +83 -83
- package/dist/worker.js +38 -36
- 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/{867.js → 85.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "85";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"85"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"./src/runtime/api/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -55,10 +56,10 @@ export const __webpack_modules__ = {
|
|
|
55
56
|
clearTimeout(timeoutId);
|
|
56
57
|
} catch (err) {
|
|
57
58
|
lastError = err;
|
|
58
|
-
if (!external_chai_.util.flag(assertion, '_isLastPollAttempt')) intervalId = (0, runtime_util.
|
|
59
|
+
if (!external_chai_.util.flag(assertion, '_isLastPollAttempt')) intervalId = (0, runtime_util.rZ)().setTimeout(check, interval);
|
|
59
60
|
}
|
|
60
61
|
};
|
|
61
|
-
timeoutId = (0, runtime_util.
|
|
62
|
+
timeoutId = (0, runtime_util.rZ)().setTimeout(()=>{
|
|
62
63
|
clearTimeout(intervalId);
|
|
63
64
|
external_chai_.util.flag(assertion, '_isLastPollAttempt', true);
|
|
64
65
|
const rejectWithCause = (cause)=>{
|
|
@@ -111,10 +112,10 @@ export const __webpack_modules__ = {
|
|
|
111
112
|
var snapshot_dist = __webpack_require__("../../node_modules/.pnpm/@vitest+snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js");
|
|
112
113
|
let _client;
|
|
113
114
|
function getSnapshotClient() {
|
|
114
|
-
if (!_client) _client = new snapshot_dist.
|
|
115
|
-
isEqual: (received, expected)=>(0, dist.
|
|
116
|
-
dist.
|
|
117
|
-
dist.
|
|
115
|
+
if (!_client) _client = new snapshot_dist.s({
|
|
116
|
+
isEqual: (received, expected)=>(0, dist.aI)(received, expected, [
|
|
117
|
+
dist.D,
|
|
118
|
+
dist.j2
|
|
118
119
|
])
|
|
119
120
|
});
|
|
120
121
|
return _client;
|
|
@@ -181,7 +182,7 @@ export const __webpack_modules__ = {
|
|
|
181
182
|
function getTestNames(test) {
|
|
182
183
|
return {
|
|
183
184
|
filepath: test.testPath,
|
|
184
|
-
name: (0, src_utils.
|
|
185
|
+
name: (0, src_utils.fN)(test)
|
|
185
186
|
};
|
|
186
187
|
}
|
|
187
188
|
const SnapshotPlugin = (chai, utils)=>{
|
|
@@ -247,7 +248,7 @@ export const __webpack_modules__ = {
|
|
|
247
248
|
inlineSnapshot = properties;
|
|
248
249
|
properties = void 0;
|
|
249
250
|
}
|
|
250
|
-
if (inlineSnapshot) inlineSnapshot = (0, snapshot_dist.
|
|
251
|
+
if (inlineSnapshot) inlineSnapshot = (0, snapshot_dist.cN)(inlineSnapshot);
|
|
251
252
|
const errorMessage = utils.flag(this, 'message');
|
|
252
253
|
getSnapshotClient().assert({
|
|
253
254
|
received: expected,
|
|
@@ -285,7 +286,7 @@ export const __webpack_modules__ = {
|
|
|
285
286
|
const error = utils.flag(this, 'error');
|
|
286
287
|
const promise = utils.flag(this, 'promise');
|
|
287
288
|
const errorMessage = utils.flag(this, 'message');
|
|
288
|
-
if (inlineSnapshot) inlineSnapshot = (0, snapshot_dist.
|
|
289
|
+
if (inlineSnapshot) inlineSnapshot = (0, snapshot_dist.cN)(inlineSnapshot);
|
|
289
290
|
getSnapshotClient().assert({
|
|
290
291
|
received: getError(expected, promise),
|
|
291
292
|
message,
|
|
@@ -296,16 +297,16 @@ export const __webpack_modules__ = {
|
|
|
296
297
|
...getTestNames(test)
|
|
297
298
|
});
|
|
298
299
|
});
|
|
299
|
-
utils.addMethod(chai.expect, 'addSnapshotSerializer', snapshot_dist.
|
|
300
|
+
utils.addMethod(chai.expect, 'addSnapshotSerializer', snapshot_dist.U$);
|
|
300
301
|
};
|
|
301
|
-
external_chai_.use(dist.
|
|
302
|
-
external_chai_.use(dist.
|
|
302
|
+
external_chai_.use(dist.Xs);
|
|
303
|
+
external_chai_.use(dist.dB);
|
|
303
304
|
external_chai_.use(SnapshotPlugin);
|
|
304
|
-
external_chai_.use(dist.
|
|
305
|
+
external_chai_.use(dist.Mc);
|
|
305
306
|
function createExpect({ getCurrentTest, workerState }) {
|
|
306
307
|
const expect = (value, message)=>{
|
|
307
|
-
const { assertionCalls } = (0, dist.
|
|
308
|
-
(0, dist.
|
|
308
|
+
const { assertionCalls } = (0, dist.Gu)(expect);
|
|
309
|
+
(0, dist.wb)({
|
|
309
310
|
assertionCalls: assertionCalls + 1
|
|
310
311
|
}, expect);
|
|
311
312
|
const assert = external_chai_.expect(value, message);
|
|
@@ -314,11 +315,11 @@ export const __webpack_modules__ = {
|
|
|
314
315
|
return assert;
|
|
315
316
|
};
|
|
316
317
|
Object.assign(expect, external_chai_.expect);
|
|
317
|
-
Object.assign(expect, globalThis[dist.
|
|
318
|
-
expect.getState = ()=>(0, dist.
|
|
319
|
-
expect.setState = (state)=>(0, dist.
|
|
320
|
-
const globalState = (0, dist.
|
|
321
|
-
(0, dist.
|
|
318
|
+
Object.assign(expect, globalThis[dist.fs]);
|
|
319
|
+
expect.getState = ()=>(0, dist.Gu)(expect);
|
|
320
|
+
expect.setState = (state)=>(0, dist.wb)(state, expect);
|
|
321
|
+
const globalState = (0, dist.Gu)(globalThis[dist.mZ]) || {};
|
|
322
|
+
(0, dist.wb)({
|
|
322
323
|
...globalState,
|
|
323
324
|
assertionCalls: 0,
|
|
324
325
|
isExpectingAssertions: false,
|
|
@@ -330,7 +331,7 @@ export const __webpack_modules__ = {
|
|
|
330
331
|
}
|
|
331
332
|
}, expect);
|
|
332
333
|
expect.extend = (matchers)=>external_chai_.expect.extend(expect, matchers);
|
|
333
|
-
expect.addEqualityTesters = (customTesters)=>(0, dist.
|
|
334
|
+
expect.addEqualityTesters = (customTesters)=>(0, dist.TB)(customTesters);
|
|
334
335
|
expect.soft = (...args)=>expect(...args).withContext({
|
|
335
336
|
soft: true
|
|
336
337
|
});
|
|
@@ -356,7 +357,7 @@ export const __webpack_modules__ = {
|
|
|
356
357
|
}
|
|
357
358
|
external_chai_.util.addMethod(expect, 'assertions', assertions);
|
|
358
359
|
external_chai_.util.addMethod(expect, 'hasAssertions', hasAssertions);
|
|
359
|
-
expect.extend(dist.
|
|
360
|
+
expect.extend(dist.Pf);
|
|
360
361
|
return expect;
|
|
361
362
|
}
|
|
362
363
|
const normalizeFixtures = (fixtures = {}, extendFixtures = {})=>{
|
|
@@ -374,7 +375,7 @@ export const __webpack_modules__ = {
|
|
|
374
375
|
};
|
|
375
376
|
continue;
|
|
376
377
|
}
|
|
377
|
-
if ((0, src_utils.
|
|
378
|
+
if ((0, src_utils.Gv)(value[1]) && Object.keys(value[1]).some((key)=>fixtureOptionKeys.includes(key))) {
|
|
378
379
|
result[key] = {
|
|
379
380
|
isFn: 'function' == typeof value[0],
|
|
380
381
|
value: value[0],
|
|
@@ -504,7 +505,7 @@ export const __webpack_modules__ = {
|
|
|
504
505
|
}
|
|
505
506
|
const shouldTestSkip = (test, runOnly, testNamePattern)=>{
|
|
506
507
|
if (runOnly && 'only' !== test.runMode) return true;
|
|
507
|
-
if (testNamePattern && !(0, src_utils.
|
|
508
|
+
if (testNamePattern && !(0, src_utils.fN)(test, '').match(testNamePattern)) return true;
|
|
508
509
|
return false;
|
|
509
510
|
};
|
|
510
511
|
const traverseUpdateTestRunMode = (testSuite, parentRunMode, runOnly, testNamePattern)=>{
|
|
@@ -543,7 +544,7 @@ export const __webpack_modules__ = {
|
|
|
543
544
|
};
|
|
544
545
|
const updateTestParents = (tests, parentNames = [])=>{
|
|
545
546
|
for (const test of tests)if ('suite' === test.type) {
|
|
546
|
-
const names = test.name === src_utils.
|
|
547
|
+
const names = test.name === src_utils.q_ ? parentNames : parentNames.concat(test.name);
|
|
547
548
|
updateTestParents(test.tests, names);
|
|
548
549
|
} else test.parentNames = parentNames;
|
|
549
550
|
};
|
|
@@ -572,7 +573,7 @@ export const __webpack_modules__ = {
|
|
|
572
573
|
return async (...args)=>{
|
|
573
574
|
let timeoutId;
|
|
574
575
|
const timeoutPromise = new Promise((_, reject)=>{
|
|
575
|
-
timeoutId = (0, runtime_util.
|
|
576
|
+
timeoutId = (0, runtime_util.rZ)().setTimeout(()=>reject(makeError(`${name} timed out in ${timeout}ms`, stackTraceError)), timeout);
|
|
576
577
|
});
|
|
577
578
|
try {
|
|
578
579
|
const result = await Promise.race([
|
|
@@ -627,7 +628,7 @@ export const __webpack_modules__ = {
|
|
|
627
628
|
await snapshotClient.setup(testPath, snapshotOptions);
|
|
628
629
|
const runTestsCase = async (test, parentHooks)=>{
|
|
629
630
|
if ('skip' === test.runMode) {
|
|
630
|
-
snapshotClient.skipTest(testPath, (0, src_utils.
|
|
631
|
+
snapshotClient.skipTest(testPath, (0, src_utils.fN)(test));
|
|
631
632
|
const result = {
|
|
632
633
|
status: 'skip',
|
|
633
634
|
parentNames: test.parentNames,
|
|
@@ -658,7 +659,7 @@ export const __webpack_modules__ = {
|
|
|
658
659
|
status: 'fail',
|
|
659
660
|
parentNames: test.parentNames,
|
|
660
661
|
name: test.name,
|
|
661
|
-
errors: (0, runtime_util.
|
|
662
|
+
errors: (0, runtime_util.o9)(error, test),
|
|
662
663
|
testPath
|
|
663
664
|
};
|
|
664
665
|
}
|
|
@@ -702,7 +703,7 @@ export const __webpack_modules__ = {
|
|
|
702
703
|
status: 'fail',
|
|
703
704
|
parentNames: test.parentNames,
|
|
704
705
|
name: test.name,
|
|
705
|
-
errors: (0, runtime_util.
|
|
706
|
+
errors: (0, runtime_util.o9)(error, test),
|
|
706
707
|
testPath
|
|
707
708
|
};
|
|
708
709
|
}
|
|
@@ -714,7 +715,7 @@ export const __webpack_modules__ = {
|
|
|
714
715
|
} catch (error) {
|
|
715
716
|
result.status = 'fail';
|
|
716
717
|
result.errors ??= [];
|
|
717
|
-
result.errors.push(...(0, runtime_util.
|
|
718
|
+
result.errors.push(...(0, runtime_util.o9)(error));
|
|
718
719
|
}
|
|
719
720
|
this.resetCurrentTest();
|
|
720
721
|
return result;
|
|
@@ -781,7 +782,7 @@ export const __webpack_modules__ = {
|
|
|
781
782
|
}
|
|
782
783
|
} catch (error) {
|
|
783
784
|
hasBeforeAllError = true;
|
|
784
|
-
errors.push(...(0, runtime_util.
|
|
785
|
+
errors.push(...(0, runtime_util.o9)(error));
|
|
785
786
|
}
|
|
786
787
|
if (hasBeforeAllError) markAllTestAsSkipped(test.tests);
|
|
787
788
|
await runTests(test.tests, {
|
|
@@ -799,7 +800,7 @@ export const __webpack_modules__ = {
|
|
|
799
800
|
filepath: testPath
|
|
800
801
|
});
|
|
801
802
|
} catch (error) {
|
|
802
|
-
errors.push(...(0, runtime_util.
|
|
803
|
+
errors.push(...(0, runtime_util.o9)(error));
|
|
803
804
|
}
|
|
804
805
|
} else {
|
|
805
806
|
const start = RealDate.now();
|
|
@@ -896,7 +897,7 @@ export const __webpack_modules__ = {
|
|
|
896
897
|
return context;
|
|
897
898
|
}
|
|
898
899
|
async beforeRunTest(test, snapshotState) {
|
|
899
|
-
(0, dist.
|
|
900
|
+
(0, dist.wb)({
|
|
900
901
|
assertionCalls: 0,
|
|
901
902
|
isExpectingAssertions: false,
|
|
902
903
|
isExpectingAssertionsError: null,
|
|
@@ -904,8 +905,8 @@ export const __webpack_modules__ = {
|
|
|
904
905
|
expectedAssertionsNumberErrorGen: null,
|
|
905
906
|
testPath: test.testPath,
|
|
906
907
|
snapshotState,
|
|
907
|
-
currentTestName: (0, src_utils.
|
|
908
|
-
}, globalThis[dist.
|
|
908
|
+
currentTestName: (0, src_utils.fN)(test)
|
|
909
|
+
}, globalThis[dist.mZ]);
|
|
909
910
|
const context = this.createTestContext();
|
|
910
911
|
const { cleanups } = await handleFixtures(test, context);
|
|
911
912
|
Object.defineProperty(test, 'context', {
|
|
@@ -915,8 +916,8 @@ export const __webpack_modules__ = {
|
|
|
915
916
|
return cleanups;
|
|
916
917
|
}
|
|
917
918
|
afterRunTest(test) {
|
|
918
|
-
const expect = test.context._useLocalExpect ? test.context.expect : globalThis[dist.
|
|
919
|
-
const { assertionCalls, expectedAssertionsNumber, expectedAssertionsNumberErrorGen, isExpectingAssertions, isExpectingAssertionsError } = (0, dist.
|
|
919
|
+
const expect = test.context._useLocalExpect ? test.context.expect : globalThis[dist.mZ];
|
|
920
|
+
const { assertionCalls, expectedAssertionsNumber, expectedAssertionsNumberErrorGen, isExpectingAssertions, isExpectingAssertionsError } = (0, dist.Gu)(expect);
|
|
920
921
|
if (test.result?.state === 'fail') throw test.result.errors;
|
|
921
922
|
if (null !== expectedAssertionsNumber && assertionCalls !== expectedAssertionsNumber) throw expectedAssertionsNumberErrorGen();
|
|
922
923
|
if (true === isExpectingAssertions && 0 === assertionCalls) throw isExpectingAssertionsError;
|
|
@@ -939,7 +940,7 @@ export const __webpack_modules__ = {
|
|
|
939
940
|
}
|
|
940
941
|
checkStatus(name, type) {
|
|
941
942
|
if ('running' === this.status) {
|
|
942
|
-
const error = new runtime_util.
|
|
943
|
+
const error = new runtime_util.si(`${'case' === type ? 'Test' : 'Describe'} '${name}' cannot run`);
|
|
943
944
|
throw error;
|
|
944
945
|
}
|
|
945
946
|
}
|
|
@@ -983,7 +984,7 @@ export const __webpack_modules__ = {
|
|
|
983
984
|
return {
|
|
984
985
|
runMode: 'run',
|
|
985
986
|
testPath: this.testPath,
|
|
986
|
-
name: src_utils.
|
|
987
|
+
name: src_utils.q_,
|
|
987
988
|
tests: [],
|
|
988
989
|
type: 'suite'
|
|
989
990
|
};
|
|
@@ -1088,9 +1089,9 @@ export const __webpack_modules__ = {
|
|
|
1088
1089
|
return (name, fn)=>{
|
|
1089
1090
|
for(let i = 0; i < cases.length; i++){
|
|
1090
1091
|
const param = cases[i];
|
|
1091
|
-
const params = (0, src_utils.
|
|
1092
|
+
const params = (0, src_utils.bg)(param);
|
|
1092
1093
|
this.describe({
|
|
1093
|
-
name: (0, runtime_util.
|
|
1094
|
+
name: (0, runtime_util.nD)(name, param, i),
|
|
1094
1095
|
fn: ()=>fn?.(...params),
|
|
1095
1096
|
...options,
|
|
1096
1097
|
each: true
|
|
@@ -1103,7 +1104,7 @@ export const __webpack_modules__ = {
|
|
|
1103
1104
|
for(let i = 0; i < cases.length; i++){
|
|
1104
1105
|
const param = cases[i];
|
|
1105
1106
|
this.describe({
|
|
1106
|
-
name: (0, runtime_util.
|
|
1107
|
+
name: (0, runtime_util.nD)(name, param, i),
|
|
1107
1108
|
fn: ()=>fn?.(param),
|
|
1108
1109
|
...options,
|
|
1109
1110
|
each: true
|
|
@@ -1115,9 +1116,9 @@ export const __webpack_modules__ = {
|
|
|
1115
1116
|
return (name, fn, timeout = this.runtimeConfig.testTimeout)=>{
|
|
1116
1117
|
for(let i = 0; i < cases.length; i++){
|
|
1117
1118
|
const param = cases[i];
|
|
1118
|
-
const params = (0, src_utils.
|
|
1119
|
+
const params = (0, src_utils.bg)(param);
|
|
1119
1120
|
this.it({
|
|
1120
|
-
name: (0, runtime_util.
|
|
1121
|
+
name: (0, runtime_util.nD)(name, param, i),
|
|
1121
1122
|
originalFn: fn,
|
|
1122
1123
|
fn: ()=>fn?.(...params),
|
|
1123
1124
|
timeout,
|
|
@@ -1132,7 +1133,7 @@ export const __webpack_modules__ = {
|
|
|
1132
1133
|
for(let i = 0; i < cases.length; i++){
|
|
1133
1134
|
const param = cases[i];
|
|
1134
1135
|
this.it({
|
|
1135
|
-
name: (0, runtime_util.
|
|
1136
|
+
name: (0, runtime_util.nD)(name, param, i),
|
|
1136
1137
|
originalFn: fn,
|
|
1137
1138
|
fn: (context)=>fn?.(param, context),
|
|
1138
1139
|
timeout,
|
|
@@ -1446,7 +1447,7 @@ export const __webpack_modules__ = {
|
|
|
1446
1447
|
let callOrder = 0;
|
|
1447
1448
|
const mocks = new Set();
|
|
1448
1449
|
const wrapSpy = (obj, methodName, mockFn)=>{
|
|
1449
|
-
const spyImpl = (0, tinyspy_dist.
|
|
1450
|
+
const spyImpl = (0, tinyspy_dist.jo)(obj, methodName, mockFn);
|
|
1450
1451
|
const spyFn = spyImpl;
|
|
1451
1452
|
let mockImplementationOnce = [];
|
|
1452
1453
|
let implementation = mockFn;
|
|
@@ -1457,7 +1458,7 @@ export const __webpack_modules__ = {
|
|
|
1457
1458
|
invocationCallOrder: []
|
|
1458
1459
|
});
|
|
1459
1460
|
let mockState = initMockState();
|
|
1460
|
-
const spyState = (0, tinyspy_dist.
|
|
1461
|
+
const spyState = (0, tinyspy_dist.lf)(spyImpl);
|
|
1461
1462
|
spyFn.getMockName = ()=>mockName || methodName;
|
|
1462
1463
|
spyFn.mockName = (name)=>{
|
|
1463
1464
|
mockName = name;
|
|
@@ -1727,7 +1728,7 @@ export const __webpack_modules__ = {
|
|
|
1727
1728
|
workerState,
|
|
1728
1729
|
getCurrentTest: ()=>runner.getCurrentTest()
|
|
1729
1730
|
});
|
|
1730
|
-
Object.defineProperty(globalThis, dist.
|
|
1731
|
+
Object.defineProperty(globalThis, dist.mZ, {
|
|
1731
1732
|
value: expect,
|
|
1732
1733
|
writable: true,
|
|
1733
1734
|
configurable: true
|
|
@@ -1747,12 +1748,12 @@ export const __webpack_modules__ = {
|
|
|
1747
1748
|
},
|
|
1748
1749
|
"./src/utils/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1749
1750
|
__webpack_require__.d(__webpack_exports__, {
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1751
|
+
fN: ()=>helper.fN,
|
|
1752
|
+
Gv: ()=>helper.Gv,
|
|
1753
|
+
kV: ()=>helper.kV,
|
|
1754
|
+
q_: ()=>constants.q_,
|
|
1755
|
+
bg: ()=>helper.bg,
|
|
1756
|
+
yW: ()=>helper.yW
|
|
1756
1757
|
});
|
|
1757
1758
|
var constants = __webpack_require__("./src/utils/constants.ts");
|
|
1758
1759
|
var helper = __webpack_require__("./src/utils/helper.ts");
|
package/dist/{668.js → 928.js}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
/*! For license information please see
|
|
1
|
+
/*! For license information please see 928.js.LICENSE.txt */
|
|
2
2
|
import 'module';
|
|
3
3
|
/*#__PURE__*/ import.meta.url;
|
|
4
|
+
export const __webpack_id__ = "928";
|
|
4
5
|
export const __webpack_ids__ = [
|
|
5
|
-
"
|
|
6
|
+
"928"
|
|
6
7
|
];
|
|
7
8
|
export const __webpack_modules__ = {
|
|
8
9
|
"../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
package/dist/{25.js → 967.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "967";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"967"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"./src/core/restart.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -15,7 +16,7 @@ export const __webpack_modules__ = {
|
|
|
15
16
|
const GLOB_REGEX = /[*?{}[\]()!@+|]/;
|
|
16
17
|
const isGlob = (str)=>GLOB_REGEX.test(str);
|
|
17
18
|
async function createChokidar(pathOrGlobs, root, options) {
|
|
18
|
-
const chokidar = await __webpack_require__.e("
|
|
19
|
+
const chokidar = await __webpack_require__.e("928").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js"));
|
|
19
20
|
const watchFiles = new Set();
|
|
20
21
|
const globPatterns = pathOrGlobs.filter((pathOrGlob)=>{
|
|
21
22
|
if (isGlob(pathOrGlob)) return true;
|
|
@@ -37,14 +38,14 @@ export const __webpack_modules__ = {
|
|
|
37
38
|
cleaners.push(cleaner);
|
|
38
39
|
};
|
|
39
40
|
const clearConsole = ()=>{
|
|
40
|
-
if ((0, utils.
|
|
41
|
+
if ((0, utils.Un)() && !process.env.DEBUG) process.stdout.write('\x1B[H\x1B[2J');
|
|
41
42
|
};
|
|
42
43
|
const beforeRestart = async ({ filePath, clear = true })=>{
|
|
43
44
|
if (clear) clearConsole();
|
|
44
45
|
if (filePath) {
|
|
45
46
|
const filename = external_node_path_["default"].basename(filePath);
|
|
46
|
-
utils.
|
|
47
|
-
} else utils.
|
|
47
|
+
utils.vF.info(`restarting Rstest as ${utils.yW.yellow(filename)} changed\n`);
|
|
48
|
+
} else utils.vF.info('restarting Rstest...\n');
|
|
48
49
|
for (const cleaner of cleaners)await cleaner();
|
|
49
50
|
cleaners = [];
|
|
50
51
|
};
|
|
@@ -53,7 +54,7 @@ export const __webpack_modules__ = {
|
|
|
53
54
|
filePath,
|
|
54
55
|
clear
|
|
55
56
|
});
|
|
56
|
-
await (0, commands.
|
|
57
|
+
await (0, commands.a8)({
|
|
57
58
|
options,
|
|
58
59
|
filters,
|
|
59
60
|
command: 'watch'
|
|
@@ -80,7 +81,7 @@ export const __webpack_modules__ = {
|
|
|
80
81
|
filePath
|
|
81
82
|
});
|
|
82
83
|
if (restarted) await watcher.close();
|
|
83
|
-
else utils.
|
|
84
|
+
else utils.vF.error('Restart failed');
|
|
84
85
|
restarting = false;
|
|
85
86
|
};
|
|
86
87
|
watcher.on('add', onChange);
|
package/dist/{64.js → 969.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "969";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"969"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"../../node_modules/.pnpm/buffer-from@1.1.2/node_modules/buffer-from/index.js": function(module) {
|
package/dist/{285.js → 971.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "971";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"971"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"./src/core/listTests.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -15,7 +16,7 @@ export const __webpack_modules__ = {
|
|
|
15
16
|
var _rsbuild__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./src/core/rsbuild.ts");
|
|
16
17
|
async function listTests(context, { filesOnly, json }) {
|
|
17
18
|
const { normalizedConfig: { include, exclude, root, name, setupFiles: setups, includeSource }, rootPath } = context;
|
|
18
|
-
const testEntries = await (0, _utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
19
|
+
const testEntries = await (0, _utils__WEBPACK_IMPORTED_MODULE_3__.tG)({
|
|
19
20
|
include,
|
|
20
21
|
exclude,
|
|
21
22
|
root,
|
|
@@ -23,9 +24,9 @@ export const __webpack_modules__ = {
|
|
|
23
24
|
includeSource
|
|
24
25
|
});
|
|
25
26
|
const globTestSourceEntries = async ()=>testEntries;
|
|
26
|
-
const setupFiles = (0, _utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
27
|
+
const setupFiles = (0, _utils__WEBPACK_IMPORTED_MODULE_3__.pr)(setups, rootPath);
|
|
27
28
|
const rsbuildInstance = await (0, _rsbuild__WEBPACK_IMPORTED_MODULE_4__.z)(context, globTestSourceEntries, setupFiles);
|
|
28
|
-
const { getRsbuildStats, closeServer } = await (0, _rsbuild__WEBPACK_IMPORTED_MODULE_4__.
|
|
29
|
+
const { getRsbuildStats, closeServer } = await (0, _rsbuild__WEBPACK_IMPORTED_MODULE_4__.X)({
|
|
29
30
|
name,
|
|
30
31
|
globTestSourceEntries,
|
|
31
32
|
normalizedConfig: context.normalizedConfig,
|
|
@@ -34,7 +35,7 @@ export const __webpack_modules__ = {
|
|
|
34
35
|
rootPath
|
|
35
36
|
});
|
|
36
37
|
const { entries, setupEntries, assetFiles, sourceMaps, getSourcemap } = await getRsbuildStats();
|
|
37
|
-
const pool = await (0, _pool__WEBPACK_IMPORTED_MODULE_2__.
|
|
38
|
+
const pool = await (0, _pool__WEBPACK_IMPORTED_MODULE_2__.b)({
|
|
38
39
|
context
|
|
39
40
|
});
|
|
40
41
|
const list = await pool.collectTests({
|
|
@@ -53,21 +54,21 @@ export const __webpack_modules__ = {
|
|
|
53
54
|
].includes(test.runMode)) return;
|
|
54
55
|
if ('case' === test.type) tests.push({
|
|
55
56
|
file: test.testPath,
|
|
56
|
-
name: (0, _utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
57
|
+
name: (0, _utils__WEBPACK_IMPORTED_MODULE_3__.fN)(test)
|
|
57
58
|
});
|
|
58
59
|
else for (const child of test.tests)traverseTests(child);
|
|
59
60
|
};
|
|
60
61
|
const hasError = list.some((file)=>file.errors?.length);
|
|
61
62
|
if (hasError) {
|
|
62
63
|
const { printError } = await Promise.all([
|
|
63
|
-
__webpack_require__.e("
|
|
64
|
-
__webpack_require__.e("
|
|
64
|
+
__webpack_require__.e("829"),
|
|
65
|
+
__webpack_require__.e("704")
|
|
65
66
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/utils/error.ts"));
|
|
66
67
|
process.exitCode = 1;
|
|
67
68
|
for (const file of list){
|
|
68
69
|
const relativePath = (0, node_path__WEBPACK_IMPORTED_MODULE_1__.relative)(rootPath, file.testPath);
|
|
69
70
|
if (file.errors?.length) {
|
|
70
|
-
_utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
71
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.vF.log(`${_utils__WEBPACK_IMPORTED_MODULE_3__.yW.bgRed(' FAIL ')} ${relativePath}`);
|
|
71
72
|
for (const error of file.errors)await printError(error, getSourcemap, rootPath);
|
|
72
73
|
}
|
|
73
74
|
}
|
|
@@ -92,10 +93,10 @@ export const __webpack_modules__ = {
|
|
|
92
93
|
recursive: true
|
|
93
94
|
});
|
|
94
95
|
(0, node_fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync)(jsonPath, content);
|
|
95
|
-
} else _utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
96
|
+
} else _utils__WEBPACK_IMPORTED_MODULE_3__.vF.log(content);
|
|
96
97
|
} else for (const test of tests){
|
|
97
98
|
const shortPath = (0, node_path__WEBPACK_IMPORTED_MODULE_1__.relative)(rootPath, test.file);
|
|
98
|
-
_utils__WEBPACK_IMPORTED_MODULE_3__.
|
|
99
|
+
_utils__WEBPACK_IMPORTED_MODULE_3__.vF.log(test.name ? `${_utils__WEBPACK_IMPORTED_MODULE_3__.yW.dim(`${shortPath} > `)}${test.name}` : (0, _utils__WEBPACK_IMPORTED_MODULE_3__.EQ)(shortPath));
|
|
99
100
|
}
|
|
100
101
|
await closeServer();
|
|
101
102
|
await pool.close();
|
package/dist/{854.js → 985.js}
RENAMED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
export const __webpack_id__ = "985";
|
|
3
4
|
export const __webpack_ids__ = [
|
|
4
|
-
"
|
|
5
|
+
"985"
|
|
5
6
|
];
|
|
6
7
|
export const __webpack_modules__ = {
|
|
7
8
|
"./src/core/rsbuild.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8
9
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
-
|
|
10
|
+
X: ()=>createRsbuildServer,
|
|
10
11
|
z: ()=>prepareRsbuild
|
|
11
12
|
});
|
|
12
13
|
var core_ = __webpack_require__("@rsbuild/core");
|
|
@@ -36,7 +37,7 @@ export const __webpack_modules__ = {
|
|
|
36
37
|
js: 'source-map'
|
|
37
38
|
},
|
|
38
39
|
distPath: {
|
|
39
|
-
root: utils.
|
|
40
|
+
root: utils.zZ
|
|
40
41
|
}
|
|
41
42
|
},
|
|
42
43
|
tools: {
|
|
@@ -155,9 +156,9 @@ export const __webpack_modules__ = {
|
|
|
155
156
|
};
|
|
156
157
|
};
|
|
157
158
|
config.watchOptions ??= {};
|
|
158
|
-
config.watchOptions.ignored = (0, utils.
|
|
159
|
+
config.watchOptions.ignored = (0, utils.bg)(config.watchOptions.ignored || []);
|
|
159
160
|
if (0 === config.watchOptions.ignored.length) config.watchOptions.ignored.push('**/.git', '**/node_modules');
|
|
160
|
-
config.watchOptions.ignored.push(utils.
|
|
161
|
+
config.watchOptions.ignored.push(utils.EJ, '**/*.snap');
|
|
161
162
|
if (configFilePath) config.watchOptions.ignored.push(configFilePath);
|
|
162
163
|
} else {
|
|
163
164
|
config.watch = false;
|
|
@@ -188,7 +189,7 @@ export const __webpack_modules__ = {
|
|
|
188
189
|
};
|
|
189
190
|
function autoExternalNodeBuiltin({ request, dependencyType }, callback) {
|
|
190
191
|
if (!request) return void callback();
|
|
191
|
-
const isNodeBuiltin = utils.
|
|
192
|
+
const isNodeBuiltin = utils.Kv.some((builtin)=>{
|
|
192
193
|
if ('string' == typeof builtin) return builtin === request;
|
|
193
194
|
return builtin.test(request);
|
|
194
195
|
});
|
|
@@ -206,7 +207,7 @@ export const __webpack_modules__ = {
|
|
|
206
207
|
},
|
|
207
208
|
tools: {
|
|
208
209
|
rspack: (config)=>{
|
|
209
|
-
config.externals = (0, utils.
|
|
210
|
+
config.externals = (0, utils.bg)(config.externals) || [];
|
|
210
211
|
config.externals.unshift({
|
|
211
212
|
'@rstest/core': 'global @rstest/core'
|
|
212
213
|
});
|
|
@@ -444,7 +445,7 @@ global.__rstest_clean_core_cache__ = __rstest_clean_core_cache__;
|
|
|
444
445
|
const isMultiCompiler = (compiler)=>'compilers' in compiler && Array.isArray(compiler.compilers);
|
|
445
446
|
const prepareRsbuild = async (context, globTestSourceEntries, setupFiles)=>{
|
|
446
447
|
const { command, normalizedConfig: { isolate, plugins, resolve, source, output, tools, testEnvironment, performance, dev = {} } } = context;
|
|
447
|
-
const debugMode = (0, utils.
|
|
448
|
+
const debugMode = (0, utils._o)();
|
|
448
449
|
core_.logger.level = debugMode ? 'verbose' : 'error';
|
|
449
450
|
const writeToDisk = dev.writeToDisk || debugMode;
|
|
450
451
|
const rsbuildInstance = await (0, core_.createRsbuild)({
|
|
@@ -503,7 +504,7 @@ global.__rstest_clean_core_cache__ = __rstest_clean_core_cache__;
|
|
|
503
504
|
const devServer = await rsbuildInstance.createDevServer({
|
|
504
505
|
getPortSilently: true
|
|
505
506
|
});
|
|
506
|
-
if ((0, utils.
|
|
507
|
+
if ((0, utils._o)()) await rsbuildInstance.inspectConfig({
|
|
507
508
|
writeToDisk: true,
|
|
508
509
|
extraConfigs: {
|
|
509
510
|
rstest: normalizedConfig
|
|
@@ -609,7 +610,7 @@ global.__rstest_clean_core_cache__ = __rstest_clean_core_cache__;
|
|
|
609
610
|
},
|
|
610
611
|
"./src/pool/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
611
612
|
__webpack_require__.d(__webpack_exports__, {
|
|
612
|
-
|
|
613
|
+
b: ()=>createPool
|
|
613
614
|
});
|
|
614
615
|
var external_node_os_ = __webpack_require__("node:os");
|
|
615
616
|
var utils = __webpack_require__("./src/utils/index.ts");
|
|
@@ -748,7 +749,7 @@ global.__rstest_clean_core_cache__ = __rstest_clean_core_cache__;
|
|
|
748
749
|
'--experimental-vm-modules',
|
|
749
750
|
'--experimental-import-meta-resolve',
|
|
750
751
|
'--no-warnings',
|
|
751
|
-
(0, utils.
|
|
752
|
+
(0, utils.C3)() ? '--experimental-detect-module' : void 0
|
|
752
753
|
].filter(Boolean),
|
|
753
754
|
env: {
|
|
754
755
|
NODE_ENV: 'test',
|
|
@@ -783,7 +784,7 @@ global.__rstest_clean_core_cache__ = __rstest_clean_core_cache__;
|
|
|
783
784
|
assetFiles: neededFiles,
|
|
784
785
|
context: {
|
|
785
786
|
rootPath: context.rootPath,
|
|
786
|
-
runtimeConfig: (0, utils.
|
|
787
|
+
runtimeConfig: (0, utils.Ok)(runtimeConfig)
|
|
787
788
|
},
|
|
788
789
|
type: 'run',
|
|
789
790
|
sourceMaps: neededSourceMaps,
|
|
@@ -823,7 +824,7 @@ global.__rstest_clean_core_cache__ = __rstest_clean_core_cache__;
|
|
|
823
824
|
assetFiles: neededFiles,
|
|
824
825
|
context: {
|
|
825
826
|
rootPath: context.rootPath,
|
|
826
|
-
runtimeConfig: (0, utils.
|
|
827
|
+
runtimeConfig: (0, utils.Ok)(runtimeConfig)
|
|
827
828
|
},
|
|
828
829
|
type: 'collect',
|
|
829
830
|
sourceMaps: neededSourceMaps,
|