@rstest/core 0.5.1 → 0.5.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/dist/index.js CHANGED
@@ -7,10 +7,11 @@ import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__ from "node:fs/
7
7
  import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
8
8
  import * as __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__ from "node:os";
9
9
  import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
10
- import * as __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__ from "node:tty";
11
10
  import * as __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__ from "node:process";
11
+ import * as __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__ from "node:tty";
12
12
  import * as __WEBPACK_EXTERNAL_MODULE_url__ from "url";
13
13
  import * as __WEBPACK_EXTERNAL_MODULE_module__ from "module";
14
+ import * as __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__ from "node:util";
14
15
  var __webpack_modules__ = {
15
16
  "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": function(module) {
16
17
  let p = process || {}, argv = p.argv || [], env = p.env || {};
@@ -1484,6 +1485,99 @@ var __webpack_modules__ = {
1484
1485
  return last;
1485
1486
  };
1486
1487
  },
1488
+ "../../node_modules/.pnpm/stacktrace-parser@0.1.11/node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1489
+ __webpack_require__.d(__webpack_exports__, {
1490
+ q: ()=>parse
1491
+ });
1492
+ var UNKNOWN_FUNCTION = '<unknown>';
1493
+ function parse(stackString) {
1494
+ var lines = stackString.split('\n');
1495
+ return lines.reduce(function(stack, line) {
1496
+ var parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line);
1497
+ if (parseResult) stack.push(parseResult);
1498
+ return stack;
1499
+ }, []);
1500
+ }
1501
+ var chromeRe = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
1502
+ var chromeEvalRe = /\((\S*)(?::(\d+))(?::(\d+))\)/;
1503
+ function parseChrome(line) {
1504
+ var parts = chromeRe.exec(line);
1505
+ if (!parts) return null;
1506
+ var isNative = parts[2] && 0 === parts[2].indexOf('native');
1507
+ var isEval = parts[2] && 0 === parts[2].indexOf('eval');
1508
+ var submatch = chromeEvalRe.exec(parts[2]);
1509
+ if (isEval && null != submatch) {
1510
+ parts[2] = submatch[1];
1511
+ parts[3] = submatch[2];
1512
+ parts[4] = submatch[3];
1513
+ }
1514
+ return {
1515
+ file: isNative ? null : parts[2],
1516
+ methodName: parts[1] || UNKNOWN_FUNCTION,
1517
+ arguments: isNative ? [
1518
+ parts[2]
1519
+ ] : [],
1520
+ lineNumber: parts[3] ? +parts[3] : null,
1521
+ column: parts[4] ? +parts[4] : null
1522
+ };
1523
+ }
1524
+ var winjsRe = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
1525
+ function parseWinjs(line) {
1526
+ var parts = winjsRe.exec(line);
1527
+ if (!parts) return null;
1528
+ return {
1529
+ file: parts[2],
1530
+ methodName: parts[1] || UNKNOWN_FUNCTION,
1531
+ arguments: [],
1532
+ lineNumber: +parts[3],
1533
+ column: parts[4] ? +parts[4] : null
1534
+ };
1535
+ }
1536
+ var geckoRe = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i;
1537
+ var geckoEvalRe = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
1538
+ function parseGecko(line) {
1539
+ var parts = geckoRe.exec(line);
1540
+ if (!parts) return null;
1541
+ var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
1542
+ var submatch = geckoEvalRe.exec(parts[3]);
1543
+ if (isEval && null != submatch) {
1544
+ parts[3] = submatch[1];
1545
+ parts[4] = submatch[2];
1546
+ parts[5] = null;
1547
+ }
1548
+ return {
1549
+ file: parts[3],
1550
+ methodName: parts[1] || UNKNOWN_FUNCTION,
1551
+ arguments: parts[2] ? parts[2].split(',') : [],
1552
+ lineNumber: parts[4] ? +parts[4] : null,
1553
+ column: parts[5] ? +parts[5] : null
1554
+ };
1555
+ }
1556
+ var javaScriptCoreRe = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;
1557
+ function parseJSC(line) {
1558
+ var parts = javaScriptCoreRe.exec(line);
1559
+ if (!parts) return null;
1560
+ return {
1561
+ file: parts[3],
1562
+ methodName: parts[1] || UNKNOWN_FUNCTION,
1563
+ arguments: [],
1564
+ lineNumber: +parts[4],
1565
+ column: parts[5] ? +parts[5] : null
1566
+ };
1567
+ }
1568
+ var nodeRe = /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;
1569
+ function parseNode(line) {
1570
+ var parts = nodeRe.exec(line);
1571
+ if (!parts) return null;
1572
+ return {
1573
+ file: parts[2],
1574
+ methodName: parts[1] || UNKNOWN_FUNCTION,
1575
+ arguments: [],
1576
+ lineNumber: +parts[3],
1577
+ column: parts[4] ? +parts[4] : null
1578
+ };
1579
+ }
1580
+ },
1487
1581
  "./src/cli/commands.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1488
1582
  __webpack_require__.d(__webpack_exports__, {
1489
1583
  a: ()=>runRest,
@@ -1987,12 +2081,9 @@ ${section.body}` : section.body).join("\n\n"));
1987
2081
  const runRest = async ({ options, filters, command })=>{
1988
2082
  let rstest;
1989
2083
  try {
1990
- const { initCli } = await __webpack_require__.e("223").then(__webpack_require__.bind(__webpack_require__, "./src/cli/init.ts"));
2084
+ const { initCli } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./src/cli/init.ts"));
1991
2085
  const { config, configFilePath, projects } = await initCli(options);
1992
- const { createRstest } = await Promise.all([
1993
- __webpack_require__.e("908"),
1994
- __webpack_require__.e("876")
1995
- ]).then(__webpack_require__.bind(__webpack_require__, "./src/core/index.ts"));
2086
+ const { createRstest } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./src/core/index.ts"));
1996
2087
  rstest = createRstest({
1997
2088
  config,
1998
2089
  configFilePath,
@@ -2017,7 +2108,7 @@ ${section.body}` : section.body).join("\n\n"));
2017
2108
  function setupCommands() {
2018
2109
  const cli = dist('rstest');
2019
2110
  cli.help();
2020
- cli.version("0.5.1");
2111
+ cli.version("0.5.3");
2021
2112
  applyCommonOptions(cli);
2022
2113
  cli.command('[...filters]', 'run tests').option('-w, --watch', 'Run tests in watch mode').action(async (filters, options)=>{
2023
2114
  (0, prepare.N)();
@@ -2050,12 +2141,9 @@ ${section.body}` : section.body).join("\n\n"));
2050
2141
  });
2051
2142
  cli.command('list [...filters]', 'lists all test files that Rstest will run').option('--filesOnly', 'only list the test files').option('--json [boolean/path]', 'print tests as JSON or write to a file').action(async (filters, options)=>{
2052
2143
  try {
2053
- const { initCli } = await __webpack_require__.e("223").then(__webpack_require__.bind(__webpack_require__, "./src/cli/init.ts"));
2144
+ const { initCli } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./src/cli/init.ts"));
2054
2145
  const { config, configFilePath, projects } = await initCli(options);
2055
- const { createRstest } = await Promise.all([
2056
- __webpack_require__.e("908"),
2057
- __webpack_require__.e("876")
2058
- ]).then(__webpack_require__.bind(__webpack_require__, "./src/core/index.ts"));
2146
+ const { createRstest } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./src/core/index.ts"));
2059
2147
  const rstest = createRstest({
2060
2148
  config,
2061
2149
  configFilePath,
@@ -2074,6 +2162,175 @@ ${section.body}` : section.body).join("\n\n"));
2074
2162
  cli.parse();
2075
2163
  }
2076
2164
  },
2165
+ "./src/cli/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2166
+ __webpack_require__.d(__webpack_exports__, {
2167
+ G: ()=>runCLI,
2168
+ X: ()=>_init__WEBPACK_IMPORTED_MODULE_3__.initCli
2169
+ });
2170
+ var _utils_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/utils/logger.ts");
2171
+ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/cli/commands.ts");
2172
+ var _prepare__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/cli/prepare.ts");
2173
+ var _init__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/cli/init.ts");
2174
+ async function runCLI() {
2175
+ (0, _prepare__WEBPACK_IMPORTED_MODULE_2__.k)();
2176
+ try {
2177
+ (0, _commands__WEBPACK_IMPORTED_MODULE_1__.Q)();
2178
+ } catch (err) {
2179
+ _utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.error('Failed to start Rstest CLI.');
2180
+ _utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.error(err);
2181
+ }
2182
+ }
2183
+ },
2184
+ "./src/cli/init.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2185
+ __webpack_require__.d(__webpack_exports__, {
2186
+ initCli: ()=>initCli
2187
+ });
2188
+ var external_node_fs_ = __webpack_require__("node:fs");
2189
+ var pathe_M_eThtNZ = __webpack_require__("../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs");
2190
+ var dist = __webpack_require__("../../node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs");
2191
+ var src_config = __webpack_require__("./src/config.ts");
2192
+ var utils = __webpack_require__("./src/utils/index.ts");
2193
+ async function resolveConfig(options) {
2194
+ const { content: config, filePath: configFilePath } = await (0, src_config.Z9)({
2195
+ cwd: options.root,
2196
+ path: options.config,
2197
+ configLoader: options.configLoader
2198
+ });
2199
+ const keys = [
2200
+ 'root',
2201
+ 'globals',
2202
+ 'isolate',
2203
+ 'passWithNoTests',
2204
+ 'update',
2205
+ 'testNamePattern',
2206
+ 'testTimeout',
2207
+ 'hookTimeout',
2208
+ 'clearMocks',
2209
+ 'resetMocks',
2210
+ 'restoreMocks',
2211
+ 'unstubEnvs',
2212
+ 'unstubGlobals',
2213
+ 'retry',
2214
+ 'slowTestThreshold',
2215
+ 'maxConcurrency',
2216
+ 'printConsoleTrace',
2217
+ 'disableConsoleIntercept',
2218
+ 'testEnvironment'
2219
+ ];
2220
+ for (const key of keys)if (void 0 !== options[key]) config[key] = options[key];
2221
+ if (options.reporter) config.reporters = (0, utils.bg)(options.reporter);
2222
+ if (void 0 !== options.coverage) {
2223
+ config.coverage ??= {};
2224
+ config.coverage.enabled = options.coverage;
2225
+ }
2226
+ if (options.exclude) config.exclude = (0, utils.bg)(options.exclude);
2227
+ if (options.include) config.include = (0, utils.bg)(options.include);
2228
+ return {
2229
+ config,
2230
+ configFilePath: configFilePath ?? void 0
2231
+ };
2232
+ }
2233
+ async function resolveProjects({ config, root, options }) {
2234
+ if (!config.projects) return [];
2235
+ const getDefaultProjectName = (dir)=>{
2236
+ const pkgJsonPath = (0, pathe_M_eThtNZ.r)(dir, 'package.json');
2237
+ const name = (0, external_node_fs_.existsSync)(pkgJsonPath) ? JSON.parse((0, external_node_fs_.readFileSync)(pkgJsonPath, 'utf-8')).name : '';
2238
+ if ('string' != typeof name || !name) return (0, pathe_M_eThtNZ.c)(dir);
2239
+ return name;
2240
+ };
2241
+ const globProjects = async (patterns)=>{
2242
+ const globOptions = {
2243
+ absolute: true,
2244
+ dot: true,
2245
+ onlyFiles: false,
2246
+ cwd: root,
2247
+ expandDirectories: false,
2248
+ ignore: [
2249
+ '**/node_modules/**',
2250
+ '**/.DS_Store'
2251
+ ]
2252
+ };
2253
+ return (0, dist.glob)(patterns, globOptions);
2254
+ };
2255
+ const { projectPaths, projectPatterns, projectConfigs } = (config.projects || []).reduce((total, p)=>{
2256
+ if ('object' == typeof p) {
2257
+ const projectRoot = p.root ? (0, utils.tS)(p.root, root) : root;
2258
+ total.projectConfigs.push({
2259
+ config: {
2260
+ root: projectRoot,
2261
+ name: p.name ? p.name : getDefaultProjectName(projectRoot),
2262
+ ...p
2263
+ },
2264
+ configFilePath: void 0
2265
+ });
2266
+ return total;
2267
+ }
2268
+ const projectStr = (0, utils.tS)(p, root);
2269
+ if ((0, dist.ey)(projectStr)) total.projectPatterns.push(projectStr);
2270
+ else {
2271
+ const absolutePath = (0, utils.FI)(root, projectStr);
2272
+ if (!(0, external_node_fs_.existsSync)(absolutePath)) throw `Can't resolve project "${p}", please make sure "${p}" is a existing file or a directory.`;
2273
+ total.projectPaths.push(absolutePath);
2274
+ }
2275
+ return total;
2276
+ }, {
2277
+ projectPaths: [],
2278
+ projectPatterns: [],
2279
+ projectConfigs: []
2280
+ });
2281
+ projectPaths.push(...await globProjects(projectPatterns));
2282
+ const projects = await Promise.all(projectPaths.map(async (project)=>{
2283
+ const isDirectory = (0, external_node_fs_.statSync)(project).isDirectory();
2284
+ const { config, configFilePath } = await resolveConfig({
2285
+ ...options,
2286
+ config: isDirectory ? void 0 : project,
2287
+ root: isDirectory ? project : (0, pathe_M_eThtNZ.d)(project)
2288
+ });
2289
+ config.name ??= getDefaultProjectName(project);
2290
+ if (config.projects?.length && config.root !== root) utils.vF.warn(`Projects cannot have nested projects, the "projects" field in project "${config.name}" will be ignored.`);
2291
+ return {
2292
+ config,
2293
+ configFilePath
2294
+ };
2295
+ })).then((projects)=>(0, utils.zz)(projects.concat(projectConfigs), options));
2296
+ if (!projects.length) {
2297
+ let errorMsg = `No projects found, please make sure you have at least one valid project.
2298
+ ${utils.yW.gray('projects:')} ${JSON.stringify(config.projects, null, 2)}`;
2299
+ if (options.project) errorMsg += `\n${utils.yW.gray('projectName filter:')} ${JSON.stringify(options.project, null, 2)}`;
2300
+ throw errorMsg;
2301
+ }
2302
+ const names = new Set();
2303
+ projects.forEach((project)=>{
2304
+ if (names.has(project.config.name)) {
2305
+ const conflictProjects = projects.filter((p)=>p.config.name === project.config.name);
2306
+ throw `Project name "${project.config.name}" is already used. Please ensure all projects have unique names.
2307
+ Conflicting projects:
2308
+ ${conflictProjects.map((p)=>`- ${p.configFilePath || p.config.root}`).join('\n')}
2309
+ `;
2310
+ }
2311
+ names.add(project.config.name);
2312
+ });
2313
+ return projects;
2314
+ }
2315
+ async function initCli(options) {
2316
+ const cwd = process.cwd();
2317
+ const root = options.root ? (0, utils.FI)(cwd, options.root) : cwd;
2318
+ const { config, configFilePath } = await resolveConfig({
2319
+ ...options,
2320
+ root
2321
+ });
2322
+ const projects = await resolveProjects({
2323
+ config,
2324
+ root,
2325
+ options
2326
+ });
2327
+ return {
2328
+ config,
2329
+ configFilePath,
2330
+ projects
2331
+ };
2332
+ }
2333
+ },
2077
2334
  "./src/cli/prepare.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2078
