@rstest/core 0.7.4 → 0.7.6

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.
Files changed (43) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/0~130.js +2 -2
  3. package/dist/{0~173.js → 0~2173.js} +15 -8
  4. package/dist/{0~255.js → 0~2255.js} +1 -1
  5. package/dist/{0~346.js → 0~3346.js} +2 -2
  6. package/dist/{0~919.js → 0~3919.js} +1 -1
  7. package/dist/{0~403.js → 0~4403.js} +3 -3
  8. package/dist/{0~809.js → 0~4809.js} +2 -2
  9. package/dist/{0~835.js → 0~5835.js} +12 -7
  10. package/dist/{0~151.js → 0~6151.js} +163 -292
  11. package/dist/0~62.js +2 -2
  12. package/dist/{0~588.js → 0~6588.js} +6 -6
  13. package/dist/{0~907.js → 0~6907.js} +2 -2
  14. package/dist/{0~923.js → 0~6923.js} +11 -7
  15. package/dist/0~6973.js +50 -0
  16. package/dist/{0~583.js → 0~7583.js} +4 -4
  17. package/dist/{0~426.js → 0~8426.js} +3 -3
  18. package/dist/0~89.js +81 -40
  19. package/dist/0~8957.js +149 -0
  20. package/dist/{0~634.js → 0~9634.js} +9 -5
  21. package/dist/{157.js → 1157.js} +5 -42
  22. package/dist/{216.js → 3216.js} +2 -2
  23. package/dist/{278.js → 3278.js} +2 -2
  24. package/dist/{397.js → 4397.js} +1 -1
  25. package/dist/4881.js +3 -0
  26. package/dist/554.js +26 -21
  27. package/dist/{664.js → 5693.js} +0 -2
  28. package/dist/{734.js → 5734.js} +4 -3
  29. package/dist/6198.js +3 -0
  30. package/dist/{913.js → 7913.js} +7 -6
  31. package/dist/{131.js → 9131.js} +31 -20
  32. package/dist/globalSetupWorker.js +8 -6
  33. package/dist/index.d.ts +21 -1
  34. package/dist/index.js +1 -1
  35. package/dist/rslib-runtime.js +1 -1
  36. package/dist/worker.d.ts +21 -1
  37. package/package.json +5 -5
  38. package/dist/198.js +0 -4
  39. /package/dist/{0~681.js → 0~3062.js} +0 -0
  40. /package/dist/{0~151.js.LICENSE.txt → 0~6151.js.LICENSE.txt} +0 -0
  41. /package/dist/{0~583.js.LICENSE.txt → 0~7583.js.LICENSE.txt} +0 -0
  42. /package/dist/{672.js → 1672.js} +0 -0
  43. /package/dist/{913.js.LICENSE.txt → 7913.js.LICENSE.txt} +0 -0
@@ -1,6 +1,5 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
- import node_v8 from "node:v8";
4
3
  const TYPE_REQUEST = "q";
5
4
  const TYPE_RESPONSE = "s";
6
5
  const DEFAULT_TIMEOUT = 6e4;
@@ -206,4 +205,5 @@ function nanoid(size = 21) {
206
205
  while(i--)id += urlAlphabet[64 * random() | 0];
207
206
  return id;
208
207
  }
209
- export { createBirpc, node_v8 };
208
+ export { default as node_v8 } from "node:v8";
209
+ export { createBirpc };
@@ -2,7 +2,7 @@ import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
3
  import { __webpack_require__ } from "./rslib-runtime.js";
4
4
  import node_process from "node:process";
5
- import "./664.js";
5
+ import "./5693.js";
6
6
  const external_node_os_ = __webpack_require__("node:os");
7
7
  const external_node_tty_ = __webpack_require__("node:tty");
