@rstest/core 0.7.7 → 0.7.9
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 +294 -0
- package/dist/0~130.js +2 -2
- package/dist/0~1472.js +48 -0
- package/dist/0~1981.js +3 -0
- package/dist/0~2173.js +25 -10
- package/dist/0~2255.js +2 -2
- package/dist/0~3062.js +0 -5
- package/dist/0~3919.js +1 -1
- package/dist/0~4403.js +6 -5
- package/dist/0~4809.js +4 -4
- package/dist/0~5835.js +2 -2
- package/dist/0~62.js +3 -3
- package/dist/0~6588.js +3 -3
- package/dist/0~6923.js +2 -2
- package/dist/0~7583.js +9 -8
- package/dist/0~7882.js +1144 -0
- package/dist/0~8426.js +1 -2
- package/dist/0~89.js +33 -24
- package/dist/0~9348.js +953 -0
- package/dist/0~9634.js +58 -10
- package/dist/1157.js +13 -118
- package/dist/{7913.js → 1294.js} +51 -1745
- package/dist/2672.js +647 -0
- package/dist/3278.js +3 -450
- package/dist/4484.js +38 -0
- package/dist/487.js +1739 -0
- package/dist/4899.js +11 -0
- package/dist/5734.js +1 -1
- package/dist/{0~6151.js → 6151.js} +169 -21
- package/dist/{0~6973.js → 6973.js} +5 -5
- package/dist/721.js +9 -0
- package/dist/9131.js +559 -502
- package/dist/browser-runtime/2~907.js +1211 -0
- package/dist/browser-runtime/2~907.js.map +1 -0
- package/dist/browser-runtime/389.js +22071 -0
- package/dist/browser-runtime/389.js.LICENSE.txt +329 -0
- package/dist/browser-runtime/389.js.map +1 -0
- package/dist/browser-runtime/index.d.ts +2806 -0
- package/dist/browser-runtime/index.js +1 -0
- package/dist/browser-runtime/rslib-runtime.js +50 -0
- package/dist/browser-runtime/rslib-runtime.js.map +1 -0
- package/dist/browser.d.ts +3329 -0
- package/dist/browser.js +14 -0
- package/dist/cssFilterLoader.mjs +1 -1
- package/dist/globalSetupWorker.js +3 -2
- package/dist/index.d.ts +67 -2
- package/dist/index.js +2 -1
- package/dist/rslib-runtime.js +27 -0
- package/dist/rstestSuppressWarnings.cjs +9 -0
- package/dist/worker.d.ts +66 -2
- package/dist/worker.js +415 -1
- package/package.json +29 -14
- package/dist/0~8957.js +0 -149
- package/dist/554.js +0 -417
- package/dist/5693.js +0 -91
- /package/dist/{7913.js.LICENSE.txt → 1294.js.LICENSE.txt} +0 -0
- /package/dist/{0~6151.js.LICENSE.txt → 6151.js.LICENSE.txt} +0 -0
package/dist/browser.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
+
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
5
|
+
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
6
|
+
var picocolors_default_0 = picocolors_default();
|
|
7
|
+
export { TEMP_RSTEST_OUTPUT_DIR, getTestEntries, globalApis } from "./1157.js";
|
|
8
|
+
export { afterAll, afterEach, assert, beforeAll, beforeEach, describe, expect, it, onTestFailed, onTestFinished, rs, rsbuild, rstest, test } from "./4484.js";
|
|
9
|
+
export { createRstestRuntime } from "./6151.js";
|
|
10
|
+
export { getSetupFiles } from "./6973.js";
|
|
11
|
+
export { isDebug, logger } from "./3278.js";
|
|
12
|
+
export { serializableConfig } from "./2672.js";
|
|
13
|
+
export { setRealTimers } from "./1294.js";
|
|
14
|
+
export { picocolors_default_0 as color };
|
package/dist/cssFilterLoader.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
4
|
+
import "./487.js";
|
|
5
|
+
import "./2672.js";
|
|
6
|
+
import { formatTestError } from "./1294.js";
|
|
6
7
|
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
8
|
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
8
9
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
package/dist/index.d.ts
CHANGED
|
@@ -264,6 +264,45 @@ declare interface BranchMapping {
|
|
|
264
264
|
line: number;
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
+
declare type BrowserModeConfig = {
|
|
268
|
+
/**
|
|
269
|
+
* Enable browser mode when running tests.
|
|
270
|
+
*
|
|
271
|
+
* @default false
|
|
272
|
+
*/
|
|
273
|
+
enabled?: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Browser provider to use for running tests.
|
|
276
|
+
*
|
|
277
|
+
* Currently only 'playwright' is supported.
|
|
278
|
+
*
|
|
279
|
+
* @default 'playwright'
|
|
280
|
+
*/
|
|
281
|
+
provider?: 'playwright';
|
|
282
|
+
/**
|
|
283
|
+
* Which browser to use for testing.
|
|
284
|
+
*
|
|
285
|
+
* - `chromium` - Google Chrome, Microsoft Edge
|
|
286
|
+
* - `firefox` - Mozilla Firefox
|
|
287
|
+
* - `webkit` - Safari
|
|
288
|
+
*
|
|
289
|
+
* @default 'chromium'
|
|
290
|
+
*/
|
|
291
|
+
browser?: 'chromium' | 'firefox' | 'webkit';
|
|
292
|
+
/**
|
|
293
|
+
* Run browser in headless mode.
|
|
294
|
+
*
|
|
295
|
+
* @default Inferred from CI environment. `true` in CI, `false` otherwise.
|
|
296
|
+
*/
|
|
297
|
+
headless?: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* Port for the browser mode dev server.
|
|
300
|
+
*
|
|
301
|
+
* If not specified, a random available port will be used.
|
|
302
|
+
*/
|
|
303
|
+
port?: number;
|
|
304
|
+
};
|
|
305
|
+
|
|
267
306
|
declare type BuiltInReporterNames = keyof typeof reportersMap;
|
|
268
307
|
|
|
269
308
|
declare type BuiltinReporterOptions = {
|
|
@@ -310,6 +349,7 @@ declare type CommonOptions = {
|
|
|
310
349
|
config?: string;
|
|
311
350
|
configLoader?: LoadConfigOptions['loader'];
|
|
312
351
|
globals?: boolean;
|
|
352
|
+
browser?: boolean;
|
|
313
353
|
isolate?: boolean;
|
|
314
354
|
include?: string[];
|
|
315
355
|
exclude?: string[];
|
|
@@ -779,6 +819,13 @@ declare interface EncodedSourceMap extends SourceMapV3 {
|
|
|
779
819
|
|
|
780
820
|
declare type EncodedSourceMapXInput = EncodedSourceMap & XInput;
|
|
781
821
|
|
|
822
|
+
declare type EnvironmentName = 'node' | 'jsdom' | 'happy-dom';
|
|
823
|
+
|
|
824
|
+
declare type EnvironmentWithOptions = {
|
|
825
|
+
name: EnvironmentName;
|
|
826
|
+
options?: Record<string, any>;
|
|
827
|
+
};
|
|
828
|
+
|
|
782
829
|
export declare type Expect = ExpectStatic;
|
|
783
830
|
|
|
784
831
|
export declare const expect: Rstest['expect'];
|
|
@@ -2032,9 +2079,19 @@ declare interface Node_2 {
|
|
|
2032
2079
|
visit(visitor: Visitor, state: any): void;
|
|
2033
2080
|
}
|
|
2034
2081
|
|
|
2035
|
-
declare type
|
|
2082
|
+
declare type NormalizedBrowserModeConfig = {
|
|
2083
|
+
enabled: boolean;
|
|
2084
|
+
provider: 'playwright';
|
|
2085
|
+
browser: 'chromium' | 'firefox' | 'webkit';
|
|
2086
|
+
headless: boolean;
|
|
2087
|
+
port?: number;
|
|
2088
|
+
};
|
|
2089
|
+
|
|
2090
|
+
declare type NormalizedConfig = Required<Omit<RstestConfig, OptionalKeys | 'pool' | 'projects' | 'coverage' | 'setupFiles' | 'globalSetup' | 'exclude' | 'testEnvironment' | 'browser'>> & Partial<Pick<RstestConfig, OptionalKeys>> & {
|
|
2036
2091
|
pool: RstestPoolOptions;
|
|
2092
|
+
testEnvironment: EnvironmentWithOptions;
|
|
2037
2093
|
coverage: NormalizedCoverageOptions;
|
|
2094
|
+
browser: NormalizedBrowserModeConfig;
|
|
2038
2095
|
setupFiles: string[];
|
|
2039
2096
|
globalSetup: string[];
|
|
2040
2097
|
exclude: {
|
|
@@ -2238,6 +2295,10 @@ export declare interface Reporter {
|
|
|
2238
2295
|
* Called before running the test case.
|
|
2239
2296
|
*/
|
|
2240
2297
|
onTestCaseStart?: (test: TestCaseInfo) => void;
|
|
2298
|
+
/**
|
|
2299
|
+
* Called before all tests start
|
|
2300
|
+
*/
|
|
2301
|
+
onTestRunStart?: () => MaybePromise<void>;
|
|
2241
2302
|
/**
|
|
2242
2303
|
* Called after all tests have finished running.
|
|
2243
2304
|
*/
|
|
@@ -2398,7 +2459,7 @@ export declare interface RstestConfig {
|
|
|
2398
2459
|
*
|
|
2399
2460
|
* @default 'node'
|
|
2400
2461
|
*/
|
|
2401
|
-
testEnvironment?:
|
|
2462
|
+
testEnvironment?: EnvironmentName | EnvironmentWithOptions;
|
|
2402
2463
|
/**
|
|
2403
2464
|
* Stop running tests after n failures.
|
|
2404
2465
|
* Set to 0 to run all tests regardless of failures.
|
|
@@ -2503,6 +2564,10 @@ export declare interface RstestConfig {
|
|
|
2503
2564
|
* Custom environment variables available on `process.env` during tests.
|
|
2504
2565
|
*/
|
|
2505
2566
|
env?: Partial<NodeJS.ProcessEnv>;
|
|
2567
|
+
/**
|
|
2568
|
+
* Browser mode configuration.
|
|
2569
|
+
*/
|
|
2570
|
+
browser?: BrowserModeConfig;
|
|
2506
2571
|
/**
|
|
2507
2572
|
* Coverage options
|
|
2508
2573
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
export { afterAll, afterEach, assert, beforeAll, beforeEach,
|
|
3
|
+
export { afterAll, afterEach, assert, beforeAll, beforeEach, describe, expect, it, onTestFailed, onTestFinished, rs, rstest, test } from "./4484.js";
|
|
4
|
+
export { createRstest, defineConfig, defineProject, initCli, loadConfig, mergeProjectConfig, mergeRstestConfig, runCLI } from "./9131.js";
|
package/dist/rslib-runtime.js
CHANGED
|
@@ -29,6 +29,33 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
29
29
|
return getter;
|
|
30
30
|
};
|
|
31
31
|
})();
|
|
32
|
+
(()=>{
|
|
33
|
+
var getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
|
|
34
|
+
var leafPrototypes;
|
|
35
|
+
__webpack_require__.t = function(value, mode) {
|
|
36
|
+
if (1 & mode) value = this(value);
|
|
37
|
+
if (8 & mode) return value;
|
|
38
|
+
if ('object' == typeof value && value) {
|
|
39
|
+
if (4 & mode && value.__esModule) return value;
|
|
40
|
+
if (16 & mode && 'function' == typeof value.then) return value;
|
|
41
|
+
}
|
|
42
|
+
var ns = Object.create(null);
|
|
43
|
+
__webpack_require__.r(ns);
|
|
44
|
+
var def = {};
|
|
45
|
+
leafPrototypes = leafPrototypes || [
|
|
46
|
+
null,
|
|
47
|
+
getProto({}),
|
|
48
|
+
getProto([]),
|
|
49
|
+
getProto(getProto)
|
|
50
|
+
];
|
|
51
|
+
for(var current = 2 & mode && value; ('object' == typeof current || 'function' == typeof current) && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach((key)=>{
|
|
52
|
+
def[key] = ()=>value[key];
|
|
53
|
+
});
|
|
54
|
+
def['default'] = ()=>value;
|
|
55
|
+
__webpack_require__.d(ns, def);
|
|
56
|
+
return ns;
|
|
57
|
+
};
|
|
58
|
+
})();
|
|
32
59
|
(()=>{
|
|
33
60
|
__webpack_require__.d = (exports, definition)=>{
|
|
34
61
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
package/dist/worker.d.ts
CHANGED
|
@@ -251,6 +251,45 @@ declare interface BranchMapping {
|
|
|
251
251
|
line: number;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
declare type BrowserModeConfig = {
|
|
255
|
+
/**
|
|
256
|
+
* Enable browser mode when running tests.
|
|
257
|
+
*
|
|
258
|
+
* @default false
|
|
259
|
+
*/
|
|
260
|
+
enabled?: boolean;
|
|
261
|
+
/**
|
|
262
|
+
* Browser provider to use for running tests.
|
|
263
|
+
*
|
|
264
|
+
* Currently only 'playwright' is supported.
|
|
265
|
+
*
|
|
266
|
+
* @default 'playwright'
|
|
267
|
+
*/
|
|
268
|
+
provider?: 'playwright';
|
|
269
|
+
/**
|
|
270
|
+
* Which browser to use for testing.
|
|
271
|
+
*
|
|
272
|
+
* - `chromium` - Google Chrome, Microsoft Edge
|
|
273
|
+
* - `firefox` - Mozilla Firefox
|
|
274
|
+
* - `webkit` - Safari
|
|
275
|
+
*
|
|
276
|
+
* @default 'chromium'
|
|
277
|
+
*/
|
|
278
|
+
browser?: 'chromium' | 'firefox' | 'webkit';
|
|
279
|
+
/**
|
|
280
|
+
* Run browser in headless mode.
|
|
281
|
+
*
|
|
282
|
+
* @default Inferred from CI environment. `true` in CI, `false` otherwise.
|
|
283
|
+
*/
|
|
284
|
+
headless?: boolean;
|
|
285
|
+
/**
|
|
286
|
+
* Port for the browser mode dev server.
|
|
287
|
+
*
|
|
288
|
+
* If not specified, a random available port will be used.
|
|
289
|
+
*/
|
|
290
|
+
port?: number;
|
|
291
|
+
};
|
|
292
|
+
|
|
254
293
|
declare type BuiltInReporterNames = keyof typeof reportersMap;
|
|
255
294
|
|
|
256
295
|
declare type BuiltinReporterOptions = {
|
|
@@ -671,6 +710,13 @@ declare type EntryInfo = {
|
|
|
671
710
|
files?: string[];
|
|
672
711
|
};
|
|
673
712
|
|
|
713
|
+
declare type EnvironmentName = 'node' | 'jsdom' | 'happy-dom';
|
|
714
|
+
|
|
715
|
+
declare type EnvironmentWithOptions = {
|
|
716
|
+
name: EnvironmentName;
|
|
717
|
+
options?: Record<string, any>;
|
|
718
|
+
};
|
|
719
|
+
|
|
674
720
|
declare type ExpectationResult = SyncExpectationResult | AsyncExpectationResult;
|
|
675
721
|
|
|
676
722
|
declare interface ExpectPollOptions {
|
|
@@ -1675,9 +1721,19 @@ declare interface Node_2 {
|
|
|
1675
1721
|
visit(visitor: Visitor, state: any): void;
|
|
1676
1722
|
}
|
|
1677
1723
|
|
|
1678
|
-
declare type
|
|
1724
|
+
declare type NormalizedBrowserModeConfig = {
|
|
1725
|
+
enabled: boolean;
|
|
1726
|
+
provider: 'playwright';
|
|
1727
|
+
browser: 'chromium' | 'firefox' | 'webkit';
|
|
1728
|
+
headless: boolean;
|
|
1729
|
+
port?: number;
|
|
1730
|
+
};
|
|
1731
|
+
|
|
1732
|
+
declare type NormalizedConfig = Required<Omit<RstestConfig, OptionalKeys | 'pool' | 'projects' | 'coverage' | 'setupFiles' | 'globalSetup' | 'exclude' | 'testEnvironment' | 'browser'>> & Partial<Pick<RstestConfig, OptionalKeys>> & {
|
|
1679
1733
|
pool: RstestPoolOptions;
|
|
1734
|
+
testEnvironment: EnvironmentWithOptions;
|
|
1680
1735
|
coverage: NormalizedCoverageOptions;
|
|
1736
|
+
browser: NormalizedBrowserModeConfig;
|
|
1681
1737
|
setupFiles: string[];
|
|
1682
1738
|
globalSetup: string[];
|
|
1683
1739
|
exclude: {
|
|
@@ -1864,6 +1920,10 @@ declare interface Reporter {
|
|
|
1864
1920
|
* Called before running the test case.
|
|
1865
1921
|
*/
|
|
1866
1922
|
onTestCaseStart?: (test: TestCaseInfo) => void;
|
|
1923
|
+
/**
|
|
1924
|
+
* Called before all tests start
|
|
1925
|
+
*/
|
|
1926
|
+
onTestRunStart?: () => MaybePromise<void>;
|
|
1867
1927
|
/**
|
|
1868
1928
|
* Called after all tests have finished running.
|
|
1869
1929
|
*/
|
|
@@ -2011,7 +2071,7 @@ declare interface RstestConfig {
|
|
|
2011
2071
|
*
|
|
2012
2072
|
* @default 'node'
|
|
2013
2073
|
*/
|
|
2014
|
-
testEnvironment?:
|
|
2074
|
+
testEnvironment?: EnvironmentName | EnvironmentWithOptions;
|
|
2015
2075
|
/**
|
|
2016
2076
|
* Stop running tests after n failures.
|
|
2017
2077
|
* Set to 0 to run all tests regardless of failures.
|
|
@@ -2116,6 +2176,10 @@ declare interface RstestConfig {
|
|
|
2116
2176
|
* Custom environment variables available on `process.env` during tests.
|
|
2117
2177
|
*/
|
|
2118
2178
|
env?: Partial<NodeJS.ProcessEnv>;
|
|
2179
|
+
/**
|
|
2180
|
+
* Browser mode configuration.
|
|
2181
|
+
*/
|
|
2182
|
+
browser?: BrowserModeConfig;
|
|
2119
2183
|
/**
|
|
2120
2184
|
* Coverage options
|
|
2121
2185
|
*/
|