2335
  __webpack_require__.d(__webpack_exports__, {
2079
2336
  N: ()=>showRstest,
@@ -2090,7 +2347,7 @@ ${section.body}` : section.body).join("\n\n"));
2090
2347
  if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
2091
2348
  }
2092
2349
  function showRstest() {
2093
- _utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.greet(" Rstest v0.5.1");
2350
+ _utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.greet(" Rstest v0.5.3");
2094
2351
  _utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.log('');
2095
2352
  }
2096
2353
  },
@@ -2194,6 +2451,7 @@ ${section.body}` : section.body).join("\n\n"));
2194
2451
  printConsoleTrace: false,
2195
2452
  disableConsoleIntercept: false,
2196
2453
  snapshotFormat: {},
2454
+ env: {},
2197
2455
  coverage: {
2198
2456
  exclude: [
2199
2457
  '**/node_modules/**',
@@ -2242,6 +2500,1068 @@ ${section.body}` : section.body).join("\n\n"));
2242
2500
  };
2243
2501
  };
2244
2502
  },
2503
+ "./src/core/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2504
+ __webpack_require__.d(__webpack_exports__, {
2505
+ createRstest: ()=>createRstest
2506
+ });
2507
+ var external_node_fs_ = __webpack_require__("node:fs");
2508
+ var pathe_M_eThtNZ = __webpack_require__("../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs");
2509
+ class SnapshotManager {
2510
+ summary;
2511
+ extension = ".snap";
2512
+ constructor(options){
2513
+ this.options = options;
2514
+ this.clear();
2515
+ }
2516
+ clear() {
2517
+ this.summary = emptySummary(this.options);
2518
+ }
2519
+ add(result) {
2520
+ addSnapshotResult(this.summary, result);
2521
+ }
2522
+ resolvePath(testPath, context) {
2523
+ const resolver = this.options.resolveSnapshotPath || (()=>(0, pathe_M_eThtNZ.j)((0, pathe_M_eThtNZ.j)((0, pathe_M_eThtNZ.d)(testPath), "__snapshots__"), `${(0, pathe_M_eThtNZ.c)(testPath)}${this.extension}`));
2524
+ const path = resolver(testPath, this.extension, context);
2525
+ return path;
2526
+ }
2527
+ resolveRawPath(testPath, rawPath) {
2528
+ return (0, pathe_M_eThtNZ.i)(rawPath) ? rawPath : (0, pathe_M_eThtNZ.r)((0, pathe_M_eThtNZ.d)(testPath), rawPath);
2529
+ }
2530
+ }
2531
+ function emptySummary(options) {
2532
+ const summary = {
2533
+ added: 0,
2534
+ failure: false,
2535
+ filesAdded: 0,
2536
+ filesRemoved: 0,
2537
+ filesRemovedList: [],
2538
+ filesUnmatched: 0,
2539
+ filesUpdated: 0,
2540
+ matched: 0,
2541
+ total: 0,
2542
+ unchecked: 0,
2543
+ uncheckedKeysByFile: [],
2544
+ unmatched: 0,
2545
+ updated: 0,
2546
+ didUpdate: "all" === options.updateSnapshot
2547
+ };
2548
+ return summary;
2549
+ }
2550
+ function addSnapshotResult(summary, result) {
2551
+ if (result.added) summary.filesAdded++;
2552
+ if (result.fileDeleted) summary.filesRemoved++;
2553
+ if (result.unmatched) summary.filesUnmatched++;
2554
+ if (result.updated) summary.filesUpdated++;
2555
+ summary.added += result.added;
2556
+ summary.matched += result.matched;
2557
+ summary.unchecked += result.unchecked;
2558
+ if (result.uncheckedKeys && result.uncheckedKeys.length > 0) summary.uncheckedKeysByFile.push({
2559
+ filePath: result.filepath,
2560
+ keys: result.uncheckedKeys
2561
+ });
2562
+ summary.unmatched += result.unmatched;
2563
+ summary.updated += result.updated;
2564
+ summary.total += result.added + result.matched + result.unmatched + result.updated;
2565
+ }
2566
+ const dist_r = Object.create(null), dist_i = (e)=>globalThis.process?.env || {
2567
+ MODE: "production",
2568
+ DEV: false,
2569
+ PROD: true,
2570
+ BASE_URL: "/",
2571
+ ASSET_PREFIX: "auto"
2572
+ }, o = new Proxy(dist_r, {
2573
+ get (e, s) {
2574
+ return dist_i()[s] ?? dist_r[s];
2575
+ },
2576
+ has (e, s) {
2577
+ const E = dist_i();
2578
+ return s in E || s in dist_r;
2579
+ },
2580
+ set (e, s, E) {
2581
+ const B = dist_i(!0);
2582
+ return B[s] = E, !0;
2583
+ },
2584
+ deleteProperty (e, s) {
2585
+ if (!s) return !1;
2586
+ const E = dist_i(!0);
2587
+ return delete E[s], !0;
2588
+ },
2589
+ ownKeys () {
2590
+ const e = dist_i(!0);
2591
+ return Object.keys(e);
2592
+ }
2593
+ }), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
2594
+ [
2595
+ "APPVEYOR"
2596
+ ],
2597
+ [
2598
+ "AWS_AMPLIFY",
2599
+ "AWS_APP_ID",
2600
+ {
2601
+ ci: !0
2602
+ }
2603
+ ],
2604
+ [
2605
+ "AZURE_PIPELINES",
2606
+ "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"
2607
+ ],
2608
+ [
2609
+ "AZURE_STATIC",
2610
+ "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"
2611
+ ],
2612
+ [
2613
+ "APPCIRCLE",
2614
+ "AC_APPCIRCLE"
2615
+ ],
2616
+ [
2617
+ "BAMBOO",
2618
+ "bamboo_planKey"
2619
+ ],
2620
+ [
2621
+ "BITBUCKET",
2622
+ "BITBUCKET_COMMIT"
2623
+ ],
2624
+ [
2625
+ "BITRISE",
2626
+ "BITRISE_IO"
2627
+ ],
2628
+ [
2629
+ "BUDDY",
2630
+ "BUDDY_WORKSPACE_ID"
2631
+ ],
2632
+ [
2633
+ "BUILDKITE"
2634
+ ],
2635
+ [
2636
+ "CIRCLE",
2637
+ "CIRCLECI"
2638
+ ],
2639
+ [
2640
+ "CIRRUS",
2641
+ "CIRRUS_CI"
2642
+ ],
2643
+ [
2644
+ "CLOUDFLARE_PAGES",
2645
+ "CF_PAGES",
2646
+ {
2647
+ ci: !0
2648
+ }
2649
+ ],
2650
+ [
2651
+ "CLOUDFLARE_WORKERS",
2652
+ "WORKERS_CI",
2653
+ {
2654
+ ci: !0
2655
+ }
2656
+ ],
2657
+ [
2658
+ "CODEBUILD",
2659
+ "CODEBUILD_BUILD_ARN"
2660
+ ],
2661
+ [
2662
+ "CODEFRESH",
2663
+ "CF_BUILD_ID"
2664
+ ],
2665
+ [
2666
+ "DRONE"
2667
+ ],
2668
+ [
2669
+ "DRONE",
2670
+ "DRONE_BUILD_EVENT"
2671
+ ],
2672
+ [
2673
+ "DSARI"
2674
+ ],
2675
+ [
2676
+ "GITHUB_ACTIONS"
2677
+ ],
2678
+ [
2679
+ "GITLAB",
2680
+ "GITLAB_CI"
2681
+ ],
2682
+ [
2683
+ "GITLAB",
2684
+ "CI_MERGE_REQUEST_ID"
2685
+ ],
2686
+ [
2687
+ "GOCD",
2688
+ "GO_PIPELINE_LABEL"
2689
+ ],
2690
+ [
2691
+ "LAYERCI"
2692
+ ],
2693
+ [
2694
+ "HUDSON",
2695
+ "HUDSON_URL"
2696
+ ],
2697
+ [
2698
+ "JENKINS",
2699
+ "JENKINS_URL"
2700
+ ],
2701
+ [
2702
+ "MAGNUM"
2703
+ ],
2704
+ [
2705
+ "NETLIFY"
2706
+ ],
2707
+ [
2708
+ "NETLIFY",
2709
+ "NETLIFY_LOCAL",
2710
+ {
2711
+ ci: !1
2712
+ }
2713
+ ],
2714
+ [
2715
+ "NEVERCODE"
2716
+ ],
2717
+ [
2718
+ "RENDER"
2719
+ ],
2720
+ [
2721
+ "SAIL",
2722
+ "SAILCI"
2723
+ ],
2724
+ [
2725
+ "SEMAPHORE"
2726
+ ],
2727
+ [
2728
+ "SCREWDRIVER"
2729
+ ],
2730
+ [
2731
+ "SHIPPABLE"
2732
+ ],
2733
+ [
2734
+ "SOLANO",
2735
+ "TDDIUM"
2736
+ ],
2737
+ [
2738
+ "STRIDER"
2739
+ ],
2740
+ [
2741
+ "TEAMCITY",
2742
+ "TEAMCITY_VERSION"
2743
+ ],
2744
+ [
2745
+ "TRAVIS"
2746
+ ],
2747
+ [
2748
+ "VERCEL",
2749
+ "NOW_BUILDER"
2750
+ ],
2751
+ [
2752
+ "VERCEL",
2753
+ "VERCEL",
2754
+ {
2755
+ ci: !1
2756
+ }
2757
+ ],
2758
+ [
2759
+ "VERCEL",
2760
+ "VERCEL_ENV",
2761
+ {
2762
+ ci: !1
2763
+ }
2764
+ ],
2765
+ [
2766
+ "APPCENTER",
2767
+ "APPCENTER_BUILD_ID"
2768
+ ],
2769
+ [
2770
+ "CODESANDBOX",
2771
+ "CODESANDBOX_SSE",
2772
+ {
2773
+ ci: !1
2774
+ }
2775
+ ],
2776
+ [
2777
+ "CODESANDBOX",
2778
+ "CODESANDBOX_HOST",
2779
+ {
2780
+ ci: !1
2781
+ }
2782
+ ],
2783
+ [
2784
+ "STACKBLITZ"
2785
+ ],
2786
+ [
2787
+ "STORMKIT"
2788
+ ],
2789
+ [
2790
+ "CLEAVR"
2791
+ ],
2792
+ [
2793
+ "ZEABUR"
2794
+ ],
2795
+ [
2796
+ "CODESPHERE",
2797
+ "CODESPHERE_APP_ID",
2798
+ {
2799
+ ci: !0
2800
+ }
2801
+ ],
2802
+ [
2803
+ "RAILWAY",
2804
+ "RAILWAY_PROJECT_ID"
2805
+ ],
2806
+ [
2807
+ "RAILWAY",
2808
+ "RAILWAY_SERVICE_ID"
2809
+ ],
2810
+ [
2811
+ "DENO-DEPLOY",
2812
+ "DENO_DEPLOYMENT_ID"
2813
+ ],
2814
+ [
2815
+ "FIREBASE_APP_HOSTING",
2816
+ "FIREBASE_APP_HOSTING",
2817
+ {
2818
+ ci: !0
2819
+ }
2820
+ ]
2821
+ ];
2822
+ function b() {
2823
+ if (globalThis.process?.env) for (const e of f){
2824
+ const s = e[1] || e[0];
2825
+ if (globalThis.process?.env[s]) return {
2826
+ name: e[0].toLowerCase(),
2827
+ ...e[2]
2828
+ };
2829
+ }
2830
+ return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? {
2831
+ name: "stackblitz",
2832
+ ci: !1
2833
+ } : {
2834
+ name: "",
2835
+ ci: !1
2836
+ };
2837
+ }
2838
+ const l = b();
2839
+ l.name;
2840
+ function n(e) {
2841
+ return e ? "false" !== e : !1;
2842
+ }
2843
+ const I = globalThis.process?.platform || "", T = n(o.CI) || !1 !== l.ci, R = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY), A = (n(o.DEBUG), "test" === t || n(o.TEST), n(o.MINIMAL), /^win/i.test(I)), C = (/^linux/i.test(I), /^darwin/i.test(I), !n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (R || A) && o.TERM), (globalThis.process?.versions?.node || "").replace(/^v/, "") || null), W = (Number(C?.split(".")[0]), globalThis.process || Object.create(null)), dist_ = {
2844
+ versions: {}
2845
+ }, O = (new Proxy(W, {
2846
+ get (e, s) {
2847
+ if ("env" === s) return o;
2848
+ if (s in e) return e[s];
2849
+ if (s in dist_) return dist_[s];
2850
+ }
2851
+ }), globalThis.process?.release?.name === "node"), c = !!globalThis.Bun || !!globalThis.process?.versions?.bun, D = !!globalThis.Deno, L = !!globalThis.fastly, S = !!globalThis.Netlify, u = !!globalThis.EdgeRuntime, N = globalThis.navigator?.userAgent === "Cloudflare-Workers", F = [
2852
+ [
2853
+ S,
2854
+ "netlify"
2855
+ ],
2856
+ [
2857
+ u,
2858
+ "edge-light"
2859
+ ],
2860
+ [
2861
+ N,
2862
+ "workerd"
2863
+ ],
2864
+ [
2865
+ L,
2866
+ "fastly"
2867
+ ],
2868
+ [
2869
+ D,
2870
+ "deno"
2871
+ ],
2872
+ [
2873
+ c,
2874
+ "bun"
2875
+ ],
2876
+ [
2877
+ O,
2878
+ "node"
2879
+ ]
2880
+ ];
2881
+ function G() {
2882
+ const e = F.find((s)=>s[0]);
2883
+ if (e) return {
2884
+ name: e[1]
2885
+ };
2886
+ }
2887
+ const P = G();
2888
+ P?.name;
2889
+ var src_config = __webpack_require__("./src/config.ts");
2890
+ var stack_trace_parser_esm = __webpack_require__("../../node_modules/.pnpm/stacktrace-parser@0.1.11/node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js");
2891
+ var utils = __webpack_require__("./src/utils/index.ts");
2892
+ var dist = __webpack_require__("../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs");
2893
+ const getSummaryStatusString = (tasks, name = 'tests', showTotal = true)=>{
2894
+ if (0 === tasks.length) return utils.yW.dim(`no ${name}`);
2895
+ const passed = tasks.filter((result)=>'pass' === result.status);
2896
+ const failed = tasks.filter((result)=>'fail' === result.status);
2897
+ const skipped = tasks.filter((result)=>'skip' === result.status);
2898
+ const todo = tasks.filter((result)=>'todo' === result.status);
2899
+ const status = [
2900
+ failed.length ? utils.yW.bold(utils.yW.red(`${failed.length} failed`)) : null,
2901
+ passed.length ? utils.yW.bold(utils.yW.green(`${passed.length} passed`)) : null,
2902
+ skipped.length ? utils.yW.yellow(`${skipped.length} skipped`) : null,
2903
+ todo.length ? utils.yW.gray(`${todo.length} todo`) : null
2904
+ ].filter(Boolean);
2905
+ return status.join(utils.yW.dim(' | ')) + (showTotal && status.length > 1 ? utils.yW.gray(` (${tasks.length})`) : '');
2906
+ };
2907
+ const printSnapshotSummaryLog = (snapshots, rootDir)=>{
2908
+ const summary = [];
2909
+ if (snapshots.added) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.added} written`)));
2910
+ if (snapshots.unmatched) summary.push(utils.yW.bold(utils.yW.red(`${snapshots.unmatched} failed`)));
2911
+ if (snapshots.updated) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.updated} updated `)));
2912
+ if (snapshots.filesRemoved) if (snapshots.didUpdate) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.filesRemoved} files removed `)));
2913
+ else summary.push(utils.yW.bold(utils.yW.yellow(`${snapshots.filesRemoved} files obsolete `)));
2914
+ const POINTER = '➜';
2915
+ if (snapshots.filesRemovedList?.length) {
2916
+ const [head, ...tail] = snapshots.filesRemovedList;
2917
+ summary.push(`${utils.yW.gray(POINTER)} ${(0, utils.XJ)(rootDir, head)}`);
2918
+ for (const key of tail)summary.push(` ${(0, utils.XJ)(rootDir, key)}`);
2919
+ }
2920
+ if (snapshots.unchecked) {
2921
+ if (snapshots.didUpdate) summary.push(utils.yW.bold(utils.yW.green(`${snapshots.unchecked} removed`)));
2922
+ else summary.push(utils.yW.bold(utils.yW.yellow(`${snapshots.unchecked} obsolete`)));
2923
+ for (const uncheckedFile of snapshots.uncheckedKeysByFile){
2924
+ summary.push(`${utils.yW.gray(POINTER)} ${(0, utils.XJ)(rootDir, uncheckedFile.filePath)}`);
2925
+ for (const key of uncheckedFile.keys)summary.push(` ${key}`);
2926
+ }
2927
+ }
2928
+ for (const [index, snapshot] of summary.entries()){
2929
+ const title = 0 === index ? 'Snapshots' : '';
2930
+ utils.vF.log(`${utils.yW.gray(title.padStart(12))} ${snapshot}`);
2931
+ }
2932
+ };
2933
+ const TestFileSummaryLabel = utils.yW.gray('Test Files'.padStart(11));
2934
+ const TestSummaryLabel = utils.yW.gray('Tests'.padStart(11));
2935
+ const DurationLabel = utils.yW.gray('Duration'.padStart(11));
2936
+ const printSummaryLog = ({ results, testResults, snapshotSummary, duration, rootPath })=>{
2937
+ utils.vF.log('');
2938
+ printSnapshotSummaryLog(snapshotSummary, rootPath);
2939
+ utils.vF.log(`${TestFileSummaryLabel} ${getSummaryStatusString(results)}`);
2940
+ utils.vF.log(`${TestSummaryLabel} ${getSummaryStatusString(testResults)}`);
2941
+ utils.vF.log(`${DurationLabel} ${(0, utils.kV)(duration.totalTime)} ${utils.yW.gray(`(build ${(0, utils.kV)(duration.buildTime)}, tests ${(0, utils.kV)(duration.testTime)})`)}`);
2942
+ utils.vF.log('');
2943
+ };
2944
+ const printSummaryErrorLogs = async ({ testResults, results, rootPath, getSourcemap, filterRerunTestPaths })=>{
2945
+ const failedTests = [
2946
+ ...results.filter((i)=>'fail' === i.status && i.errors?.length && (filterRerunTestPaths ? filterRerunTestPaths.includes(i.testPath) : true)),
2947
+ ...testResults.filter((i)=>'fail' === i.status && (filterRerunTestPaths ? filterRerunTestPaths.includes(i.testPath) : true))
2948
+ ];
2949
+ if (0 === failedTests.length) return;
2950
+ utils.vF.log('');
2951
+ utils.vF.log(utils.yW.bold('Summary of all failing tests:'));
2952
+ utils.vF.log('');
2953
+ for (const test of failedTests){
2954
+ const relativePath = dist.Ay.relative(rootPath, test.testPath);
2955
+ const nameStr = (0, utils.fN)(test);
2956
+ utils.vF.log(`${utils.yW.bgRed(' FAIL ')} ${(0, utils.EQ)(relativePath)} ${nameStr.length ? `${utils.yW.dim(utils.vO)} ${nameStr}` : ''}`);
2957
+ if (test.errors) {
2958
+ const { printError } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./src/utils/error.ts"));
2959
+ for (const error of test.errors)await printError(error, getSourcemap, rootPath);
2960
+ }
2961
+ }
2962
+ };
2963
+ const DEFAULT_RENDER_INTERVAL_MS = 1000;
2964
+ const ESC = '\x1B[';
2965
+ const CLEAR_LINE = `${ESC}K`;
2966
+ const MOVE_CURSOR_ONE_ROW_UP = `${ESC}1A`;
2967
+ const SYNC_START = `${ESC}?2026h`;
2968
+ const SYNC_END = `${ESC}?2026l`;
2969
+ class WindowRenderer {
2970
+ options;
2971
+ streams;
2972
+ buffer = [];
2973
+ renderInterval = void 0;
2974
+ renderScheduled = false;
2975
+ windowHeight = 0;
2976
+ finished = false;
2977
+ cleanups = [];
2978
+ constructor(options){
2979
+ this.options = {
2980
+ interval: DEFAULT_RENDER_INTERVAL_MS,
2981
+ ...options
2982
+ };
2983
+ this.streams = {
2984
+ output: options.logger.outputStream.write.bind(options.logger.outputStream),
2985
+ error: options.logger.errorStream.write.bind(options.logger.errorStream)
2986
+ };
2987
+ this.cleanups.push(this.interceptStream(process.stdout, 'output'), this.interceptStream(process.stderr, 'error'));
2988
+ this.start();
2989
+ }
2990
+ start() {
2991
+ this.finished = false;
2992
+ this.renderInterval = setInterval(()=>this.schedule(), this.options.interval).unref();
2993
+ }
2994
+ stop() {
2995
+ this.cleanups.splice(0).map((fn)=>fn());
2996
+ clearInterval(this.renderInterval);
2997
+ }
2998
+ finish() {
2999
+ this.finished = true;
3000
+ this.flushBuffer();
3001
+ clearInterval(this.renderInterval);
3002
+ }
3003
+ schedule() {
3004
+ if (!this.renderScheduled) {
3005
+ this.renderScheduled = true;
3006
+ this.flushBuffer();
3007
+ setTimeout(()=>{
3008
+ this.renderScheduled = false;
3009
+ }, 100).unref();
3010
+ }
3011
+ }
3012
+ flushBuffer() {
3013
+ if (0 === this.buffer.length) return this.render();
3014
+ let current;
3015
+ for (const next of this.buffer.splice(0)){
3016
+ if (!current) {
3017
+ current = next;
3018
+ continue;
3019
+ }
3020
+ if (current.type !== next.type) {
3021
+ this.render(current.message, current.type);
3022
+ current = next;
3023
+ continue;
3024
+ }
3025
+ current.message += next.message;
3026
+ }
3027
+ if (current) this.render(current?.message, current?.type);
3028
+ }
3029
+ render(message, type = 'output') {
3030
+ if (this.finished) {
3031
+ this.clearWindow();
3032
+ return this.write(message || '', type);
3033
+ }
3034
+ const windowContent = this.options.getWindow();
3035
+ const rowCount = getRenderedRowCount(windowContent, this.options.logger.getColumns());
3036
+ let padding = this.windowHeight - rowCount;
3037
+ if (padding > 0 && message) padding -= getRenderedRowCount([
3038
+ message
3039
+ ], this.options.logger.getColumns());
3040
+ this.write(SYNC_START);
3041
+ this.clearWindow();
3042
+ if (message) this.write(message, type);
3043
+ if (padding > 0) this.write('\n'.repeat(padding));
3044
+ this.write(windowContent.join('\n'));
3045
+ this.write(SYNC_END);
3046
+ this.windowHeight = rowCount + Math.max(0, padding);
3047
+ }
3048
+ clearWindow() {
3049
+ if (0 === this.windowHeight) return;
3050
+ this.write(CLEAR_LINE);
3051
+ for(let i = 1; i < this.windowHeight; i++)this.write(`${MOVE_CURSOR_ONE_ROW_UP}${CLEAR_LINE}`);
3052
+ this.windowHeight = 0;
3053
+ }
3054
+ interceptStream(stream, type) {
3055
+ const original = stream.write.bind(stream);
3056
+ stream.write = (chunk, _, callback)=>{
3057
+ if (chunk) if (this.finished) this.write(chunk.toString(), type);
3058
+ else this.buffer.push({
3059
+ type,
3060
+ message: chunk.toString()
3061
+ });
3062
+ callback?.();
3063
+ };
3064
+ return function restore() {
3065
+ stream.write = original;
3066
+ };
3067
+ }
3068
+ write(message, type = 'output') {
3069
+ this.streams[type](message);
3070
+ }
3071
+ }
3072
+ function getRenderedRowCount(rows, columns) {
3073
+ let count = 0;
3074
+ for (const row of rows){
3075
+ const text = (0, __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__.stripVTControlCharacters)(row);
3076
+ count += Math.max(1, Math.ceil(text.length / columns));
3077
+ }
3078
+ return count;
3079
+ }
3080
+ class StatusRenderer {
3081
+ rootPath;
3082
+ renderer;
3083
+ runningModules = new Map();
3084
+ testModules = [];
3085
+ startTime = void 0;
3086
+ constructor(rootPath){
3087
+ this.rootPath = rootPath;
3088
+ this.renderer = new WindowRenderer({
3089
+ getWindow: ()=>this.getContent(),
3090
+ logger: {
3091
+ outputStream: process.stdout,
3092
+ errorStream: process.stderr,
3093
+ getColumns: ()=>'columns' in process.stdout ? process.stdout.columns : 80
3094
+ }
3095
+ });
3096
+ }
3097
+ getContent() {
3098
+ this.startTime ??= Date.now();
3099
+ const summary = [];
3100
+ for (const module of this.runningModules.keys()){
3101
+ const relativePath = (0, pathe_M_eThtNZ.b)(this.rootPath, module);
3102
+ summary.push(`${utils.yW.bgYellow(utils.yW.bold(' RUNS '))} ${(0, utils.EQ)(relativePath)}`);
3103
+ }
3104
+ summary.push('');
3105
+ if (0 === this.testModules.length) summary.push(`${TestFileSummaryLabel} ${this.runningModules.size} total`);
3106
+ else summary.push(`${TestFileSummaryLabel} ${getSummaryStatusString(this.testModules, '', false)} ${utils.yW.dim('|')} ${this.runningModules.size + this.testModules.length} total`);
3107
+ const testResults = Array.from(this.runningModules.values()).flat().concat(this.testModules.flatMap((mod)=>mod.results));
3108
+ if (testResults.length) summary.push(`${TestSummaryLabel} ${getSummaryStatusString(testResults, '', false)}`);
3109
+ summary.push(`${DurationLabel} ${(0, utils.kV)(Date.now() - this.startTime)}`);
3110
+ summary.push('');
3111
+ return summary;
3112
+ }
3113
+ onTestFileStart(testPath) {
3114
+ this.runningModules.set(testPath, []);
3115
+ this.renderer?.schedule();
3116
+ }
3117
+ onTestCaseResult(result) {
3118
+ this.runningModules.set(result.testPath, [
3119
+ ...this.runningModules.get(result.testPath) || [],
3120
+ result
3121
+ ]);
3122
+ }
3123
+ onTestFileResult(test) {
3124
+ this.runningModules.delete(test.testPath);
3125
+ this.testModules.push(test);
3126
+ this.renderer?.schedule();
3127
+ }
3128
+ clear() {
3129
+ this.testModules.length = 0;
3130
+ this.runningModules.clear();
3131
+ this.startTime = void 0;
3132
+ this.renderer?.finish();
3133
+ }
3134
+ }
3135
+ const statusStr = {
3136
+ fail: '✗',
3137
+ pass: '✓',
3138
+ todo: '-',
3139
+ skip: '-'
3140
+ };
3141
+ const statusColorfulStr = {
3142
+ fail: utils.yW.red(statusStr.fail),
3143
+ pass: utils.yW.green(statusStr.pass),
3144
+ todo: utils.yW.gray(statusStr.todo),
3145
+ skip: utils.yW.gray(statusStr.skip)
3146
+ };
3147
+ const logCase = (result, slowTestThreshold)=>{
3148
+ const isSlowCase = (result.duration || 0) > slowTestThreshold;
3149
+ const icon = isSlowCase && 'pass' === result.status ? utils.yW.yellow(statusStr[result.status]) : statusColorfulStr[result.status];
3150
+ const nameStr = (0, utils.fN)(result);
3151
+ const duration = void 0 !== result.duration ? ` (${(0, utils.kV)(result.duration)})` : '';
3152
+ const retry = result.retryCount ? utils.yW.yellow(` (retry x${result.retryCount})`) : '';
3153
+ utils.vF.log(` ${icon} ${nameStr}${utils.yW.gray(duration)}${retry}`);
3154
+ if (result.errors) for (const error of result.errors)console.error(utils.yW.red(` ${error.message}`));
3155
+ };
3156
+ const logFileTitle = (test, relativePath, alwaysShowTime = false)=>{
3157
+ let title = ` ${utils.yW.bold(statusColorfulStr[test.status])} ${(0, utils.EQ)(relativePath)}`;
3158
+ const formatDuration = (duration)=>utils.yW.green((0, utils.kV)(duration));
3159
+ title += ` ${utils.yW.gray(`(${test.results.length})`)}`;
3160
+ if (alwaysShowTime) title += ` ${formatDuration(test.duration)}`;
3161
+ utils.vF.log(title);
3162
+ };
3163
+ class DefaultReporter {
3164
+ rootPath;
3165
+ config;
3166
+ options = {};
3167
+ statusRenderer;
3168
+ constructor({ rootPath, options, config }){
3169
+ this.rootPath = rootPath;
3170
+ this.config = config;
3171
+ this.options = options;
3172
+ if (!T) this.statusRenderer = new StatusRenderer(rootPath);
3173
+ }
3174
+ onTestFileStart(test) {
3175
+ this.statusRenderer?.onTestFileStart(test.testPath);
3176
+ }
3177
+ onTestFileResult(test) {
3178
+ this.statusRenderer?.onTestFileResult(test);
3179
+ const relativePath = (0, pathe_M_eThtNZ.b)(this.rootPath, test.testPath);
3180
+ const { slowTestThreshold } = this.config;
3181
+ logFileTitle(test, relativePath);
3182
+ for (const result of test.results){
3183
+ const isDisplayed = 'fail' === result.status || (result.duration ?? 0) > slowTestThreshold || (result.retryCount ?? 0) > 0;
3184
+ isDisplayed && logCase(result, slowTestThreshold);
3185
+ }
3186
+ }
3187
+ onTestCaseResult(result) {
3188
+ this.statusRenderer?.onTestCaseResult(result);
3189
+ }
3190
+ onUserConsoleLog(log) {
3191
+ const shouldLog = this.config.onConsoleLog?.(log.content) ?? true;
3192
+ if (!shouldLog) return;
3193
+ const titles = [
3194
+ log.name
3195
+ ];
3196
+ const testPath = (0, pathe_M_eThtNZ.b)(this.rootPath, log.testPath);
3197
+ if (log.trace) {
3198
+ const [frame] = (0, stack_trace_parser_esm.q)(log.trace);
3199
+ const filePath = (0, pathe_M_eThtNZ.b)(this.rootPath, frame.file || '');
3200
+ if (filePath !== testPath) titles.push((0, utils.EQ)(testPath));
3201
+ titles.push((0, utils.EQ)(filePath) + utils.yW.gray(`:${frame.lineNumber}:${frame.column}`));
3202
+ } else titles.push((0, utils.EQ)(testPath));
3203
+ utils.vF.log(titles.join(utils.yW.gray(' | ')));
3204
+ utils.vF.log(log.content);
3205
+ utils.vF.log('');
3206
+ }
3207
+ async onExit() {
3208
+ this.statusRenderer?.clear();
3209
+ }
3210
+ async onTestRunEnd({ results, testResults, duration, getSourcemap, snapshotSummary, filterRerunTestPaths }) {
3211
+ this.statusRenderer?.clear();
3212
+ if (false === this.options.summary) return;
3213
+ await printSummaryErrorLogs({
3214
+ testResults,
3215
+ results,
3216
+ rootPath: this.rootPath,
3217
+ getSourcemap,
3218
+ filterRerunTestPaths
3219
+ });
3220
+ printSummaryLog({
3221
+ results,
3222
+ testResults,
3223
+ duration,
3224
+ rootPath: this.rootPath,
3225
+ snapshotSummary
3226
+ });
3227
+ }
3228
+ }
3229
+ class GithubActionsReporter {
3230
+ onWritePath;
3231
+ rootPath;
3232
+ constructor({ options, rootPath }){
3233
+ this.onWritePath = options.onWritePath;
3234
+ this.rootPath = rootPath;
3235
+ }
3236
+ log(message) {
3237
+ console.log(`${message}\n`);
3238
+ }
3239
+ async onTestRunEnd({ results, testResults, getSourcemap }) {
3240
+ const failedTests = [
3241
+ ...results.filter((i)=>'fail' === i.status && i.errors?.length),
3242
+ ...testResults.filter((i)=>'fail' === i.status)
3243
+ ];
3244
+ if (0 === failedTests.length) return;
3245
+ const { parseErrorStacktrace } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./src/utils/error.ts"));
3246
+ const logs = [];
3247
+ for (const test of failedTests){
3248
+ const { testPath } = test;
3249
+ const nameStr = (0, utils.fN)(test);
3250
+ const shortPath = (0, pathe_M_eThtNZ.b)(this.rootPath, testPath);
3251
+ const title = `${shortPath} ${utils.vO} ${nameStr}`;
3252
+ for (const error of test.errors || []){
3253
+ let file = testPath;
3254
+ let line = 1;
3255
+ let column = 1;
3256
+ const message = `${error.message}${error.diff ? `\n${error.diff}` : ''}`;
3257
+ const type = 'error';
3258
+ if (error.stack) {
3259
+ const stackFrames = await parseErrorStacktrace({
3260
+ stack: error.stack,
3261
+ fullStack: error.fullStack,
3262
+ getSourcemap
3263
+ });
3264
+ if (stackFrames[0]) {
3265
+ file = stackFrames[0].file || test.testPath;
3266
+ line = stackFrames[0].lineNumber || 1;
3267
+ column = stackFrames[0].column || 1;
3268
+ }
3269
+ }
3270
+ logs.push(`::${type} file=${this.onWritePath?.(file) || file},line=${line},col=${column},title=${escapeData(title)}::${escapeData(message)}`);
3271
+ }
3272
+ }
3273
+ this.log('::group::error for github actions');
3274
+ for (const log of logs)this.log(log);
3275
+ this.log('::endgroup::');
3276
+ }
3277
+ }
3278
+ function escapeData(s) {
3279
+ return s.replace(/%/g, '%25').replace(/\r/g, '%0D').replace(/\n/g, '%0A').replace(/:/g, '%3A').replace(/,/g, '%2C');
3280
+ }
3281
+ var promises_ = __webpack_require__("node:fs/promises");
3282
+ function ansiRegex({ onlyFirst = false } = {}) {
3283
+ const ST = '(?:\\u0007|\\u001B\\u005C|\\u009C)';
3284
+ const pattern = [
3285
+ `[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
3286
+ '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))'
3287
+ ].join('|');
3288
+ return new RegExp(pattern, onlyFirst ? void 0 : 'g');
3289
+ }
3290
+ const regex = ansiRegex();
3291
+ function stripAnsi(string) {
3292
+ if ('string' != typeof string) throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
3293
+ return string.replace(regex, '');
3294
+ }
3295
+ var utils_error = __webpack_require__("./src/utils/error.ts");
3296
+ class JUnitReporter {
3297
+ rootPath;
3298
+ outputPath;
3299
+ constructor({ rootPath, options: { outputPath } = {} }){
3300
+ this.rootPath = rootPath;
3301
+ this.outputPath = outputPath;
3302
+ }
3303
+ sanitizeXml(text) {
3304
+ let result = '';
3305
+ for (const ch of stripAnsi(text)){
3306
+ const cp = ch.codePointAt(0);
3307
+ const valid = 0x09 === cp || 0x0a === cp || 0x0d === cp || cp >= 0x20 && cp <= 0xd7ff || cp >= 0xe000 && cp <= 0xfffd || cp >= 0x10000 && cp <= 0x10ffff;
3308
+ if (valid) result += ch;
3309
+ }
3310
+ return result;
3311
+ }
3312
+ escapeXml(text) {
3313
+ const sanitized = this.sanitizeXml(text);
3314
+ return sanitized.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&apos;');
3315
+ }
3316
+ async createJUnitTestCase(test, getSourcemap) {
3317
+ const testCase = {
3318
+ name: (0, utils.fN)(test),
3319
+ classname: (0, pathe_M_eThtNZ.b)(this.rootPath, test.testPath),
3320
+ time: (test.duration || 0) / 1000,
3321
+ status: test.status
3322
+ };
3323
+ if (test.errors && test.errors.length > 0) testCase.errors = await Promise.all(test.errors.map(async (error)=>{
3324
+ let details = `${error.message}${error.diff ? `\n${error.diff}` : ''}`;
3325
+ const stackFrames = error.stack ? await (0, utils_error.parseErrorStacktrace)({
3326
+ stack: error.stack,
3327
+ fullStack: error.fullStack,
3328
+ getSourcemap
3329
+ }) : [];
3330
+ if (stackFrames[0]) details += `\n${(0, utils_error.C)(stackFrames[0], this.rootPath)}`;
3331
+ return {
3332
+ message: this.escapeXml(error.message),
3333
+ type: error.name || 'Error',
3334
+ details: this.escapeXml(details)
3335
+ };
3336
+ }));
3337
+ return testCase;
3338
+ }
3339
+ async createJUnitTestSuite(fileResult, getSourcemap) {
3340
+ const testCases = await Promise.all(fileResult.results.map(async (test)=>this.createJUnitTestCase(test, getSourcemap)));
3341
+ const failures = testCases.filter((test)=>'fail' === test.status).length;
3342
+ const errors = 0;
3343
+ const skipped = testCases.filter((test)=>'skip' === test.status || 'todo' === test.status).length;
3344
+ const totalTime = testCases.reduce((sum, test)=>sum + test.time, 0);
3345
+ return {
3346
+ name: (0, pathe_M_eThtNZ.b)(this.rootPath, fileResult.testPath),
3347
+ tests: testCases.length,
3348
+ failures,
3349
+ errors,
3350
+ skipped,
3351
+ time: totalTime,
3352
+ timestamp: new Date().toISOString(),
3353
+ testcases: testCases
3354
+ };
3355
+ }
3356
+ generateJUnitXml(report) {
3357
+ const xmlDeclaration = '<?xml version="1.0" encoding="UTF-8"?>';
3358
+ const testsuitesXml = `
3359
+ <testsuites name="${this.escapeXml(report.testsuites.name)}" tests="${report.testsuites.tests}" failures="${report.testsuites.failures}" errors="${report.testsuites.errors}" skipped="${report.testsuites.skipped}" time="${report.testsuites.time}" timestamp="${this.escapeXml(report.testsuites.timestamp)}">`;
3360
+ const testsuiteXmls = report.testsuites.testsuite.map((suite)=>{
3361
+ const testsuiteStart = `
3362
+ <testsuite name="${this.escapeXml(suite.name)}" tests="${suite.tests}" failures="${suite.failures}" errors="${suite.errors}" skipped="${suite.skipped}" time="${suite.time}" timestamp="${this.escapeXml(suite.timestamp)}">`;
3363
+ const testcaseXmls = suite.testcases.map((testcase)=>{
3364
+ let testcaseXml = `
3365
+ <testcase name="${this.escapeXml(testcase.name)}" classname="${this.escapeXml(testcase.classname)}" time="${testcase.time}">`;
3366
+ if ('skip' === testcase.status || 'todo' === testcase.status) testcaseXml += `
3367
+ <skipped/>`;
3368
+ else if ('fail' === testcase.status && testcase.errors) testcase.errors.forEach((error)=>{
3369
+ testcaseXml += `
3370
+ <failure message="${error.message}" type="${error.type}">${error.details || ''}</failure>`;
3371
+ });
3372
+ testcaseXml += `
3373
+ </testcase>`;
3374
+ return testcaseXml;
3375
+ }).join('');
3376
+ const testsuiteEnd = `
3377
+ </testsuite>`;
3378
+ return testsuiteStart + testcaseXmls + testsuiteEnd;
3379
+ }).join('');
3380
+ const testsuitesEnd = `
3381
+ </testsuites>`;
3382
+ return xmlDeclaration + testsuitesXml + testsuiteXmls + testsuitesEnd;
3383
+ }
3384
+ async onTestRunEnd({ results, testResults, duration, getSourcemap }) {
3385
+ const testSuites = await Promise.all(results.map(async (fileResult)=>this.createJUnitTestSuite(fileResult, getSourcemap)));
3386
+ const totalTests = testResults.length;
3387
+ const totalFailures = testResults.filter((test)=>'fail' === test.status).length;
3388
+ const totalErrors = 0;
3389
+ const totalSkipped = testResults.filter((test)=>'skip' === test.status || 'todo' === test.status).length;
3390
+ const totalTime = duration.testTime / 1000;
3391
+ const report = {
3392
+ testsuites: {
3393
+ name: 'rstest tests',
3394
+ tests: totalTests,
3395
+ failures: totalFailures,
3396
+ errors: totalErrors,
3397
+ skipped: totalSkipped,
3398
+ time: totalTime,
3399
+ timestamp: new Date().toISOString(),
3400
+ testsuite: testSuites
3401
+ }
3402
+ };
3403
+ const xmlContent = this.generateJUnitXml(report);
3404
+ if (this.outputPath) try {
3405
+ await (0, promises_.writeFile)(this.outputPath, xmlContent, 'utf-8');
3406
+ console.log(`JUnit XML report written to: ${this.outputPath}`);
3407
+ } catch (error) {
3408
+ console.error(`Failed to write JUnit XML report to ${this.outputPath}:`, error);
3409
+ console.log('JUnit XML Report:');
3410
+ console.log(xmlContent);
3411
+ }
3412
+ else console.log(xmlContent);
3413
+ }
3414
+ }
3415
+ class VerboseReporter extends DefaultReporter {
3416
+ onTestFileResult(test) {
3417
+ this.statusRenderer?.onTestFileResult(test);
3418
+ const relativePath = (0, pathe_M_eThtNZ.b)(this.rootPath, test.testPath);
3419
+ const { slowTestThreshold } = this.config;
3420
+ logFileTitle(test, relativePath, true);
3421
+ for (const result of test.results)logCase(result, slowTestThreshold);
3422
+ }
3423
+ }
3424
+ function formatEnvironmentName(name) {
3425
+ return name.replace(/[^a-zA-Z0-9\-_$]/g, '_');
3426
+ }
3427
+ class Rstest {
3428
+ cwd;
3429
+ command;
3430
+ fileFilters;
3431
+ configFilePath;
3432
+ reporters;
3433
+ snapshotManager;
3434
+ version;
3435
+ rootPath;
3436
+ originalConfig;
3437
+ normalizedConfig;
3438
+ idMap = new Map();
3439
+ reporterResults = {
3440
+ results: [],
3441
+ testResults: []
3442
+ };
3443
+ projects = [];
3444
+ constructor({ cwd = process.cwd(), command, fileFilters, configFilePath, projects }, userConfig){
3445
+ this.cwd = cwd;
3446
+ this.command = command;
3447
+ this.fileFilters = fileFilters;
3448
+ this.configFilePath = configFilePath;
3449
+ const rootPath = userConfig.root ? (0, utils.FI)(cwd, userConfig.root) : cwd;
3450
+ const rstestConfig = (0, src_config.wX)({
3451
+ ...userConfig,
3452
+ root: rootPath
3453
+ });
3454
+ const reporters = 'list' !== command ? createReporters(rstestConfig.reporters, {
3455
+ rootPath,
3456
+ config: rstestConfig
3457
+ }) : [];
3458
+ const snapshotManager = new SnapshotManager({
3459
+ updateSnapshot: rstestConfig.update ? 'all' : T ? 'none' : 'new'
3460
+ });
3461
+ this.reporters = reporters;
3462
+ this.snapshotManager = snapshotManager;
3463
+ this.version = "0.5.3";
3464
+ this.rootPath = rootPath;
3465
+ this.originalConfig = userConfig;
3466
+ this.normalizedConfig = rstestConfig;
3467
+ this.projects = projects.length ? projects.map((project)=>{
3468
+ const config = (0, src_config.wX)(project.config);
3469
+ config.isolate = rstestConfig.isolate;
3470
+ config.source ??= {};
3471
+ config.coverage = rstestConfig.coverage;
3472
+ if (!config.source.tsconfigPath) {
3473
+ const tsconfigPath = (0, pathe_M_eThtNZ.j)(config.root, utils.WB);
3474
+ if ((0, external_node_fs_.existsSync)(tsconfigPath)) config.source.tsconfigPath = tsconfigPath;
3475
+ }
3476
+ return {
3477
+ configFilePath: project.configFilePath,
3478
+ rootPath: config.root,
3479
+ name: config.name,
3480
+ environmentName: formatEnvironmentName(config.name),
3481
+ normalizedConfig: config
3482
+ };
3483
+ }) : [
3484
+ {
3485
+ configFilePath,
3486
+ rootPath,
3487
+ name: rstestConfig.name,
3488
+ environmentName: formatEnvironmentName(rstestConfig.name),
3489
+ normalizedConfig: rstestConfig
3490
+ }
3491
+ ];
3492
+ }
3493
+ updateReporterResultState(results, testResults, deletedEntries = []) {
3494
+ results.forEach((item)=>{
3495
+ const existingIndex = this.reporterResults.results.findIndex((r)=>r.testPath === item.testPath);
3496
+ if (-1 !== existingIndex) this.reporterResults.results[existingIndex] = item;
3497
+ else this.reporterResults.results.push(item);
3498
+ });
3499
+ const testPathsToUpdate = new Set(testResults.map((r)=>r.testPath));
3500
+ this.reporterResults.testResults = this.reporterResults.testResults.filter((r)=>!testPathsToUpdate.has(r.testPath));
3501
+ this.reporterResults.testResults.push(...testResults);
3502
+ if (deletedEntries.length > 0) {
3503
+ const deletedPathsSet = new Set(deletedEntries);
3504
+ this.reporterResults.results = this.reporterResults.results.filter((r)=>!deletedPathsSet.has(r.testPath));
3505
+ this.reporterResults.testResults = this.reporterResults.testResults.filter((r)=>!deletedPathsSet.has(r.testPath));
3506
+ }
3507
+ }
3508
+ }
3509
+ const reportersMap = {
3510
+ default: DefaultReporter,
3511
+ verbose: VerboseReporter,
3512
+ 'github-actions': GithubActionsReporter,
3513
+ junit: JUnitReporter
3514
+ };
3515
+ function createReporters(reporters, initOptions = {}) {
3516
+ const result = (0, utils.bg)(reporters).map((reporter)=>{
3517
+ if ('string' == typeof reporter || Array.isArray(reporter)) {
3518
+ const [name, options = {}] = 'string' == typeof reporter ? [
3519
+ reporter,
3520
+ {}
3521
+ ] : reporter;
3522
+ if (name in reportersMap) {
3523
+ const Reporter = reportersMap[name];
3524
+ return new Reporter({
3525
+ ...initOptions,
3526
+ options
3527
+ });
3528
+ }
3529
+ throw new Error(`Reporter ${reporter} not found. Please install it or use a built-in reporter.`);
3530
+ }
3531
+ return reporter;
3532
+ });
3533
+ return result;
3534
+ }
3535
+ __webpack_require__("./src/cli/index.ts");
3536
+ function createRstest({ config, projects, configFilePath }, command, fileFilters) {
3537
+ const context = new Rstest({
3538
+ cwd: process.cwd(),
3539
+ command,
3540
+ fileFilters,
3541
+ configFilePath,
3542
+ projects
3543
+ }, config);
3544
+ const runTests = async ()=>{
3545
+ const { runTests } = await Promise.all([
3546
+ __webpack_require__.e("816"),
3547
+ __webpack_require__.e("33")
3548
+ ]).then(__webpack_require__.bind(__webpack_require__, "./src/core/runTests.ts"));
3549
+ await runTests(context);
3550
+ };
3551
+ const listTests = async (options)=>{
3552
+ const { listTests } = await Promise.all([
3553
+ __webpack_require__.e("816"),
3554
+ __webpack_require__.e("971")
3555
+ ]).then(__webpack_require__.bind(__webpack_require__, "./src/core/listTests.ts"));
3556
+ await listTests(context, options);
3557
+ };
3558
+ return {
3559
+ context,
3560
+ runTests,
3561
+ listTests
3562
+ };
3563
+ }
3564
+ },
2245
3565
  "./src/utils/constants.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2246
3566
  __webpack_require__.d(__webpack_exports__, {
2247
3567
  EJ: ()=>TEMP_RSTEST_OUTPUT_DIR_GLOB,
@@ -2249,9 +3569,11 @@ ${section.body}` : section.body).join("\n\n"));
2249
3569
  WB: ()=>TS_CONFIG_FILE,