8
8
  function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : node_process.argv) {
@@ -595,7 +595,7 @@ const join = function(...segments) {
595
595
  return normalize(path);
596
596
  };
597
597
  function cwd() {
598
- if ("undefined" != typeof process && "function" == typeof process.cwd) return process.cwd().replace(/\\/g, "/");
598
+ if ("u" > typeof process && "function" == typeof process.cwd) return process.cwd().replace(/\\/g, "/");
599
599
  return "/";
600
600
  }
601
601
  const resolve = function(...arguments_) {
@@ -41,7 +41,7 @@ function hasMoreVlq(reader, max) {
41
41
  return reader.peek() !== comma;
42
42
  }
43
43
  var bufLength = 16384;
44
- var td = "undefined" != typeof TextDecoder ? /* @__PURE__ */ new TextDecoder() : "undefined" != typeof Buffer ? {
44
+ var td = "u" > typeof TextDecoder ? /* @__PURE__ */ new TextDecoder() : "u" > typeof Buffer ? {
45
45
  decode (buf) {
46
46
  const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
47
47
  return out.toString();
package/dist/4881.js ADDED
@@ -0,0 +1,3 @@
1
+ import 'module';
2
+ /*#__PURE__*/ import.meta.url;
3
+ export { createRequire, isBuiltin } from "node:module";
package/dist/554.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import __rslib_shim_module__ from 'module';
2
2
  const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
3
3
  import { __webpack_require__ } from "./rslib-runtime.js";
4
- import "./664.js";
5
- import { formatTestError, setRealTimers, getRealTimers } from "./913.js";
6
- import { node_v8, createBirpc } from "./216.js";
7
- import { basename, isAbsolute, dirname, resolve as pathe_M_eThtNZ_resolve, join } from "./278.js";
8
- import { createCoverageProvider } from "./734.js";
9
- import { undoSerializableConfig, globalApis } from "./157.js";
4
+ import "./5693.js";
5
+ import { formatTestError, setRealTimers, getRealTimers } from "./7913.js";
6
+ import { node_v8, createBirpc } from "./3216.js";
7
+ import { basename, isAbsolute, dirname, resolve as pathe_M_eThtNZ_resolve, join } from "./3278.js";
8
+ import { createCoverageProvider } from "./5734.js";
9
+ import { undoSerializableConfig, globalApis } from "./1157.js";
10
10
  __webpack_require__.add({
11
11
  timers (module) {
12
12
  module.exports = require("timers");
@@ -173,7 +173,7 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
173
173
  testPath,
174
174
  environment: 'node'
175
175
  };
176
- const { createRstestRuntime } = await import("./0~151.js").then((mod)=>({
176
+ const { createRstestRuntime } = await import("./0~6151.js").then((mod)=>({
177
177
  createRstestRuntime: mod.createRstestRuntime
178
178
  }));
179
179
  listeners.forEach((fn)=>{
@@ -200,7 +200,7 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
200
200
  process.off('uncaughtException', uncaughtException);
201
201
  process.off('unhandledRejection', unhandledRejection);
202
202
  });
203
- const { api, runner } = createRstestRuntime(workerState);
203
+ const { api, runner } = await createRstestRuntime(workerState);
204
204
  switch(testEnvironment){
205
205
  case 'node':
206
206
  break;
@@ -215,7 +215,7 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
215
215
  }
216
216
  case 'happy-dom':
217
217
  {
218
- const { environment } = await import("./0~809.js").then((mod)=>({
218
+ const { environment } = await import("./0~4809.js").then((mod)=>({
219
219
  environment: mod.environment
220
220
  }));
221
221
  const { teardown } = await environment.setup(global, {});
@@ -245,24 +245,29 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot,
245
245
  };
246
246
  };
247
247
  const loadFiles = async ({ setupEntries, assetFiles, rstestContext, distPath, testPath, interopDefault, isolate, outputModule })=>{
248
- const { loadModule } = outputModule ? await import("./0~923.js").then((mod)=>({
248
+ const { loadModule, updateLatestAssetFiles } = outputModule ? await import("./0~6923.js").then((mod)=>({
249
249
  EsmMode: mod.loadEsModule_EsmMode,
250
250
  asModule: mod.asModule,
251
- loadModule: mod.loadModule
252
- })) : await import("./0~835.js").then((mod)=>({
251
+ loadModule: mod.loadModule,
252
+ updateLatestAssetFiles: mod.updateLatestAssetFiles
253
+ })) : await import("./0~5835.js").then((mod)=>({
253
254
  cacheableLoadModule: mod.cacheableLoadModule,
254
- loadModule: mod.loadModule
255
+ loadModule: mod.loadModule,
256
+ updateLatestAssetFiles: mod.updateLatestAssetFiles
255
257
  }));
256
- if (!isolate) await loadModule({
257
- codeContent: `if (global && typeof global.__rstest_clean_core_cache__ === 'function') {
258
+ if (!isolate) {
259
+ updateLatestAssetFiles(assetFiles);
260
+ await loadModule({
261
+ codeContent: `if (global && typeof global.__rstest_clean_core_cache__ === 'function') {
258
262
  global.__rstest_clean_core_cache__();
259
263
  }`,
260
- distPath: '',
261
- testPath,
262
- rstestContext,
263
- assetFiles,
264
- interopDefault
265
- });
264
+ distPath: '',
265
+ testPath,
266
+ rstestContext,
267
+ assetFiles,
268
+ interopDefault
269
+ });
270
+ }
266
271
  for (const { distPath, testPath } of setupEntries){
267
272
  const setupCodeContent = assetFiles[distPath];
268
273
  await loadModule({
@@ -6,7 +6,6 @@ import * as __rspack_external_node_path_c5b9b54f from "node:path";
6
6
  import * as __rspack_external_node_tty_c64aab7e from "node:tty";
7
7
  import * as __rspack_external_node_util_1b29d436 from "node:util";
8
8
  import { __webpack_require__ } from "./rslib-runtime.js";
9
- import { createRequire, isBuiltin } from "node:module";
10
9
  __webpack_require__.add({
11
10
  "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
12
11
  let p = process || {}, argv = p.argv || [], env = p.env || {};
@@ -90,4 +89,3 @@ __webpack_require__.add({
90
89
  module.exports = __rspack_external_node_util_1b29d436;
91
90
  }
92
91
  });
93
- export { createRequire, isBuiltin };
@@ -1,9 +1,10 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
3
  import { __webpack_require__ } from "./rslib-runtime.js";
4
- import { createRequire } from "./664.js";
5
- import { pathToFileURL } from "./198.js";
6
- import "./157.js";
4
+ import "./5693.js";
5
+ import { createRequire } from "./4881.js";
6
+ import { pathToFileURL } from "./6198.js";
7
+ import "./1157.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);
9
10
  const CoverageProviderMap = {
package/dist/6198.js ADDED
@@ -0,0 +1,3 @@
1
+ import 'module';
2
+ /*#__PURE__*/ import.meta.url;
3
+ export { fileURLToPath, pathToFileURL } from "node:url";
@@ -1,8 +1,9 @@
1
- /*! For license information please see 913.js.LICENSE.txt */
1
+ /*! For license information please see 7913.js.LICENSE.txt */
2
2
  import 'module';
3
3
  /*#__PURE__*/ import.meta.url;
4
4
  import { __webpack_require__ } from "./rslib-runtime.js";
5
- import { createRequire } from "./664.js";
5
+ import "./5693.js";
6
+ import { createRequire } from "./4881.js";
6
7
  __webpack_require__.add({
7
8
  "../../node_modules/.pnpm/@jest+diff-sequences@30.0.1/node_modules/@jest/diff-sequences/build/index.js" (module) {
8
9
  /*!
@@ -870,7 +871,7 @@ __webpack_require__.add({
870
871
  },
871
872
  "../../node_modules/.pnpm/buffer-from@1.1.2/node_modules/buffer-from/index.js" (module) {
872
873
  var toString = Object.prototype.toString;
873
- var isModern = 'undefined' != typeof Buffer && 'function' == typeof Buffer.alloc && 'function' == typeof Buffer.allocUnsafe && 'function' == typeof Buffer.from;
874
+ var isModern = "u" > typeof Buffer && 'function' == typeof Buffer.alloc && 'function' == typeof Buffer.allocUnsafe && 'function' == typeof Buffer.from;
874
875
  function isArrayBuffer(input) {
875
876
  return 'ArrayBuffer' === toString.call(input).slice(8, -1);
876
877
  }
@@ -4377,7 +4378,7 @@ __webpack_require__.add({
4377
4378
  const errorToString = Error.prototype.toString;
4378
4379
  const regExpToString = RegExp.prototype.toString;
4379
4380
  const getConstructorName = (val)=>'function' == typeof val.constructor && val.constructor.name || 'Object';
4380
- const isWindow = (val)=>'undefined' != typeof window && val === window;
4381
+ const isWindow = (val)=>"u" > typeof window && val === window;
4381
4382
  const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
4382
4383
  const NEWLINE_REGEXP = /\n/gi;
4383
4384
  class PrettyFormatPluginError extends Error {
@@ -4875,7 +4876,7 @@ __webpack_require__.add({
4875
4876
  function isInBrowser() {
4876
4877
  if ("browser" === environment) return true;
4877
4878
  if ("node" === environment) return false;
4878
- return 'undefined' != typeof window && 'function' == typeof XMLHttpRequest && !(window.require && window.module && window.process && "renderer" === window.process.type);
4879
+ return "u" > typeof window && 'function' == typeof XMLHttpRequest && !(window.require && window.module && window.process && "renderer" === window.process.type);
4879
4880
  }
4880
4881
  function hasGlobalProcessEventEmitter() {
4881
4882
  return 'object' == typeof process && null !== process && 'function' == typeof process.on;
@@ -5241,7 +5242,7 @@ __webpack_require__.add({
5241
5242
  "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js" (__unused_rspack_module, exports, __webpack_require__) {
5242
5243
  var util = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js");
5243
5244
  var has = Object.prototype.hasOwnProperty;
5244
- var hasNativeMap = "undefined" != typeof Map;
5245
+ var hasNativeMap = "u" > typeof Map;
5245
5246
  function ArraySet() {
5246
5247
  this._array = [];
5247
5248
  this._set = hasNativeMap ? new Map() : Object.create(null);
@@ -2,12 +2,12 @@ import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
3
  import { __webpack_require__ } from "./rslib-runtime.js";
4
4
  import { EventEmitter } from "events";
5
- import { createRsbuild, loadConfig, logger as core_logger, mergeRsbuildConfig } from "@rsbuild/core";
6
- import "./664.js";
7
- import { basename, logger_logger, dirname, posix, resolve as pathe_M_eThtNZ_resolve, isDebug, isAbsolute, relative, join, normalize } from "./278.js";
8
- import { isTTY, DEFAULT_CONFIG_NAME, globalApis, filterProjects, getAbsolutePath, bgColor, formatRootStr, isDynamicPattern, glob, writeFile, castArray, prettyTestPath, prettyTime, TEMP_RSTEST_OUTPUT_DIR_GLOB, getTaskNameWithPrefix, formatTestPath, formatError, DEFAULT_CONFIG_EXTENSIONS, TS_CONFIG_FILE } from "./157.js";
9
- import { parse as stack_trace_parser_esm_parse } from "./672.js";
10
- import { decode } from "./397.js";
5
+ import { createRsbuild, loadConfig, logger as core_logger, mergeRsbuildConfig, rspack } from "@rsbuild/core";
6
+ import "./5693.js";
7
+ import { basename, logger_logger, dirname, posix, resolve as pathe_M_eThtNZ_resolve, isDebug, isAbsolute, relative, join, normalize } from "./3278.js";
8
+ import { isTTY, DEFAULT_CONFIG_NAME, globalApis, filterProjects, getAbsolutePath, bgColor, formatRootStr, isDynamicPattern, glob, writeFile, castArray, prettyTestPath, prettyTime, TEMP_RSTEST_OUTPUT_DIR_GLOB, getTaskNameWithPrefix, formatTestPath, formatError, DEFAULT_CONFIG_EXTENSIONS, TS_CONFIG_FILE } from "./1157.js";
9
+ import { parse as stack_trace_parser_esm_parse } from "./1672.js";
10
+ import { decode } from "./4397.js";
11
11
  function toArr(any) {
12
12
  return null == any ? [] : Array.isArray(any) ? any : [
13
13
  any
@@ -503,7 +503,7 @@ function prepareCli() {
503
503
  if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) logger_logger.log();
504
504
  }
505
505
  function showRstest() {
506
- logger_logger.greet(" Rstest v0.7.4");
506
+ logger_logger.greet(" Rstest v0.7.6");
507
507
  logger_logger.log('');
508
508
  }
509
509
  const applyCommonOptions = (cli)=>{
@@ -527,7 +527,7 @@ const runRest = async ({ options, filters, command })=>{
527
527
  projects
528
528
  }, command, filters.map(normalize));
529
529
  if ('watch' === command && configFilePath) {
530
- const { watchFilesForRestart } = await import("./0~588.js").then((mod)=>({
530
+ const { watchFilesForRestart } = await import("./0~6588.js").then((mod)=>({
531
531
  watchFilesForRestart: mod.watchFilesForRestart
532
532
  }));
533
533
  watchFilesForRestart({
@@ -547,7 +547,7 @@ const runRest = async ({ options, filters, command })=>{
547
547
  function setupCommands() {
548
548
  const cli = dist('rstest');
549
549
  cli.help();
550
- cli.version("0.7.4");
550
+ cli.version("0.7.6");
551
551
  applyCommonOptions(cli);
552
552
  cli.command('[...filters]', 'run tests').option('-w, --watch', 'Run tests in watch mode').action(async (filters, options)=>{
553
553
  showRstest();
@@ -793,12 +793,14 @@ function mergeWithCLIOptions(config, options) {
793
793
  }
794
794
  async function resolveConfig(options) {
795
795
  const { content: config, filePath: configFilePath } = await config_loadConfig({
796
- cwd: options.root,
796
+ cwd: options.cwd,
797
797
  path: options.config,
798
798
  configLoader: options.configLoader
799
799
  });
800
+ const mergedConfig = mergeWithCLIOptions(config, options);
801
+ if (!mergedConfig.root) mergedConfig.root = options.cwd;
800
802
  return {
801
- config: mergeWithCLIOptions(config, options),
803
+ config: mergedConfig,
802
804
  configFilePath: configFilePath ?? void 0
803
805
  };
804
806
  }
@@ -860,7 +862,7 @@ async function resolveProjects({ config, root, options }) {
860
862
  const { config, configFilePath } = await resolveConfig({
861
863
  ...options,
862
864
  config: isDirectory ? void 0 : project,
863
- root: projectRoot
865
+ cwd: projectRoot
864
866
  });
865
867
  if (configFilePath) {
866
868
  if (resolvedProjectPaths.has(configFilePath)) return;
@@ -902,7 +904,7 @@ async function init_initCli(options) {
902
904
  const root = options.root ? getAbsolutePath(cwd, options.root) : cwd;
903
905
  const { config, configFilePath } = await resolveConfig({
904
906
  ...options,
905
- root
907
+ cwd: options.root ? getAbsolutePath(cwd, options.root) : cwd
906
908
  });
907
909
  const projects = await resolveProjects({
908
910
  config,
@@ -1593,10 +1595,12 @@ class DefaultReporter {
1593
1595
  config;
1594
1596
  options = {};
1595
1597
  statusRenderer;
1598
+ testState;
1596
1599
  constructor({ rootPath, options, config, testState }){
1597
1600
  this.rootPath = rootPath;
1598
1601
  this.config = config;
1599
1602
  this.options = options;
1603
+ this.testState = testState;
1600
1604
  if (isTTY() || options.logger) this.statusRenderer = new StatusRenderer(rootPath, testState, options.logger);
1601
1605
  }
1602
1606
  onTestFileStart() {
@@ -1607,8 +1611,9 @@ class DefaultReporter {
1607
1611
  const relativePath = relative(this.rootPath, test.testPath);
1608
1612
  const { slowTestThreshold } = this.config;
1609
1613
  logFileTitle(test, relativePath);
1614
+ const showAllCases = this.testState.getTestFiles()?.length === 1;
1610
1615
  for (const result of test.results){
1611
- const isDisplayed = 'fail' === result.status || (result.duration ?? 0) > slowTestThreshold || (result.retryCount ?? 0) > 0;
1616
+ const isDisplayed = showAllCases || 'fail' === result.status || (result.duration ?? 0) > slowTestThreshold || (result.retryCount ?? 0) > 0;
1612
1617
  isDisplayed && logCase(result, {
1613
1618
  slowTestThreshold,
1614
1619
  hideSkippedTests: this.config.hideSkippedTests
@@ -2074,7 +2079,7 @@ async function printCodeFrame(frame) {
2074
2079
  if (!filePath) return;
2075
2080
  const source = external_node_fs_["default"].existsSync(filePath) ? external_node_fs_["default"].readFileSync(filePath, 'utf-8') : void 0;
2076
2081
  if (!source) return;
2077
- const { codeFrameColumns } = await import("./0~919.js").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/@babel+code-frame@7.27.1/node_modules/@babel/code-frame/lib/index.js"));
2082
+ const { codeFrameColumns } = await import("./0~3919.js").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/@babel+code-frame@7.27.1/node_modules/@babel/code-frame/lib/index.js"));
2078
2083
  const result = codeFrameColumns(source, {
2079
2084
  start: {
2080
2085
  line: frame.lineNumber,
@@ -2263,6 +2268,7 @@ class VerboseReporter extends DefaultReporter {
2263
2268
  class TestStateManager {
2264
2269
  runningModules = new Map();
2265
2270
  testModules = [];
2271
+ testFiles = void 0;
2266
2272
  onTestFileStart(testPath) {
2267
2273
  this.runningModules.set(testPath, {
2268
2274
  runningTests: [],
@@ -2316,6 +2322,7 @@ class TestStateManager {
2316
2322
  reset() {
2317
2323
  this.runningModules.clear();
2318
2324
  this.testModules = [];
2325
+ this.testFiles = void 0;
2319
2326
  }
2320
2327
  }
2321
2328
  function formatEnvironmentName(name) {
@@ -2339,7 +2346,11 @@ class Rstest {
2339
2346
  stateManager = new TestStateManager();
2340
2347
  testState = {
2341
2348
  getRunningModules: ()=>this.stateManager.runningModules,
2342
- getTestModules: ()=>this.stateManager.testModules
2349
+ getTestModules: ()=>this.stateManager.testModules,
2350
+ getTestFiles: ()=>{
2351
+ if ('watch' === this.command) return;
2352
+ return this.stateManager.testFiles;
2353
+ }
2343
2354
  };
2344
2355
  projects = [];
2345
2356
  constructor({ cwd = process.cwd(), command, fileFilters, configFilePath, projects }, userConfig){
@@ -2362,7 +2373,7 @@ class Rstest {
2362
2373
  });
2363
2374
  this.reporters = reporters;
2364
2375
  this.snapshotManager = snapshotManager;
2365
- this.version = "0.7.4";
2376
+ this.version = "0.7.6";
2366
2377
  this.rootPath = rootPath;
2367
2378
  this.originalConfig = userConfig;
2368
2379
  this.normalizedConfig = rstestConfig;
@@ -2450,13 +2461,13 @@ function core_createRstest({ config, projects, configFilePath }, command, fileFi
2450
2461
  projects
2451
2462
  }, config);
2452
2463
  const runTests = async ()=>{
2453
- const { runTests } = await import("./0~173.js").then((mod)=>({
2464
+ const { runTests } = await import("./0~2173.js").then((mod)=>({
2454
2465
  runTests: mod.runTests
2455
2466
  }));
2456
2467
  await runTests(context);
2457
2468
  };
2458
2469
  const listTests = async (options)=>{
2459
- const { listTests } = await import("./0~634.js").then((mod)=>({
2470
+ const { listTests } = await import("./0~9634.js").then((mod)=>({
2460
2471
  listTests: mod.listTests
2461
2472
  }));
2462
2473
  return listTests(context, options);
@@ -2507,4 +2518,4 @@ function defineConfig(config) {
2507
2518
  function defineProject(config) {
2508
2519
  return config;
2509
2520
  }
2510
- export { EventEmitter, afterAll, afterEach, assert, beforeAll, beforeEach, config_loadConfig as loadConfig, core_createRstest as createRstest, core_logger, createRsbuild, defineConfig, defineProject, describe, error_printError, expect, init_initCli as initCli, it, mergeProjectConfig, mergeRstestConfig, onTestFailed, onTestFinished, public_rstest as rstest, public_test as test, rs, runCLI, runRest };
2521
+ export { EventEmitter, afterAll, afterEach, assert, beforeAll, beforeEach, config_loadConfig as loadConfig, core_createRstest as createRstest, core_logger, createRsbuild, defineConfig, defineProject, describe, error_printError, expect, init_initCli as initCli, it, mergeProjectConfig, mergeRstestConfig, onTestFailed, onTestFinished, public_rstest as rstest, public_test as test, rs, rspack, runCLI, runRest };
@@ -1,8 +1,8 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
3
  import { __webpack_require__ } from "./rslib-runtime.js";
4
- import { formatTestError } from "./913.js";
5
- import "./664.js";
4
+ import { formatTestError } from "./7913.js";
5
+ import "./5693.js";
6
6
  const source_map_support = __webpack_require__("../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js");
7
7
  const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
8
8
  var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
@@ -41,13 +41,15 @@ const runGlobalSetup = async (data)=>{
41
41
  for (const entry of data.entries){
42
42
  const { distPath, testPath } = entry;
43
43
  const setupCodeContent = data.assetFiles[distPath];
44
- const { loadModule } = data.outputModule ? await import("./0~923.js").then((mod)=>({
44
+ const { loadModule } = data.outputModule ? await import("./0~6923.js").then((mod)=>({
45
45
  EsmMode: mod.loadEsModule_EsmMode,
46
46
  asModule: mod.asModule,
47
- loadModule: mod.loadModule
48
- })) : await import("./0~835.js").then((mod)=>({
47
+ loadModule: mod.loadModule,
48
+ updateLatestAssetFiles: mod.updateLatestAssetFiles
49
+ })) : await import("./0~5835.js").then((mod)=>({
49
50
  cacheableLoadModule: mod.cacheableLoadModule,
50
- loadModule: mod.loadModule
51
+ loadModule: mod.loadModule,
52
+ updateLatestAssetFiles: mod.updateLatestAssetFiles
51
53
  }));
52
54
  const module = await loadModule({
53
55
  codeContent: setupCodeContent,
package/dist/index.d.ts CHANGED
@@ -482,9 +482,19 @@ export declare type CoverageOptions = {
482
482
  provider?: 'istanbul';
483
483
  /**
484
484
  * The reporters to use for coverage collection.
485
+ * Supports built-in istanbul reporters and custom reporters (e.g., '@canyonjs/report-html').
485
486
  * @default ['text', 'html', 'clover', 'json']
487
+ * @example
488
+ * // Built-in reporters
489
+ * reporters: ['text', 'html', ['json', { file: 'coverage.json' }]]
490
+ *
491
+ * // Custom reporters
492
+ * reporters: ['@canyonjs/report-html', ['custom-reporter', { outputDir: './reports' }]]
493
+ *
494
+ * // Mixed usage
495
+ * reporters: ['text', '@canyonjs/report-html', ['html', { subdir: 'html-report' }]]
486
496
  */
487
- reporters?: (keyof ReportOptions | ReportWithOptions | ReportBase)[];
497
+ reporters?: SupportedReporter[];
488
498
  /**
489
499
  * The directory to store coverage reports.
490
500
  * @default './coverage'
@@ -600,6 +610,9 @@ declare interface CustomMatcher {
600
610
  toBeOneOf: <T>(sample: Array<T>) => any;
601
611
  }
602
612
 
613
+ /** Custom reporter configuration for non-istanbul reporters */
614
+ declare type CustomReporter = string | [string, Record<string, unknown>];
615
+
603
616
  declare interface DecodedSourceMap extends SourceMapV3 {
604
617
  mappings: SourceMapSegment[][];
605
618
  }
@@ -629,6 +642,7 @@ declare class DefaultReporter implements Reporter {
629
642
  protected config: NormalizedConfig;
630
643
  private options;
631
644
  protected statusRenderer: StatusRenderer | undefined;
645
+ private testState;
632
646
  constructor({ rootPath, options, config, testState, }: {
633
647
  rootPath: string;
634
648
  config: NormalizedConfig;
@@ -2564,6 +2578,8 @@ declare type RstestPoolType = 'forks';
2564
2578
  declare type RstestTestState = {
2565
2579
  getRunningModules: () => RunningModules;
2566
2580
  getTestModules: () => TestFileResult[];
2581
+ /** Get the test files paths. return `undefined` in watch mode. */
2582
+ getTestFiles: () => string[] | undefined;
2567
2583
  };
2568
2584
 
2569
2585
  export declare interface RstestUtilities {
@@ -2916,6 +2932,9 @@ declare type SuiteContext = {
2916
2932
 
2917
2933
  declare type Summarizers = "flat" | "nested" | "pkg" | "defaultSummarizer";
2918
2934
 
2935
+ /** Union type for all supported reporter types */
2936
+ declare type SupportedReporter = keyof ReportOptions | ReportWithOptions | ReportBase | CustomReporter;
2937
+
2919
2938
  declare interface SyncExpectationResult {
2920
2939
  pass: boolean;
2921
2940
  message: () => string;
@@ -3086,6 +3105,7 @@ declare class TestStateManager {
3086
3105
  results: TestResult[];
3087
3106
  }>;
3088
3107
  testModules: TestFileResult[];
3108
+ testFiles: string[] | undefined;
3089
3109
  onTestFileStart(testPath: string): void;
3090
3110
  onTestCaseResult(result: TestResult): void;
3091
3111
  onTestCaseStart(test: TestCaseInfo): void;
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
- export { afterAll, afterEach, assert, beforeAll, beforeEach, createRstest, defineConfig, defineProject, describe, expect, initCli, it, loadConfig, mergeProjectConfig, mergeRstestConfig, onTestFailed, onTestFinished, rs, rstest, runCLI, test } from "./131.js";
3
+ export { afterAll, afterEach, assert, beforeAll, beforeEach, createRstest, defineConfig, defineProject, describe, expect, initCli, it, loadConfig, mergeProjectConfig, mergeRstestConfig, onTestFailed, onTestFinished, rs, rstest, runCLI, test } from "./9131.js";
@@ -42,7 +42,7 @@ __webpack_require__.m = __webpack_modules__;
42
42
  })();
43
43
  (()=>{
44
44
  __webpack_require__.r = (exports)=>{
45
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
45
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
46
46
  value: 'Module'
47
47
  });
48
48
  Object.defineProperty(exports, '__esModule', {
package/dist/worker.d.ts CHANGED
@@ -425,9 +425,19 @@ declare type CoverageOptions = {
425
425
  provider?: 'istanbul';
426
426
  /**
427
427
  * The reporters to use for coverage collection.
428
+ * Supports built-in istanbul reporters and custom reporters (e.g., '@canyonjs/report-html').
428
429
  * @default ['text', 'html', 'clover', 'json']
430
+ * @example
431
+ * // Built-in reporters
432
+ * reporters: ['text', 'html', ['json', { file: 'coverage.json' }]]
433
+ *
434
+ * // Custom reporters
435
+ * reporters: ['@canyonjs/report-html', ['custom-reporter', { outputDir: './reports' }]]
436
+ *
437
+ * // Mixed usage
438
+ * reporters: ['text', '@canyonjs/report-html', ['html', { subdir: 'html-report' }]]
429
439
  */
430
- reporters?: (keyof ReportOptions | ReportWithOptions | ReportBase)[];
440
+ reporters?: SupportedReporter[];
431
441
  /**
432
442
  * The directory to store coverage reports.
433
443
  * @default './coverage'
@@ -506,6 +516,9 @@ declare interface CustomMatcher {
506
516
  toBeOneOf: <T>(sample: Array<T>) => any;
507
517
  }
508
518
 
519
+ /** Custom reporter configuration for non-istanbul reporters */
520
+ declare type CustomReporter = string | [string, Record<string, unknown>];
521
+
509
522
  declare interface DecodedSourceMap extends SourceMapV3 {
510
523
  mappings: SourceMapSegment[][];
511
524
  }
@@ -535,6 +548,7 @@ declare class DefaultReporter implements Reporter {
535
548
  protected config: NormalizedConfig;
536
549
  private options;
537
550
  protected statusRenderer: StatusRenderer | undefined;
551
+ private testState;
538
552
  constructor({ rootPath, options, config, testState, }: {
539
553
  rootPath: string;
540
554
  config: NormalizedConfig;
@@ -2167,6 +2181,8 @@ declare type RstestPoolType = 'forks';
2167
2181
  declare type RstestTestState = {
2168
2182
  getRunningModules: () => RunningModules;
2169
2183
  getTestModules: () => TestFileResult[];
2184
+ /** Get the test files paths. return `undefined` in watch mode. */
2185
+ getTestFiles: () => string[] | undefined;
2170
2186
  };
2171
2187
 
2172
2188
  declare const runInPool: (options: RunWorkerOptions["options"]) => Promise<{
@@ -2422,6 +2438,9 @@ declare type SuiteContext = {
2422
2438
 
2423
2439
  declare type Summarizers = "flat" | "nested" | "pkg" | "defaultSummarizer";
2424
2440
 
2441
+ /** Union type for all supported reporter types */
2442
+ declare type SupportedReporter = keyof ReportOptions | ReportWithOptions | ReportBase | CustomReporter;
2443
+
2425
2444
  declare interface SyncExpectationResult {
2426
2445
  pass: boolean;
2427
2446
  message: () => string;
@@ -2590,6 +2609,7 @@ declare class TestStateManager {
2590
2609
  results: TestResult[];
2591
2610
  }>;
2592
2611
  testModules: TestFileResult[];
2612
+ testFiles: string[] | undefined;
2593
2613
  onTestFileStart(testPath: string): void;
2594
2614
  onTestCaseResult(result: TestResult): void;
2595
2615
  onTestCaseStart(test: TestCaseInfo): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rstest/core",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "description": "The Rsbuild-based test tool.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/web-infra-dev/rstest/issues"
@@ -47,7 +47,7 @@
47
47
  ],
48
48
  "dependencies": {
49
49
  "@types/chai": "^5.2.3",
50
- "@rsbuild/core": "1.6.12-canary-20251204065915",
50
+ "@rsbuild/core": "1.7.0-beta.1",
51
51
  "tinypool": "^1.1.1"
52
52
  },
53
53
  "devDependencies": {
@@ -58,9 +58,9 @@
58
58
  "@vitest/snapshot": "^3.2.4",
59
59
  "@babel/code-frame": "^7.27.1",
60
60
  "@jridgewell/trace-mapping": "0.3.31",
61
- "@microsoft/api-extractor": "^7.53.3",
62
- "@rslib/core": "0.18.3",
63
- "@sinonjs/fake-timers": "^15.0.0",
61
+ "@microsoft/api-extractor": "^7.55.2",
62
+ "@rslib/core": "0.18.5",
63
+ "@sinonjs/fake-timers": "^15.1.0",
64
64
  "@types/babel__code-frame": "^7.0.6",
65
65
  "@types/istanbul-reports": "^3.0.4",
66
66
  "@types/istanbul-lib-coverage": "^2.0.6",
package/dist/198.js DELETED
@@ -1,4 +0,0 @@
1
- import 'module';
2
- /*#__PURE__*/ import.meta.url;
3
- import { fileURLToPath, pathToFileURL } from "node:url";
4
- export { fileURLToPath, pathToFileURL };
File without changes
File without changes