@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
|
@@ -135,28 +135,6 @@
|
|
|
135
135
|
* MIT Licensed
|
|
136
136
|
*/
|
|
137
137
|
|
|
138
|
-
/*!
|
|
139
|
-
* Copyright 2017 Vercel, Inc.
|
|
140
|
-
*
|
|
141
|
-
* This file is derived from Vercel's detect-agent:
|
|
142
|
-
* https://github.com/vercel/vercel/tree/main/packages/detect-agent
|
|
143
|
-
*
|
|
144
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
145
|
-
* you may not use this file except in compliance with the License.
|
|
146
|
-
* You may obtain a copy of the License at
|
|
147
|
-
*
|
|
148
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
149
|
-
*
|
|
150
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
151
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
152
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
153
|
-
* See the License for the specific language governing permissions and
|
|
154
|
-
* limitations under the License.
|
|
155
|
-
*
|
|
156
|
-
* Modifications in this derived work:
|
|
157
|
-
* - Removed async determine logic, kept only env detection.
|
|
158
|
-
*/
|
|
159
|
-
|
|
160
138
|
/*!
|
|
161
139
|
* The buffer module from node.js, for the browser.
|
|
162
140
|
*
|
|
@@ -281,6 +281,14 @@ export declare const beforeEach: Rstest['beforeEach'];
|
|
|
281
281
|
|
|
282
282
|
declare type BeforeEachListener = (ctx: TestContext) => MaybePromise<void | AfterEachListener>;
|
|
283
283
|
|
|
284
|
+
declare type BlobReporterOptions = {
|
|
285
|
+
/**
|
|
286
|
+
* Directory to store blob report files.
|
|
287
|
+
* @default '.rstest-reports'
|
|
288
|
+
*/
|
|
289
|
+
outputDir?: string;
|
|
290
|
+
};
|
|
291
|
+
|
|
284
292
|
declare interface BranchMapping {
|
|
285
293
|
loc: Range_2;
|
|
286
294
|
type: string;
|
|
@@ -331,6 +339,13 @@ declare type BrowserModeConfig = {
|
|
|
331
339
|
* @default false
|
|
332
340
|
*/
|
|
333
341
|
strictPort?: boolean;
|
|
342
|
+
/**
|
|
343
|
+
* Provider-specific config passed through to the selected browser provider.
|
|
344
|
+
*
|
|
345
|
+
* Use provider-owned types or helpers in user config when you want richer
|
|
346
|
+
* IntelliSense for this field.
|
|
347
|
+
*/
|
|
348
|
+
providerOptions?: Record<string, unknown>;
|
|
334
349
|
};
|
|
335
350
|
|
|
336
351
|
/**
|
|
@@ -347,7 +362,7 @@ declare type BrowserViewport = {
|
|
|
347
362
|
height: number;
|
|
348
363
|
} | DevicePreset;
|
|
349
364
|
|
|
350
|
-
declare type BuiltInReporterNames = 'default' | 'verbose' | 'md' | 'github-actions' | 'junit';
|
|
365
|
+
declare type BuiltInReporterNames = 'default' | 'verbose' | 'md' | 'github-actions' | 'junit' | 'blob';
|
|
351
366
|
|
|
352
367
|
declare type BuiltinReporterOptions = {
|
|
353
368
|
default: DefaultReporterOptions;
|
|
@@ -355,6 +370,7 @@ declare type BuiltinReporterOptions = {
|
|
|
355
370
|
md: MdReporterOptions;
|
|
356
371
|
'github-actions': Record<string, unknown>;
|
|
357
372
|
junit: Record<string, unknown>;
|
|
373
|
+
blob: BlobReporterOptions;
|
|
358
374
|
};
|
|
359
375
|
|
|
360
376
|
declare type ChaiConfig = Partial<Omit<typeof config, 'useProxy' | 'proxyExcludedKeys' | 'deepEqual'>>;
|
|
@@ -509,6 +525,12 @@ declare type CoverageOptions = {
|
|
|
509
525
|
* @default false
|
|
510
526
|
*/
|
|
511
527
|
reportOnFailure?: boolean;
|
|
528
|
+
/**
|
|
529
|
+
* Whether to collect coverage for source files outside the project root directory.
|
|
530
|
+
* This is useful in monorepo setups where tests import modules from sibling packages.
|
|
531
|
+
* @default false
|
|
532
|
+
*/
|
|
533
|
+
allowExternal?: boolean;
|
|
512
534
|
};
|
|
513
535
|
|
|
514
536
|
declare class CoverageSummary {
|
|
@@ -638,11 +660,15 @@ declare interface DescribeEachFn {
|
|
|
638
660
|
<T extends Record<string, unknown>>(cases: readonly T[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
639
661
|
<T extends readonly [unknown, ...unknown[]]>(cases: readonly T[]): (description: string, fn: (...args: [...T]) => MaybePromise<void>) => void;
|
|
640
662
|
<T>(cases: readonly T[]): (description: string, fn: (param: T) => MaybePromise<void>) => void;
|
|
663
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
641
664
|
}
|
|
642
665
|
|
|
643
666
|
declare type DescribeFn = (description: string, fn?: () => void) => void;
|
|
644
667
|
|
|
645
|
-
declare
|
|
668
|
+
declare interface DescribeForFn {
|
|
669
|
+
<T>(cases: readonly T[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
670
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
671
|
+
}
|
|
646
672
|
|
|
647
673
|
/**
|
|
648
674
|
* Device presets aligned with Chrome DevTools device toolbar.
|
|
@@ -1713,6 +1739,7 @@ declare type NormalizedBrowserModeConfig = {
|
|
|
1713
1739
|
port?: number;
|
|
1714
1740
|
strictPort: boolean;
|
|
1715
1741
|
viewport?: BrowserViewport;
|
|
1742
|
+
providerOptions: Record<string, unknown>;
|
|
1716
1743
|
};
|
|
1717
1744
|
|
|
1718
1745
|
declare type NormalizedConfig = Required<Omit<RstestConfig, OptionalKeys | 'pool' | 'projects' | 'coverage' | 'setupFiles' | 'globalSetup' | 'exclude' | 'testEnvironment' | 'browser'>> & Partial<Pick<RstestConfig, OptionalKeys>> & {
|
|
@@ -1939,13 +1966,13 @@ declare type Rstest = RunnerAPI & {
|
|
|
1939
1966
|
|
|
1940
1967
|
export declare const rstest: RstestUtilities;
|
|
1941
1968
|
|
|
1942
|
-
declare type RstestCommand = 'watch' | 'run' | 'list';
|
|
1969
|
+
declare type RstestCommand = 'watch' | 'run' | 'list' | 'merge-reports';
|
|
1943
1970
|
|
|
1944
1971
|
declare interface RstestConfig {
|
|
1945
1972
|
/**
|
|
1946
1973
|
* Extend configuration from adapters
|
|
1947
1974
|
*/
|
|
1948
|
-
extends?: ExtendConfigFn | ExtendConfig;
|
|
1975
|
+
extends?: ExtendConfigFn | ExtendConfig | (ExtendConfigFn | ExtendConfig)[];
|
|
1949
1976
|
/**
|
|
1950
1977
|
* Project root
|
|
1951
1978
|
*
|
|
@@ -2204,6 +2231,10 @@ declare type RstestContext = {
|
|
|
2204
2231
|
reporters: Reporter[];
|
|
2205
2232
|
snapshotManager: SnapshotManager;
|
|
2206
2233
|
stateManager: TestStateManager;
|
|
2234
|
+
reporterResults: {
|
|
2235
|
+
results: TestFileResult[];
|
|
2236
|
+
testResults: TestResult[];
|
|
2237
|
+
};
|
|
2207
2238
|
};
|
|
2208
2239
|
|
|
2209
2240
|
declare type RstestExpect = ExpectStatic;
|
|
@@ -2810,6 +2841,7 @@ declare interface TestEachFn {
|
|
|
2810
2841
|
<T extends Record<string, unknown>>(cases: readonly T[]): (description: string, fn?: (param: T) => MaybePromise<void>, timeout?: number) => void;
|
|
2811
2842
|
<T extends readonly [unknown, ...unknown[]]>(cases: readonly T[]): (description: string, fn: (...args: [...T]) => MaybePromise<void>, timeout?: number) => void;
|
|
2812
2843
|
<T>(cases: readonly T[]): (description: string, fn: (...args: T[]) => MaybePromise<void>, timeout?: number) => void;
|
|
2844
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T) => MaybePromise<void>, timeout?: number) => void;
|
|
2813
2845
|
}
|
|
2814
2846
|
|
|
2815
2847
|
declare type Tester = (this: TesterContext, a: any, b: any, customTesters: Array<Tester>) => boolean | undefined;
|
|
@@ -2831,7 +2863,10 @@ export declare type TestFileResult = TestResult & {
|
|
|
2831
2863
|
|
|
2832
2864
|
declare type TestFn<ExtraContext = object> = (description: string, fn?: TestCallbackFn<ExtraContext>, timeout?: number) => void;
|
|
2833
2865
|
|
|
2834
|
-
declare
|
|
2866
|
+
declare interface TestForFn<ExtraContext = object> {
|
|
2867
|
+
<T>(cases: readonly T[]): (description: string, fn?: (param: T, context: TestContext & ExtraContext) => MaybePromise<void>, timeout?: number) => void;
|
|
2868
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T, context: TestContext & ExtraContext) => MaybePromise<void>, timeout?: number) => void;
|
|
2869
|
+
}
|
|
2835
2870
|
|
|
2836
2871
|
export declare type TestInfo = TestCaseInfo | (TestSuiteInfo & {
|
|
2837
2872
|
tests: TestInfo[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { afterAll, afterEach, assert, beforeAll, beforeEach, createRstestRuntime, describe, expect, globalApis, it, onTestFailed, onTestFinished, rs, rstest, setRealTimers, test } from "./
|
|
1
|
+
export { afterAll, afterEach, assert, beforeAll, beforeEach, createRstestRuntime, describe, expect, globalApis, it, onTestFailed, onTestFinished, rs, rstest, setRealTimers, test } from "./723.js";
|
|
@@ -4,15 +4,20 @@ function __webpack_require__(moduleId) {
|
|
|
4
4
|
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
5
|
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
6
|
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
-
id: moduleId,
|
|
8
|
-
loaded: false,
|
|
9
7
|
exports: {}
|
|
10
8
|
};
|
|
11
9
|
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
12
|
-
module.loaded = true;
|
|
13
10
|
return module.exports;
|
|
14
11
|
}
|
|
15
12
|
__webpack_require__.m = __webpack_modules__;
|
|
13
|
+
(()=>{
|
|
14
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
15
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: definition[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
})();
|
|
16
21
|
(()=>{
|
|
17
22
|
__webpack_require__.add = function registerModules(modules) {
|
|
18
23
|
Object.assign(__webpack_require__.m, modules);
|
|
@@ -28,6 +33,9 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
28
33
|
}
|
|
29
34
|
})();
|
|
30
35
|
})();
|
|
36
|
+
(()=>{
|
|
37
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
38
|
+
})();
|
|
31
39
|
(()=>{
|
|
32
40
|
__webpack_require__.r = (exports)=>{
|
|
33
41
|
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
package/dist/browser.d.ts
CHANGED
|
@@ -277,6 +277,14 @@ export declare const beforeEach: Rstest_2['beforeEach'];
|
|
|
277
277
|
|
|
278
278
|
declare type BeforeEachListener = (ctx: TestContext) => MaybePromise<void | AfterEachListener>;
|
|
279
279
|
|
|
280
|
+
declare type BlobReporterOptions = {
|
|
281
|
+
/**
|
|
282
|
+
* Directory to store blob report files.
|
|
283
|
+
* @default '.rstest-reports'
|
|
284
|
+
*/
|
|
285
|
+
outputDir?: string;
|
|
286
|
+
};
|
|
287
|
+
|
|
280
288
|
declare interface BranchMapping {
|
|
281
289
|
loc: Range_2;
|
|
282
290
|
type: string;
|
|
@@ -327,6 +335,13 @@ declare type BrowserModeConfig = {
|
|
|
327
335
|
* @default false
|
|
328
336
|
*/
|
|
329
337
|
strictPort?: boolean;
|
|
338
|
+
/**
|
|
339
|
+
* Provider-specific config passed through to the selected browser provider.
|
|
340
|
+
*
|
|
341
|
+
* Use provider-owned types or helpers in user config when you want richer
|
|
342
|
+
* IntelliSense for this field.
|
|
343
|
+
*/
|
|
344
|
+
providerOptions?: Record<string, unknown>;
|
|
330
345
|
};
|
|
331
346
|
|
|
332
347
|
/**
|
|
@@ -393,7 +408,7 @@ declare type BrowserViewport = {
|
|
|
393
408
|
height: number;
|
|
394
409
|
} | DevicePreset;
|
|
395
410
|
|
|
396
|
-
declare type BuiltInReporterNames = 'default' | 'verbose' | 'md' | 'github-actions' | 'junit';
|
|
411
|
+
declare type BuiltInReporterNames = 'default' | 'verbose' | 'md' | 'github-actions' | 'junit' | 'blob';
|
|
397
412
|
|
|
398
413
|
declare type BuiltinReporterOptions = {
|
|
399
414
|
default: DefaultReporterOptions;
|
|
@@ -401,6 +416,7 @@ declare type BuiltinReporterOptions = {
|
|
|
401
416
|
md: MdReporterOptions;
|
|
402
417
|
'github-actions': Record<string, unknown>;
|
|
403
418
|
junit: Record<string, unknown>;
|
|
419
|
+
blob: BlobReporterOptions;
|
|
404
420
|
};
|
|
405
421
|
|
|
406
422
|
declare type ChaiConfig = Partial<Omit<typeof config, 'useProxy' | 'proxyExcludedKeys' | 'deepEqual'>>;
|
|
@@ -624,6 +640,12 @@ declare type CoverageOptions = {
|
|
|
624
640
|
* @default false
|
|
625
641
|
*/
|
|
626
642
|
reportOnFailure?: boolean;
|
|
643
|
+
/**
|
|
644
|
+
* Whether to collect coverage for source files outside the project root directory.
|
|
645
|
+
* This is useful in monorepo setups where tests import modules from sibling packages.
|
|
646
|
+
* @default false
|
|
647
|
+
*/
|
|
648
|
+
allowExternal?: boolean;
|
|
627
649
|
};
|
|
628
650
|
|
|
629
651
|
declare class CoverageProvider {
|
|
@@ -784,11 +806,15 @@ declare interface DescribeEachFn {
|
|
|
784
806
|
<T extends Record<string, unknown>>(cases: readonly T[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
785
807
|
<T extends readonly [unknown, ...unknown[]]>(cases: readonly T[]): (description: string, fn: (...args: [...T]) => MaybePromise<void>) => void;
|
|
786
808
|
<T>(cases: readonly T[]): (description: string, fn: (param: T) => MaybePromise<void>) => void;
|
|
809
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
787
810
|
}
|
|
788
811
|
|
|
789
812
|
declare type DescribeFn = (description: string, fn?: () => void) => void;
|
|
790
813
|
|
|
791
|
-
declare
|
|
814
|
+
declare interface DescribeForFn {
|
|
815
|
+
<T>(cases: readonly T[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
816
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
817
|
+
}
|
|
792
818
|
|
|
793
819
|
/**
|
|
794
820
|
* Device presets aligned with Chrome DevTools device toolbar.
|
|
@@ -2241,6 +2267,7 @@ declare type NormalizedBrowserModeConfig = {
|
|
|
2241
2267
|
port?: number;
|
|
2242
2268
|
strictPort: boolean;
|
|
2243
2269
|
viewport?: BrowserViewport;
|
|
2270
|
+
providerOptions: Record<string, unknown>;
|
|
2244
2271
|
};
|
|
2245
2272
|
|
|
2246
2273
|
declare type NormalizedConfig = Required<Omit<RstestConfig, OptionalKeys | 'pool' | 'projects' | 'coverage' | 'setupFiles' | 'globalSetup' | 'exclude' | 'testEnvironment' | 'browser'>> & Partial<Pick<RstestConfig, OptionalKeys>> & {
|
|
@@ -2550,13 +2577,13 @@ declare type Rstest_2 = RunnerAPI & {
|
|
|
2550
2577
|
rs: RstestUtilities;
|
|
2551
2578
|
};
|
|
2552
2579
|
|
|
2553
|
-
declare type RstestCommand = 'watch' | 'run' | 'list';
|
|
2580
|
+
declare type RstestCommand = 'watch' | 'run' | 'list' | 'merge-reports';
|
|
2554
2581
|
|
|
2555
2582
|
declare interface RstestConfig {
|
|
2556
2583
|
/**
|
|
2557
2584
|
* Extend configuration from adapters
|
|
2558
2585
|
*/
|
|
2559
|
-
extends?: ExtendConfigFn | ExtendConfig;
|
|
2586
|
+
extends?: ExtendConfigFn | ExtendConfig | (ExtendConfigFn | ExtendConfig)[];
|
|
2560
2587
|
/**
|
|
2561
2588
|
* Project root
|
|
2562
2589
|
*
|
|
@@ -2815,6 +2842,10 @@ declare type RstestContext = {
|
|
|
2815
2842
|
reporters: Reporter[];
|
|
2816
2843
|
snapshotManager: SnapshotManager;
|
|
2817
2844
|
stateManager: TestStateManager;
|
|
2845
|
+
reporterResults: {
|
|
2846
|
+
results: TestFileResult[];
|
|
2847
|
+
testResults: TestResult[];
|
|
2848
|
+
};
|
|
2818
2849
|
};
|
|
2819
2850
|
|
|
2820
2851
|
declare type RstestExpect = ExpectStatic;
|
|
@@ -3437,6 +3468,7 @@ declare interface TestEachFn {
|
|
|
3437
3468
|
<T extends Record<string, unknown>>(cases: readonly T[]): (description: string, fn?: (param: T) => MaybePromise<void>, timeout?: number) => void;
|
|
3438
3469
|
<T extends readonly [unknown, ...unknown[]]>(cases: readonly T[]): (description: string, fn: (...args: [...T]) => MaybePromise<void>, timeout?: number) => void;
|
|
3439
3470
|
<T>(cases: readonly T[]): (description: string, fn: (...args: T[]) => MaybePromise<void>, timeout?: number) => void;
|
|
3471
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T) => MaybePromise<void>, timeout?: number) => void;
|
|
3440
3472
|
}
|
|
3441
3473
|
|
|
3442
3474
|
declare type Tester = (this: TesterContext, a: any, b: any, customTesters: Array<Tester>) => boolean | undefined;
|
|
@@ -3458,7 +3490,10 @@ export declare type TestFileResult = TestResult & {
|
|
|
3458
3490
|
|
|
3459
3491
|
declare type TestFn<ExtraContext = object> = (description: string, fn?: TestCallbackFn<ExtraContext>, timeout?: number) => void;
|
|
3460
3492
|
|
|
3461
|
-
declare
|
|
3493
|
+
declare interface TestForFn<ExtraContext = object> {
|
|
3494
|
+
<T>(cases: readonly T[]): (description: string, fn?: (param: T, context: TestContext & ExtraContext) => MaybePromise<void>, timeout?: number) => void;
|
|
3495
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T, context: TestContext & ExtraContext) => MaybePromise<void>, timeout?: number) => void;
|
|
3496
|
+
}
|
|
3462
3497
|
|
|
3463
3498
|
declare type TestInfo = TestCaseInfo | (TestSuiteInfo & {
|
|
3464
3499
|
tests: TestInfo[];
|
package/dist/browser.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
2
|
+
import * as __rspack_external__rsbuild_core_1b356efc from "@rsbuild/core";
|
|
3
|
+
export { TEMP_RSTEST_OUTPUT_DIR, getTestEntries, globalApis } from "./4411.js";
|
|
4
|
+
export { afterAll, afterEach, assert, beforeAll, beforeEach, describe, expect, it, onTestFailed, onTestFinished, rs, rstest, test } from "./5040.js";
|
|
5
|
+
export { color, isDebug, logger, serializableConfig } from "./6830.js";
|
|
6
|
+
export { createRstestRuntime } from "./1949.js";
|
|
7
|
+
export { getSetupFiles } from "./255.js";
|
|
8
|
+
export { loadCoverageProvider } from "./7704.js";
|
|
9
|
+
export { setRealTimers } from "./7552.js";
|
|
10
|
+
export { __rspack_external__rsbuild_core_1b356efc as rsbuild };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
|
-
import "./
|
|
4
|
-
import { color } from "./
|
|
5
|
-
import { formatTestError } from "./
|
|
3
|
+
import "./1255.js";
|
|
4
|
+
import { color as logger_color } from "./6830.js";
|
|
5
|
+
import { formatTestError } from "./7552.js";
|
|
6
6
|
const source_map_support = __webpack_require__("../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js");
|
|
7
7
|
let teardownCallbacks = [];
|
|
8
8
|
let initialEnv = {};
|
|
@@ -39,16 +39,7 @@ const runGlobalSetup = async (data)=>{
|
|
|
39
39
|
for (const entry of data.entries){
|
|
40
40
|
const { distPath, testPath } = entry;
|
|
41
41
|
const setupCodeContent = data.assetFiles[distPath];
|
|
42
|
-
const { loadModule } = data.outputModule ? await import("./0~
|
|
43
|
-
EsmMode: mod.loadEsModule_EsmMode,
|
|
44
|
-
asModule: mod.asModule,
|
|
45
|
-
clearModuleCache: mod.clearModuleCache,
|
|
46
|
-
loadModule: mod.loadModule
|
|
47
|
-
})) : await import("./0~5835.js").then((mod)=>({
|
|
48
|
-
cacheableLoadModule: mod.cacheableLoadModule,
|
|
49
|
-
clearModuleCache: mod.clearModuleCache,
|
|
50
|
-
loadModule: mod.loadModule
|
|
51
|
-
}));
|
|
42
|
+
const { loadModule } = data.outputModule ? await import("./0~loadEsModule.js") : await import("./0~loadModule.js");
|
|
52
43
|
const module = await loadModule({
|
|
53
44
|
codeContent: setupCodeContent,
|
|
54
45
|
distPath,
|
|
@@ -91,6 +82,8 @@ async function runInPool(options) {
|
|
|
91
82
|
return runGlobalSetup(options);
|
|
92
83
|
case 'teardown':
|
|
93
84
|
return runGlobalTeardown();
|
|
85
|
+
default:
|
|
86
|
+
throw new Error(`Unknown worker type: ${options.type}`);
|
|
94
87
|
}
|
|
95
88
|
}
|
|
96
89
|
const runGlobalTeardown = async ()=>{
|
|
@@ -105,7 +98,7 @@ const runGlobalTeardown = async ()=>{
|
|
|
105
98
|
};
|
|
106
99
|
} catch (error) {
|
|
107
100
|
const message = error instanceof Error && error.stack ? error.stack : String(error);
|
|
108
|
-
console.error(
|
|
101
|
+
console.error(logger_color.red(`Error during global teardown: ${message}`));
|
|
109
102
|
return {
|
|
110
103
|
success: false
|
|
111
104
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -258,6 +258,14 @@ export declare const beforeEach: Rstest['beforeEach'];
|
|
|
258
258
|
|
|
259
259
|
declare type BeforeEachListener = (ctx: TestContext) => MaybePromise<void | AfterEachListener>;
|
|
260
260
|
|
|
261
|
+
declare type BlobReporterOptions = {
|
|
262
|
+
/**
|
|
263
|
+
* Directory to store blob report files.
|
|
264
|
+
* @default '.rstest-reports'
|
|
265
|
+
*/
|
|
266
|
+
outputDir?: string;
|
|
267
|
+
};
|
|
268
|
+
|
|
261
269
|
declare interface BranchMapping {
|
|
262
270
|
loc: Range_2;
|
|
263
271
|
type: string;
|
|
@@ -308,6 +316,13 @@ declare type BrowserModeConfig = {
|
|
|
308
316
|
* @default false
|
|
309
317
|
*/
|
|
310
318
|
strictPort?: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Provider-specific config passed through to the selected browser provider.
|
|
321
|
+
*
|
|
322
|
+
* Use provider-owned types or helpers in user config when you want richer
|
|
323
|
+
* IntelliSense for this field.
|
|
324
|
+
*/
|
|
325
|
+
providerOptions?: Record<string, unknown>;
|
|
311
326
|
};
|
|
312
327
|
|
|
313
328
|
/**
|
|
@@ -324,7 +339,7 @@ declare type BrowserViewport = {
|
|
|
324
339
|
height: number;
|
|
325
340
|
} | DevicePreset;
|
|
326
341
|
|
|
327
|
-
declare type BuiltInReporterNames = 'default' | 'verbose' | 'md' | 'github-actions' | 'junit';
|
|
342
|
+
declare type BuiltInReporterNames = 'default' | 'verbose' | 'md' | 'github-actions' | 'junit' | 'blob';
|
|
328
343
|
|
|
329
344
|
declare type BuiltinReporterOptions = {
|
|
330
345
|
default: DefaultReporterOptions;
|
|
@@ -332,6 +347,7 @@ declare type BuiltinReporterOptions = {
|
|
|
332
347
|
md: MdReporterOptions;
|
|
333
348
|
'github-actions': Record<string, unknown>;
|
|
334
349
|
junit: Record<string, unknown>;
|
|
350
|
+
blob: BlobReporterOptions;
|
|
335
351
|
};
|
|
336
352
|
|
|
337
353
|
declare type ChaiConfig = Partial<Omit<typeof config, 'useProxy' | 'proxyExcludedKeys' | 'deepEqual'>>;
|
|
@@ -402,7 +418,15 @@ declare type CommonOptions = {
|
|
|
402
418
|
exclude?: string[];
|
|
403
419
|
reporter?: string[];
|
|
404
420
|
project?: string[];
|
|
405
|
-
|
|
421
|
+
/**
|
|
422
|
+
* Coverage options.
|
|
423
|
+
* - `boolean`: shorthand for `{ enabled: boolean }` (from `--coverage` flag)
|
|
424
|
+
* - `object`: detailed coverage config (from `--coverage.*` options)
|
|
425
|
+
*/
|
|
426
|
+
coverage?: boolean | {
|
|
427
|
+
enabled?: boolean;
|
|
428
|
+
allowExternal?: boolean;
|
|
429
|
+
};
|
|
406
430
|
passWithNoTests?: boolean;
|
|
407
431
|
printConsoleTrace?: boolean;
|
|
408
432
|
logHeapUsage?: boolean;
|
|
@@ -607,6 +631,12 @@ export declare type CoverageOptions = {
|
|
|
607
631
|
* @default false
|
|
608
632
|
*/
|
|
609
633
|
reportOnFailure?: boolean;
|
|
634
|
+
/**
|
|
635
|
+
* Whether to collect coverage for source files outside the project root directory.
|
|
636
|
+
* This is useful in monorepo setups where tests import modules from sibling packages.
|
|
637
|
+
* @default false
|
|
638
|
+
*/
|
|
639
|
+
allowExternal?: boolean;
|
|
610
640
|
};
|
|
611
641
|
|
|
612
642
|
export declare class CoverageProvider {
|
|
@@ -786,11 +816,15 @@ declare interface DescribeEachFn {
|
|
|
786
816
|
<T extends Record<string, unknown>>(cases: readonly T[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
787
817
|
<T extends readonly [unknown, ...unknown[]]>(cases: readonly T[]): (description: string, fn: (...args: [...T]) => MaybePromise<void>) => void;
|
|
788
818
|
<T>(cases: readonly T[]): (description: string, fn: (param: T) => MaybePromise<void>) => void;
|
|
819
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
789
820
|
}
|
|
790
821
|
|
|
791
822
|
declare type DescribeFn = (description: string, fn?: () => void) => void;
|
|
792
823
|
|
|
793
|
-
declare
|
|
824
|
+
declare interface DescribeForFn {
|
|
825
|
+
<T>(cases: readonly T[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
826
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
|
|
827
|
+
}
|
|
794
828
|
|
|
795
829
|
/**
|
|
796
830
|
* Device presets aligned with Chrome DevTools device toolbar.
|
|
@@ -2249,6 +2283,7 @@ declare type NormalizedBrowserModeConfig = {
|
|
|
2249
2283
|
port?: number;
|
|
2250
2284
|
strictPort: boolean;
|
|
2251
2285
|
viewport?: BrowserViewport;
|
|
2286
|
+
providerOptions: Record<string, unknown>;
|
|
2252
2287
|
};
|
|
2253
2288
|
|
|
2254
2289
|
declare type NormalizedConfig = Required<Omit<RstestConfig, OptionalKeys | 'pool' | 'projects' | 'coverage' | 'setupFiles' | 'globalSetup' | 'exclude' | 'testEnvironment' | 'browser'>> & Partial<Pick<RstestConfig, OptionalKeys>> & {
|
|
@@ -2523,13 +2558,13 @@ export declare type Rstest = RunnerAPI & {
|
|
|
2523
2558
|
|
|
2524
2559
|
export declare const rstest: RstestUtilities;
|
|
2525
2560
|
|
|
2526
|
-
export declare type RstestCommand = 'watch' | 'run' | 'list';
|
|
2561
|
+
export declare type RstestCommand = 'watch' | 'run' | 'list' | 'merge-reports';
|
|
2527
2562
|
|
|
2528
2563
|
export declare interface RstestConfig {
|
|
2529
2564
|
/**
|
|
2530
2565
|
* Extend configuration from adapters
|
|
2531
2566
|
*/
|
|
2532
|
-
extends?: ExtendConfigFn | ExtendConfig;
|
|
2567
|
+
extends?: ExtendConfigFn | ExtendConfig | (ExtendConfigFn | ExtendConfig)[];
|
|
2533
2568
|
/**
|
|
2534
2569
|
* Project root
|
|
2535
2570
|
*
|
|
@@ -2794,12 +2829,20 @@ declare type RstestContext = {
|
|
|
2794
2829
|
reporters: Reporter[];
|
|
2795
2830
|
snapshotManager: SnapshotManager;
|
|
2796
2831
|
stateManager: TestStateManager;
|
|
2832
|
+
reporterResults: {
|
|
2833
|
+
results: TestFileResult[];
|
|
2834
|
+
testResults: TestResult[];
|
|
2835
|
+
};
|
|
2797
2836
|
};
|
|
2798
2837
|
|
|
2799
2838
|
declare type RstestInstance = {
|
|
2800
2839
|
context: RstestContext;
|
|
2801
2840
|
runTests: () => Promise<void>;
|
|
2802
2841
|
listTests: (options: ListCommandOptions) => Promise<ListCommandResult[]>;
|
|
2842
|
+
mergeReports: (options?: {
|
|
2843
|
+
path?: string;
|
|
2844
|
+
cleanup?: boolean;
|
|
2845
|
+
}) => Promise<void>;
|
|
2803
2846
|
};
|
|
2804
2847
|
|
|
2805
2848
|
declare type RstestPoolOptions = {
|
|
@@ -3327,6 +3370,7 @@ declare interface TestEachFn {
|
|
|
3327
3370
|
<T extends Record<string, unknown>>(cases: readonly T[]): (description: string, fn?: (param: T) => MaybePromise<void>, timeout?: number) => void;
|
|
3328
3371
|
<T extends readonly [unknown, ...unknown[]]>(cases: readonly T[]): (description: string, fn: (...args: [...T]) => MaybePromise<void>, timeout?: number) => void;
|
|
3329
3372
|
<T>(cases: readonly T[]): (description: string, fn: (...args: T[]) => MaybePromise<void>, timeout?: number) => void;
|
|
3373
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T) => MaybePromise<void>, timeout?: number) => void;
|
|
3330
3374
|
}
|
|
3331
3375
|
|
|
3332
3376
|
declare type Tester = (this: TesterContext, a: any, b: any, customTesters: Array<Tester>) => boolean | undefined;
|
|
@@ -3348,7 +3392,10 @@ export declare type TestFileResult = TestResult & {
|
|
|
3348
3392
|
|
|
3349
3393
|
declare type TestFn<ExtraContext = object> = (description: string, fn?: TestCallbackFn<ExtraContext>, timeout?: number) => void;
|
|
3350
3394
|
|
|
3351
|
-
declare
|
|
3395
|
+
declare interface TestForFn<ExtraContext = object> {
|
|
3396
|
+
<T>(cases: readonly T[]): (description: string, fn?: (param: T, context: TestContext & ExtraContext) => MaybePromise<void>, timeout?: number) => void;
|
|
3397
|
+
<T extends Record<string, unknown>>(strings: TemplateStringsArray, ...expressions: unknown[]): (description: string, fn?: (param: T, context: TestContext & ExtraContext) => MaybePromise<void>, timeout?: number) => void;
|
|
3398
|
+
}
|
|
3352
3399
|
|
|
3353
3400
|
export declare type TestInfo = TestCaseInfo | (TestSuiteInfo & {
|
|
3354
3401
|
tests: TestInfo[];
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
export { afterAll, afterEach, assert, beforeAll, beforeEach, describe, expect, it, onTestFailed, onTestFinished, rs, rstest, test } from "./
|
|
3
|
-
export { createRstest, defineConfig, defineProject, initCli, loadConfig, mergeProjectConfig, mergeRstestConfig, runCLI } from "./
|
|
2
|
+
export { afterAll, afterEach, assert, beforeAll, beforeEach, describe, expect, it, onTestFailed, onTestFinished, rs, rstest, test } from "./5040.js";
|
|
3
|
+
export { createRstest, defineConfig, defineProject, initCli, loadConfig, mergeProjectConfig, mergeRstestConfig, runCLI } from "./3145.js";
|
package/dist/rslib-runtime.js
CHANGED
|
@@ -5,20 +5,12 @@ function __webpack_require__(moduleId) {
|
|
|
5
5
|
var cachedModule = __webpack_module_cache__[moduleId];
|
|
6
6
|
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
7
7
|
var module = __webpack_module_cache__[moduleId] = {
|
|
8
|
-
id: moduleId,
|
|
9
|
-
loaded: false,
|
|
10
8
|
exports: {}
|
|
11
9
|
};
|
|
12
10
|
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
13
|
-
module.loaded = true;
|
|
14
11
|
return module.exports;
|
|
15
12
|
}
|
|
16
13
|
__webpack_require__.m = __webpack_modules__;
|
|
17
|
-
(()=>{
|
|
18
|
-
__webpack_require__.add = function registerModules(modules) {
|
|
19
|
-
Object.assign(__webpack_require__.m, modules);
|
|
20
|
-
};
|
|
21
|
-
})();
|
|
22
14
|
(()=>{
|
|
23
15
|
__webpack_require__.n = (module)=>{
|
|
24
16
|
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
@@ -36,6 +28,11 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
36
28
|
});
|
|
37
29
|
};
|
|
38
30
|
})();
|
|
31
|
+
(()=>{
|
|
32
|
+
__webpack_require__.add = function registerModules(modules) {
|
|
33
|
+
Object.assign(__webpack_require__.m, modules);
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
39
36
|
(()=>{
|
|
40
37
|
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
41
38
|
})();
|