2250
3570
  kv: ()=>DEFAULT_CONFIG_EXTENSIONS,
2251
3571
  t: ()=>DEFAULT_CONFIG_NAME,
3572
+ vO: ()=>TEST_DELIMITER,
2252
3573
  zZ: ()=>TEMP_RSTEST_OUTPUT_DIR
2253
3574
  });
2254
3575
  const DEFAULT_CONFIG_NAME = 'rstest.config';
3576
+ const TEST_DELIMITER = '>';
2255
3577
  const TEMP_RSTEST_OUTPUT_DIR = 'dist/.rstest-temp';
2256
3578
  const TEMP_RSTEST_OUTPUT_DIR_GLOB = '**/dist/.rstest-temp';
2257
3579
  const DEFAULT_CONFIG_EXTENSIONS = [
@@ -2279,6 +3601,517 @@ ${section.body}` : section.body).join("\n\n"));
2279
3601
  ];
2280
3602
  const TS_CONFIG_FILE = 'tsconfig.json';
2281
3603
  },
3604
+ "./src/utils/error.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
3605
+ __webpack_require__.d(__webpack_exports__, {
3606
+ printError: ()=>printError,
3607
+ C: ()=>formatStack,
3608
+ parseErrorStacktrace: ()=>parseErrorStacktrace
3609
+ });
3610
+ var external_node_fs_ = __webpack_require__("node:fs");
3611
+ var comma = ",".charCodeAt(0);
3612
+ var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
3613
+ var intToChar = new Uint8Array(64);
3614
+ var charToInt = new Uint8Array(128);
3615
+ for(let i = 0; i < chars.length; i++){
3616
+ const c = chars.charCodeAt(i);
3617
+ intToChar[i] = c;
3618
+ charToInt[c] = i;
3619
+ }
3620
+ function decodeInteger(reader, relative) {
3621
+ let value = 0;
3622
+ let shift = 0;
3623
+ let integer = 0;
3624
+ do {
3625
+ const c = reader.next();
3626
+ integer = charToInt[c];
3627
+ value |= (31 & integer) << shift;
3628
+ shift += 5;
3629
+ }while (32 & integer);
3630
+ const shouldNegate = 1 & value;
3631
+ value >>>= 1;
3632
+ if (shouldNegate) value = -2147483648 | -value;
3633
+ return relative + value;
3634
+ }
3635
+ function hasMoreVlq(reader, max) {
3636
+ if (reader.pos >= max) return false;
3637
+ return reader.peek() !== comma;
3638
+ }
3639
+ typeof TextDecoder;
3640
+ var StringReader = class {
3641
+ constructor(buffer){
3642
+ this.pos = 0;
3643
+ this.buffer = buffer;
3644
+ }
3645
+ next() {
3646
+ return this.buffer.charCodeAt(this.pos++);
3647
+ }
3648
+ peek() {
3649
+ return this.buffer.charCodeAt(this.pos);
3650
+ }
3651
+ indexOf(char) {
3652
+ const { buffer, pos } = this;
3653
+ const idx = buffer.indexOf(char, pos);
3654
+ return -1 === idx ? buffer.length : idx;
3655
+ }
3656
+ };
3657
+ function decode(mappings) {
3658
+ const { length } = mappings;
3659
+ const reader = new StringReader(mappings);
3660
+ const decoded = [];
3661
+ let genColumn = 0;
3662
+ let sourcesIndex = 0;
3663
+ let sourceLine = 0;
3664
+ let sourceColumn = 0;
3665
+ let namesIndex = 0;
3666
+ do {
3667
+ const semi = reader.indexOf(";");
3668
+ const line = [];
3669
+ let sorted = true;
3670
+ let lastCol = 0;
3671
+ genColumn = 0;
3672
+ while(reader.pos < semi){
3673
+ let seg;
3674
+ genColumn = decodeInteger(reader, genColumn);
3675
+ if (genColumn < lastCol) sorted = false;
3676
+ lastCol = genColumn;
3677
+ if (hasMoreVlq(reader, semi)) {
3678
+ sourcesIndex = decodeInteger(reader, sourcesIndex);
3679
+ sourceLine = decodeInteger(reader, sourceLine);
3680
+ sourceColumn = decodeInteger(reader, sourceColumn);
3681
+ if (hasMoreVlq(reader, semi)) {
3682
+ namesIndex = decodeInteger(reader, namesIndex);
3683
+ seg = [
3684
+ genColumn,
3685
+ sourcesIndex,
3686
+ sourceLine,
3687
+ sourceColumn,
3688
+ namesIndex
3689
+ ];
3690
+ } else seg = [
3691
+ genColumn,
3692
+ sourcesIndex,
3693
+ sourceLine,
3694
+ sourceColumn
3695
+ ];
3696
+ } else seg = [
3697
+ genColumn
3698
+ ];
3699
+ line.push(seg);
3700
+ reader.pos++;
3701
+ }
3702
+ if (!sorted) sort(line);
3703
+ decoded.push(line);
3704
+ reader.pos = semi + 1;
3705
+ }while (reader.pos <= length);
3706
+ return decoded;
3707
+ }
3708
+ function sort(line) {
3709
+ line.sort(sortComparator);
3710
+ }
3711
+ function sortComparator(a, b) {
3712
+ return a[0] - b[0];
3713
+ }
3714
+ const schemeRegex = /^[\w+.-]+:\/\//;
3715
+ const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
3716
+ const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
3717
+ function isAbsoluteUrl(input) {
3718
+ return schemeRegex.test(input);
3719
+ }
3720
+ function isSchemeRelativeUrl(input) {
3721
+ return input.startsWith('//');
3722
+ }
3723
+ function isAbsolutePath(input) {
3724
+ return input.startsWith('/');
3725
+ }
3726
+ function isFileUrl(input) {
3727
+ return input.startsWith('file:');
3728
+ }
3729
+ function isRelative(input) {
3730
+ return /^[.?#]/.test(input);
3731
+ }
3732
+ function parseAbsoluteUrl(input) {
3733
+ const match = urlRegex.exec(input);
3734
+ return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || '');
3735
+ }
3736
+ function parseFileUrl(input) {
3737
+ const match = fileRegex.exec(input);
3738
+ const path = match[2];
3739
+ return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || '');
3740
+ }
3741
+ function makeUrl(scheme, user, host, port, path, query, hash) {
3742
+ return {
3743
+ scheme,
3744
+ user,
3745
+ host,
3746
+ port,
3747
+ path,
3748
+ query,
3749
+ hash,
3750
+ type: 7
3751
+ };
3752
+ }
3753
+ function parseUrl(input) {
3754
+ if (isSchemeRelativeUrl(input)) {
3755
+ const url = parseAbsoluteUrl('http:' + input);
3756
+ url.scheme = '';
3757
+ url.type = 6;
3758
+ return url;
3759
+ }
3760
+ if (isAbsolutePath(input)) {
3761
+ const url = parseAbsoluteUrl('http://foo.com' + input);
3762
+ url.scheme = '';
3763
+ url.host = '';
3764
+ url.type = 5;
3765
+ return url;
3766
+ }
3767
+ if (isFileUrl(input)) return parseFileUrl(input);
3768
+ if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);
3769
+ const url = parseAbsoluteUrl('http://foo.com/' + input);
3770
+ url.scheme = '';
3771
+ url.host = '';
3772
+ url.type = input ? input.startsWith('?') ? 3 : input.startsWith('#') ? 2 : 4 : 1;
3773
+ return url;
3774
+ }
3775
+ function stripPathFilename(path) {
3776
+ if (path.endsWith('/..')) return path;
3777
+ const index = path.lastIndexOf('/');
3778
+ return path.slice(0, index + 1);
3779
+ }
3780
+ function mergePaths(url, base) {
3781
+ normalizePath(base, base.type);
3782
+ if ('/' === url.path) url.path = base.path;
3783
+ else url.path = stripPathFilename(base.path) + url.path;
3784
+ }
3785
+ function normalizePath(url, type) {
3786
+ const rel = type <= 4;
3787
+ const pieces = url.path.split('/');
3788
+ let pointer = 1;
3789
+ let positive = 0;
3790
+ let addTrailingSlash = false;
3791
+ for(let i = 1; i < pieces.length; i++){
3792
+ const piece = pieces[i];
3793
+ if (!piece) {
3794
+ addTrailingSlash = true;
3795
+ continue;
3796
+ }
3797
+ addTrailingSlash = false;
3798
+ if ('.' !== piece) {
3799
+ if ('..' === piece) {
3800
+ if (positive) {
3801
+ addTrailingSlash = true;
3802
+ positive--;
3803
+ pointer--;
3804
+ } else if (rel) pieces[pointer++] = piece;
3805
+ continue;
3806
+ }
3807
+ pieces[pointer++] = piece;
3808
+ positive++;
3809
+ }
3810
+ }
3811
+ let path = '';
3812
+ for(let i = 1; i < pointer; i++)path += '/' + pieces[i];
3813
+ if (!path || addTrailingSlash && !path.endsWith('/..')) path += '/';
3814
+ url.path = path;
3815
+ }
3816
+ function resolve_uri_resolve(input, base) {
3817
+ if (!input && !base) return '';
3818
+ const url = parseUrl(input);
3819
+ let inputType = url.type;
3820
+ if (base && 7 !== inputType) {
3821
+ const baseUrl = parseUrl(base);
3822
+ const baseType = baseUrl.type;
3823
+ switch(inputType){
3824
+ case 1:
3825
+ url.hash = baseUrl.hash;
3826
+ case 2:
3827
+ url.query = baseUrl.query;
3828
+ case 3:
3829
+ case 4:
3830
+ mergePaths(url, baseUrl);
3831
+ case 5:
3832
+ url.user = baseUrl.user;
3833
+ url.host = baseUrl.host;
3834
+ url.port = baseUrl.port;
3835
+ case 6:
3836
+ url.scheme = baseUrl.scheme;
3837
+ }
3838
+ if (baseType > inputType) inputType = baseType;
3839
+ }
3840
+ normalizePath(url, inputType);
3841
+ const queryHash = url.query + url.hash;
3842
+ switch(inputType){
3843
+ case 2:
3844
+ case 3:
3845
+ return queryHash;
3846
+ case 4:
3847
+ {
3848
+ const path = url.path.slice(1);
3849
+ if (!path) return queryHash || '.';
3850
+ if (isRelative(base || input) && !isRelative(path)) return './' + path + queryHash;
3851
+ return path + queryHash;
3852
+ }
3853
+ case 5:
3854
+ return url.path + queryHash;
3855
+ default:
3856
+ return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;
3857
+ }
3858
+ }
3859
+ function stripFilename(path) {
3860
+ if (!path) return "";
3861
+ const index = path.lastIndexOf("/");
3862
+ return path.slice(0, index + 1);
3863
+ }
3864
+ function resolver(mapUrl, sourceRoot) {
3865
+ const from = stripFilename(mapUrl);
3866
+ const prefix = sourceRoot ? sourceRoot + "/" : "";
3867
+ return (source)=>resolve_uri_resolve(prefix + (source || ""), from);
3868
+ }
3869
+ var COLUMN = 0;
3870
+ var SOURCES_INDEX = 1;
3871
+ var SOURCE_LINE = 2;
3872
+ var SOURCE_COLUMN = 3;
3873
+ var NAMES_INDEX = 4;
3874
+ function maybeSort(mappings, owned) {
3875
+ const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
3876
+ if (unsortedIndex === mappings.length) return mappings;
3877
+ if (!owned) mappings = mappings.slice();
3878
+ for(let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1))mappings[i] = sortSegments(mappings[i], owned);
3879
+ return mappings;
3880
+ }
3881
+ function nextUnsortedSegmentLine(mappings, start) {
3882
+ for(let i = start; i < mappings.length; i++)if (!isSorted(mappings[i])) return i;
3883
+ return mappings.length;
3884
+ }
3885
+ function isSorted(line) {
3886
+ for(let j = 1; j < line.length; j++)if (line[j][COLUMN] < line[j - 1][COLUMN]) return false;
3887
+ return true;
3888
+ }
3889
+ function sortSegments(line, owned) {
3890
+ if (!owned) line = line.slice();
3891
+ return line.sort(trace_mapping_sortComparator);
3892
+ }
3893
+ function trace_mapping_sortComparator(a, b) {
3894
+ return a[COLUMN] - b[COLUMN];
3895
+ }
3896
+ var found = false;
3897
+ function binarySearch(haystack, needle, low, high) {
3898
+ while(low <= high){
3899
+ const mid = low + (high - low >> 1);
3900
+ const cmp = haystack[mid][COLUMN] - needle;
3901
+ if (0 === cmp) {
3902
+ found = true;
3903
+ return mid;
3904
+ }
3905
+ if (cmp < 0) low = mid + 1;
3906
+ else high = mid - 1;
3907
+ }
3908
+ found = false;
3909
+ return low - 1;
3910
+ }
3911
+ function upperBound(haystack, needle, index) {
3912
+ for(let i = index + 1; i < haystack.length && haystack[i][COLUMN] === needle; index = i++);
3913
+ return index;
3914
+ }
3915
+ function lowerBound(haystack, needle, index) {
3916
+ for(let i = index - 1; i >= 0 && haystack[i][COLUMN] === needle; index = i--);
3917
+ return index;
3918
+ }
3919
+ function memoizedState() {
3920
+ return {
3921
+ lastKey: -1,
3922
+ lastNeedle: -1,
3923
+ lastIndex: -1
3924
+ };
3925
+ }
3926
+ function memoizedBinarySearch(haystack, needle, state, key) {
3927
+ const { lastKey, lastNeedle, lastIndex } = state;
3928
+ let low = 0;
3929
+ let high = haystack.length - 1;
3930
+ if (key === lastKey) {
3931
+ if (needle === lastNeedle) {
3932
+ found = -1 !== lastIndex && haystack[lastIndex][COLUMN] === needle;
3933
+ return lastIndex;
3934
+ }
3935
+ if (needle >= lastNeedle) low = -1 === lastIndex ? 0 : lastIndex;
3936
+ else high = lastIndex;
3937
+ }
3938
+ state.lastKey = key;
3939
+ state.lastNeedle = needle;
3940
+ return state.lastIndex = binarySearch(haystack, needle, low, high);
3941
+ }
3942
+ function parse(map) {
3943
+ return "string" == typeof map ? JSON.parse(map) : map;
3944
+ }
3945
+ var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)";
3946
+ var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)";
3947
+ var LEAST_UPPER_BOUND = -1;
3948
+ var GREATEST_LOWER_BOUND = 1;
3949
+ var TraceMap = class {
3950
+ constructor(map, mapUrl){
3951
+ const isString = "string" == typeof map;
3952
+ if (!isString && map._decodedMemo) return map;
3953
+ const parsed = parse(map);
3954
+ const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
3955
+ this.version = version;
3956
+ this.file = file;
3957
+ this.names = names || [];
3958
+ this.sourceRoot = sourceRoot;
3959
+ this.sources = sources;
3960
+ this.sourcesContent = sourcesContent;
3961
+ this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
3962
+ const resolve = resolver(mapUrl, sourceRoot);
3963
+ this.resolvedSources = sources.map(resolve);
3964
+ const { mappings } = parsed;
3965
+ if ("string" == typeof mappings) {
3966
+ this._encoded = mappings;
3967
+ this._decoded = void 0;
3968
+ } else if (Array.isArray(mappings)) {
3969
+ this._encoded = void 0;
3970
+ this._decoded = maybeSort(mappings, isString);
3971
+ } else if (parsed.sections) throw new Error("TraceMap passed sectioned source map, please use FlattenMap export instead");
3972
+ else throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
3973
+ this._decodedMemo = memoizedState();
3974
+ this._bySources = void 0;
3975
+ this._bySourceMemos = void 0;
3976
+ }
3977
+ };
3978
+ function cast(map) {
3979
+ return map;
3980
+ }
3981
+ function decodedMappings(map) {
3982
+ var _a;
3983
+ return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));
3984
+ }
3985
+ function originalPositionFor(map, needle) {
3986
+ let { line, column, bias } = needle;
3987
+ line--;
3988
+ if (line < 0) throw new Error(LINE_GTR_ZERO);
3989
+ if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
3990
+ const decoded = decodedMappings(map);
3991
+ if (line >= decoded.length) return OMapping(null, null, null, null);
3992
+ const segments = decoded[line];
3993
+ const index = traceSegmentInternal(segments, cast(map)._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);
3994
+ if (-1 === index) return OMapping(null, null, null, null);
3995
+ const segment = segments[index];
3996
+ if (1 === segment.length) return OMapping(null, null, null, null);
3997
+ const { names, resolvedSources } = map;
3998
+ return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], 5 === segment.length ? names[segment[NAMES_INDEX]] : null);
3999
+ }
4000
+ function OMapping(source, line, column, name) {
4001
+ return {
4002
+ source,
4003
+ line,
4004
+ column,
4005
+ name
4006
+ };
4007
+ }
4008
+ function traceSegmentInternal(segments, memo, line, column, bias) {
4009
+ let index = memoizedBinarySearch(segments, column, memo, line);
4010
+ if (found) index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
4011
+ else if (bias === LEAST_UPPER_BOUND) index++;
4012
+ if (-1 === index || index === segments.length) return -1;
4013
+ return index;
4014
+ }
4015
+ var stack_trace_parser_esm = __webpack_require__("../../node_modules/.pnpm/stacktrace-parser@0.1.11/node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js");
4016
+ var utils = __webpack_require__("./src/utils/index.ts");
4017
+ async function printError(error, getSourcemap, rootPath) {
4018
+ const errorName = error.name || 'Unknown Error';
4019
+ if (error.message.includes('Vitest failed to access its internal state')) {
4020
+ const tips = [
4021
+ 'Error: not support import `vitest` in Rstest test environment.\n',
4022
+ 'Solution:',
4023
+ ` - Update your code to use imports from "${utils.yW.yellow('@rstest/core')}" instead of "${utils.yW.yellow('vitest')}".`,
4024
+ ' - Enable `globals` configuration and use global API.'
4025
+ ];
4026
+ utils.vF.log(`${utils.yW.red(tips.join('\n'))}\n`);
4027
+ return;
4028
+ }
4029
+ if (error.message.includes('is not defined')) {
4030
+ const [, varName] = error.message.match(/(.*) is not defined/) || [];
4031
+ if (varName) {
4032
+ if (utils.TE.includes(varName)) error.message = error.message.replace(`${varName} is not defined`, `${varName} is not defined. Did you forget to enable "globals" configuration?`);
4033
+ else if ([
4034
+ 'jest',
4035
+ 'vitest'
4036
+ ].includes(varName)) error.message = error.message.replace(`${varName} is not defined`, `${varName} is not defined. Did you mean rstest?`);
4037
+ }
4038
+ }
4039
+ utils.vF.log(`${utils.yW.red(utils.yW.bold(errorName))}${utils.yW.red(`: ${error.message}`)}\n`);
4040
+ if (error.diff) {
4041
+ utils.vF.log(error.diff);
4042
+ utils.vF.log();
4043
+ }
4044
+ if (error.stack) {
4045
+ const stackFrames = await parseErrorStacktrace({
4046
+ stack: error.stack,
4047
+ fullStack: error.fullStack,
4048
+ getSourcemap
4049
+ });
4050
+ if (!stackFrames.length && error.stack.length) utils.vF.log(utils.yW.gray("No error stack found, set 'DEBUG=rstest' to show fullStack."));
4051
+ if (stackFrames[0]) await printCodeFrame(stackFrames[0]);
4052
+ printStack(stackFrames, rootPath);
4053
+ }
4054
+ }
4055
+ async function printCodeFrame(frame) {
4056
+ const filePath = frame.file?.startsWith('file') ? new URL(frame.file) : frame.file;
4057
+ if (!filePath) return;
4058
+ const source = external_node_fs_["default"].existsSync(filePath) ? external_node_fs_["default"].readFileSync(filePath, 'utf-8') : void 0;
4059
+ if (!source) return;
4060
+ const { codeFrameColumns } = await __webpack_require__.e("171").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/@babel+code-frame@7.27.1/node_modules/@babel/code-frame/lib/index.js"));
4061
+ const result = codeFrameColumns(source, {
4062
+ start: {
4063
+ line: frame.lineNumber,
4064
+ column: frame.column
4065
+ }
4066
+ }, {
4067
+ highlightCode: true,
4068
+ linesBelow: 2
4069
+ });
4070
+ utils.vF.log(result);
4071
+ utils.vF.log('');
4072
+ }
4073
+ function formatStack(frame, rootPath) {
4074
+ return '<unknown>' !== frame.methodName ? `at ${frame.methodName} (${(0, utils.XJ)(rootPath, frame.file)}:${frame.lineNumber}:${frame.column})` : `at ${(0, utils.XJ)(rootPath, frame.file)}:${frame.lineNumber}:${frame.column}`;
4075
+ }
4076
+ function printStack(stackFrames, rootPath) {
4077
+ for (const frame of stackFrames)utils.vF.log(utils.yW.gray(` ${formatStack(frame, rootPath)}`));
4078
+ stackFrames.length && utils.vF.log();
4079
+ }
4080
+ const stackIgnores = [
4081
+ /\/@rstest\/core/,
4082
+ /rstest\/packages\/core\/dist/,
4083
+ /node_modules\/tinypool/,
4084
+ /node_modules\/chai/,
4085
+ /node_modules\/@vitest\/expect/,
4086
+ /node_modules\/@vitest\/snapshot/,
4087
+ /node:\w+/,
4088
+ /webpack\/runtime/,
4089
+ /webpack\\runtime/,
4090
+ '<anonymous>'
4091
+ ];
4092
+ async function parseErrorStacktrace({ stack, getSourcemap, fullStack = (0, utils._o)() }) {
4093
+ const stackFrames = await Promise.all((0, stack_trace_parser_esm.q)(stack).filter((frame)=>fullStack ? true : frame.file && !stackIgnores.some((entry)=>frame.file?.match(entry))).map(async (frame)=>{
4094
+ const sourcemap = await getSourcemap(frame.file);
4095
+ if (sourcemap) {
4096
+ const traceMap = new TraceMap(sourcemap);
4097
+ const { line, column, source, name } = originalPositionFor(traceMap, {
4098
+ line: frame.lineNumber,
4099
+ column: frame.column
4100
+ });
4101
+ if (!source) return null;
4102
+ return {
4103
+ ...frame,
4104
+ file: source,
4105
+ lineNumber: line,
4106
+ name,
4107
+ column
4108
+ };
4109
+ }
4110
+ return frame;
4111
+ })).then((frames)=>frames.filter((frame)=>null !== frame));
4112
+ return stackFrames;
4113
+ }
4114
+ },
2282
4115
  "./src/utils/helper.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2283
4116
  __webpack_require__.d(__webpack_exports__, {
2284
4117
  C3: ()=>needFlagExperimentalDetectModule,
@@ -2297,7 +4130,7 @@ ${section.body}` : section.body).join("\n\n"));
2297
4130
  var pathe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs");
2298
4131
  var picocolors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
2299
4132
  var picocolors__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/ __webpack_require__.n(picocolors__WEBPACK_IMPORTED_MODULE_1__);
2300
- __webpack_require__("./src/utils/constants.ts");
4133
+ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/utils/constants.ts");
2301
4134
  const formatRootStr = (rootStr, root)=>rootStr.replace('<rootDir>', root);
2302
4135
  function getAbsolutePath(base, filepath) {
2303
4136
  return (0, pathe__WEBPACK_IMPORTED_MODULE_2__.i)(filepath) ? filepath : (0, pathe__WEBPACK_IMPORTED_MODULE_2__.j)(base, filepath);
@@ -2345,7 +4178,7 @@ ${section.body}` : section.body).join("\n\n"));
2345
4178
  return time;
2346
4179
  };
2347
4180
  const getTaskNames = (test)=>(test.parentNames || []).concat(test.name).filter(Boolean);
2348
- const getTaskNameWithPrefix = (test, delimiter = ">")=>getTaskNames(test).join(` ${delimiter} `);
4181
+ const getTaskNameWithPrefix = (test, delimiter = _constants__WEBPACK_IMPORTED_MODULE_0__.vO)=>getTaskNames(test).join(` ${delimiter} `);
2349
4182
  const REGEXP_FLAG_PREFIX = 'RSTEST_REGEXP:';
2350
4183
  const wrapRegex = (value)=>`${REGEXP_FLAG_PREFIX}${value.toString()}`;
2351
4184
  const serializableConfig = (normalizedConfig)=>{
@@ -2391,7 +4224,7 @@ ${section.body}` : section.body).join("\n\n"));
2391
4224
  fN: ()=>helper.fN,
2392
4225
  vF: ()=>logger.vF,
2393
4226
  Ok: ()=>helper.Ok,
2394
- vO: ()=>">",
4227
+ vO: ()=>constants.vO,
2395
4228
  tG: ()=>getTestEntries,
2396
4229
  FI: ()=>helper.FI,
2397
4230
  Uq: ()=>helper.Uq,
@@ -2528,15 +4361,16 @@ ${section.body}` : section.body).join("\n\n"));
2528
4361
  mT: ()=>clearScreen,
2529
4362
  vF: ()=>src_logger
2530
4363
  });
4364
+ var external_node_process_ = __webpack_require__("node:process");
2531
4365
  var external_node_os_ = __webpack_require__("node:os");
2532
4366
  var external_node_tty_ = __webpack_require__("node:tty");
2533
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__["default"].argv) {
4367
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : external_node_process_["default"].argv) {
2534
4368
  const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
2535
4369
  const position = argv.indexOf(prefix + flag);
2536
4370
  const terminatorPosition = argv.indexOf('--');
2537
4371
  return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
2538
4372
  }
2539
- const { env } = __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__["default"];
4373
+ const { env } = external_node_process_["default"];
2540
4374
  let flagForceColor;
2541
4375
  if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
2542
4376
  else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
@@ -2576,7 +4410,7 @@ ${section.body}` : section.body).join("\n\n"));
2576
4410
  if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
2577
4411
  const min = forceColor || 0;
2578
4412
  if ('dumb' === env.TERM) return min;
2579
- if ('win32' === __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__["default"].platform) {
4413
+ if ('win32' === external_node_process_["default"].platform) {
2580
4414
  const osRelease = external_node_os_["default"].release().split('.');
2581
4415
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
2582
4416
  return 1;
@@ -2826,6 +4660,9 @@ ${section.body}` : section.body).join("\n\n"));
2826
4660
  "node:path": function(module) {
2827
4661
  module.exports = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__;
2828
4662
  },
4663
+ "node:process": function(module) {
4664
+ module.exports = __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__;
4665
+ },
2829
4666
  "node:tty": function(module) {
2830
4667
  module.exports = __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__;
2831
4668
  },
@@ -4161,19 +5998,9 @@ __webpack_require__.m = __webpack_modules__;
4161
5998
  }
4162
5999
  };
4163
6000
  })();
4164
- var logger = __webpack_require__("./src/utils/logger.ts");
4165
- var commands = __webpack_require__("./src/cli/commands.ts");
4166
- var prepare = __webpack_require__("./src/cli/prepare.ts");
4167
- async function runCLI() {
4168
- (0, prepare.k)();
4169
- try {
4170
- (0, commands.Q)();
4171
- } catch (err) {
4172
- logger.vF.error('Failed to start Rstest CLI.');
4173
- logger.vF.error(err);
4174
- }
4175
- }
6001
+ var cli = __webpack_require__("./src/cli/index.ts");
4176
6002
  var src_config = __webpack_require__("./src/config.ts");
6003
+ var core = __webpack_require__("./src/core/index.ts");
4177
6004
  const check = (name)=>{
4178
6005
  if (!globalThis.RSTEST_API?.[name]) throw new Error(`Rstest API '${name}' is not registered yet, please make sure you are running in a rstest environment.`);
4179
6006
  };
@@ -4211,5 +6038,9 @@ const onTestFailed = wrapRstestAPI('onTestFailed');
4211
6038
  function defineConfig(config) {
4212
6039
  return config;
4213
6040
  }
6041
+ var __webpack_exports__createRstest = core.createRstest;
6042
+ var __webpack_exports__initCli = cli.X;
6043
+ var __webpack_exports__loadConfig = src_config.Z9;
4214
6044
  var __webpack_exports__mergeRstestConfig = src_config.ST;
4215
- export { afterAll, afterEach, assert, beforeAll, beforeEach, defineConfig, describe, expect, it, onTestFailed, onTestFinished, rs, rstest, runCLI, test, __webpack_exports__mergeRstestConfig as mergeRstestConfig };
6045
+ var __webpack_exports__runCLI = cli.G;
6046
+ export { afterAll, afterEach, assert, beforeAll, beforeEach, defineConfig, describe, expect, it, onTestFailed, onTestFinished, rs, rstest, test, __webpack_exports__createRstest as createRstest, __webpack_exports__initCli as initCli, __webpack_exports__loadConfig as loadConfig, __webpack_exports__mergeRstestConfig as mergeRstestConfig, __webpack_exports__runCLI as runCLI };