@rstest/core 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2181,8 +2181,8 @@ var __webpack_modules__ = {
2181
2181
  },
2182
2182
  "./src/cli/commands.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2183
2183
  __webpack_require__.d(__webpack_exports__, {
2184
- mR: ()=>runRest,
2185
- X_: ()=>setupCommands
2184
+ a8: ()=>runRest,
2185
+ QF: ()=>setupCommands
2186
2186
  });
2187
2187
  var external_events_ = __webpack_require__("events");
2188
2188
  function toArr(any) {
@@ -2682,8 +2682,8 @@ ${section.body}` : section.body).join("\n\n"));
2682
2682
  };
2683
2683
  async function initCli(options) {
2684
2684
  const cwd = process.cwd();
2685
- const root = options.root ? (0, helper.ZY)(cwd, options.root) : cwd;
2686
- const { content: config, filePath: configFilePath } = await (0, src_config.ME)({
2685
+ const root = options.root ? (0, helper.FI)(cwd, options.root) : cwd;
2686
+ const { content: config, filePath: configFilePath } = await (0, src_config.Z9)({
2687
2687
  cwd: root,
2688
2688
  path: options.config,
2689
2689
  configLoader: options.configLoader
@@ -2710,9 +2710,9 @@ ${section.body}` : section.body).join("\n\n"));
2710
2710
  'testEnvironment'
2711
2711
  ];
2712
2712
  for (const key of keys)if (void 0 !== options[key]) config[key] = options[key];
2713
- if (options.exclude) config.exclude = (0, helper.XQ)(options.exclude);
2714
- if (options.reporter) config.reporters = (0, helper.XQ)(options.reporter);
2715
- if (options.include) config.include = (0, helper.XQ)(options.include);
2713
+ if (options.exclude) config.exclude = (0, helper.bg)(options.exclude);
2714
+ if (options.reporter) config.reporters = (0, helper.bg)(options.reporter);
2715
+ if (options.include) config.include = (0, helper.bg)(options.include);
2716
2716
  return {
2717
2717
  config,
2718
2718
  configFilePath: configFilePath ?? void 0
@@ -2722,13 +2722,13 @@ ${section.body}` : section.body).join("\n\n"));
2722
2722
  let rstest;
2723
2723
  try {
2724
2724
  const { config, configFilePath } = await initCli(options);
2725
- const { createRstest } = await __webpack_require__.e("359").then(__webpack_require__.bind(__webpack_require__, "./src/core/index.ts"));
2725
+ const { createRstest } = await __webpack_require__.e("698").then(__webpack_require__.bind(__webpack_require__, "./src/core/index.ts"));
2726
2726
  rstest = createRstest({
2727
2727
  config,
2728
2728
  configFilePath
2729
2729
  }, command, filters.map(external_pathe_.normalize));
2730
2730
  if ('watch' === command && configFilePath) {
2731
- const { watchFilesForRestart } = await __webpack_require__.e("25").then(__webpack_require__.bind(__webpack_require__, "./src/core/restart.ts"));
2731
+ const { watchFilesForRestart } = await __webpack_require__.e("967").then(__webpack_require__.bind(__webpack_require__, "./src/core/restart.ts"));
2732
2732
  watchFilesForRestart({
2733
2733
  rstest,
2734
2734
  options,
@@ -2738,18 +2738,18 @@ ${section.body}` : section.body).join("\n\n"));
2738
2738
  await rstest.runTests();
2739
2739
  } catch (err) {
2740
2740
  for (const reporter of rstest?.context.reporters || [])reporter.onExit?.();
2741
- logger.k.error('Failed to run Rstest.');
2742
- logger.k.error((0, helper.Z)(err));
2741
+ logger.v.error('Failed to run Rstest.');
2742
+ logger.v.error((0, helper.Wk)(err));
2743
2743
  process.exit(1);
2744
2744
  }
2745
2745
  };
2746
2746
  function setupCommands() {
2747
2747
  const cli = dist('rstest');
2748
2748
  cli.help();
2749
- cli.version("0.2.1");
2749
+ cli.version("0.2.2");
2750
2750
  applyCommonOptions(cli);
2751
- cli.command('[...filters]', 'run tests').option('--watch', 'Run tests in watch mode').action(async (filters, options)=>{
2752
- (0, prepare.U)();
2751
+ cli.command('[...filters]', 'run tests').option('-w, --watch', 'Run tests in watch mode').action(async (filters, options)=>{
2752
+ (0, prepare.N)();
2753
2753
  if (options.watch) await runRest({
2754
2754
  options,
2755
2755
  filters,
@@ -2762,7 +2762,7 @@ ${section.body}` : section.body).join("\n\n"));
2762
2762
  });
2763
2763
  });
2764
2764
  cli.command('run [...filters]', 'run tests without watch mode').action(async (filters, options)=>{
2765
- (0, prepare.U)();
2765
+ (0, prepare.N)();
2766
2766
  await runRest({
2767
2767
  options,
2768
2768
  filters,
@@ -2770,7 +2770,7 @@ ${section.body}` : section.body).join("\n\n"));
2770
2770
  });
2771
2771
  });
2772
2772
  cli.command('watch [...filters]', 'run tests in watch mode').action(async (filters, options)=>{
2773
- (0, prepare.U)();
2773
+ (0, prepare.N)();
2774
2774
  await runRest({
2775
2775
  options,
2776
2776
  filters,
@@ -2780,7 +2780,7 @@ ${section.body}` : section.body).join("\n\n"));
2780
2780
  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)=>{
2781
2781
  try {
2782
2782
  const { config, configFilePath } = await initCli(options);
2783
- const { createRstest } = await __webpack_require__.e("359").then(__webpack_require__.bind(__webpack_require__, "./src/core/index.ts"));
2783
+ const { createRstest } = await __webpack_require__.e("698").then(__webpack_require__.bind(__webpack_require__, "./src/core/index.ts"));
2784
2784
  const rstest = createRstest({
2785
2785
  config,
2786
2786
  configFilePath
@@ -2790,8 +2790,8 @@ ${section.body}` : section.body).join("\n\n"));
2790
2790
  json: options.json
2791
2791
  });
2792
2792
  } catch (err) {
2793
- logger.k.error('Failed to run Rstest list.');
2794
- logger.k.error((0, helper.Z)(err));
2793
+ logger.v.error('Failed to run Rstest list.');
2794
+ logger.v.error((0, helper.Wk)(err));
2795
2795
  process.exit(1);
2796
2796
  }
2797
2797
  });
@@ -2800,8 +2800,8 @@ ${section.body}` : section.body).join("\n\n"));
2800
2800
  },
2801
2801
  "./src/cli/prepare.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2802
2802
  __webpack_require__.d(__webpack_exports__, {
2803
- U: ()=>showRstest,
2804
- n: ()=>prepareCli
2803
+ N: ()=>showRstest,
2804
+ k: ()=>prepareCli
2805
2805
  });
2806
2806
  var _utils_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/utils/logger.ts");
2807
2807
  function initNodeEnv() {
@@ -2814,35 +2814,35 @@ ${section.body}` : section.body).join("\n\n"));
2814
2814
  if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
2815
2815
  }
2816
2816
  function showRstest() {
2817
- _utils_logger__WEBPACK_IMPORTED_MODULE_0__.k.greet(" Rstest v0.2.1");
2818
- _utils_logger__WEBPACK_IMPORTED_MODULE_0__.k.log('');
2817
+ _utils_logger__WEBPACK_IMPORTED_MODULE_0__.v.greet(" Rstest v0.2.2");
2818
+ _utils_logger__WEBPACK_IMPORTED_MODULE_0__.v.log('');
2819
2819
  }
2820
2820
  },
2821
2821
  "./src/config.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2822
2822
  __webpack_require__.d(__webpack_exports__, {
2823
- ME: ()=>loadConfig,
2824
- en: ()=>mergeRstestConfig,
2825
- hY: ()=>withDefaultConfig
2823
+ ST: ()=>mergeRstestConfig,
2824
+ Z9: ()=>loadConfig,
2825
+ wX: ()=>withDefaultConfig
2826
2826
  });
2827
2827
  var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("node:fs");
2828
2828
  var _rsbuild_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("@rsbuild/core");
2829
2829
  var pathe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("pathe");
2830
2830
  var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/utils/index.ts");
2831
- const findConfig = (basePath)=>_utils__WEBPACK_IMPORTED_MODULE_3__.Io.map((ext)=>basePath + ext).find(node_fs__WEBPACK_IMPORTED_MODULE_0__["default"].existsSync);
2831
+ const findConfig = (basePath)=>_utils__WEBPACK_IMPORTED_MODULE_3__.kv.map((ext)=>basePath + ext).find(node_fs__WEBPACK_IMPORTED_MODULE_0__["default"].existsSync);
2832
2832
  const resolveConfigPath = (root, customConfig)=>{
2833
2833
  if (customConfig) {
2834
2834
  const customConfigPath = (0, pathe__WEBPACK_IMPORTED_MODULE_2__.isAbsolute)(customConfig) ? customConfig : (0, pathe__WEBPACK_IMPORTED_MODULE_2__.join)(root, customConfig);
2835
2835
  if (node_fs__WEBPACK_IMPORTED_MODULE_0__["default"].existsSync(customConfigPath)) return customConfigPath;
2836
- throw `Cannot find config file: ${_utils__WEBPACK_IMPORTED_MODULE_3__.$_.dim(customConfigPath)}`;
2836
+ throw `Cannot find config file: ${_utils__WEBPACK_IMPORTED_MODULE_3__.yW.dim(customConfigPath)}`;
2837
2837
  }
2838
- const configFilePath = findConfig((0, pathe__WEBPACK_IMPORTED_MODULE_2__.join)(root, _utils__WEBPACK_IMPORTED_MODULE_3__.F7));
2838
+ const configFilePath = findConfig((0, pathe__WEBPACK_IMPORTED_MODULE_2__.join)(root, _utils__WEBPACK_IMPORTED_MODULE_3__.t));
2839
2839
  if (configFilePath) return configFilePath;
2840
2840
  return null;
2841
2841
  };
2842
2842
  async function loadConfig({ cwd = process.cwd(), path, envMode, configLoader }) {
2843
2843
  const configFilePath = resolveConfigPath(cwd, path);
2844
2844
  if (!configFilePath) {
2845
- _utils__WEBPACK_IMPORTED_MODULE_3__.kg.debug('no rstest config file found');
2845
+ _utils__WEBPACK_IMPORTED_MODULE_3__.vF.debug('no rstest config file found');
2846
2846
  return {
2847
2847
  content: {},
2848
2848
  filePath: configFilePath
@@ -2903,7 +2903,7 @@ ${section.body}` : section.body).join("\n\n"));
2903
2903
  const merged = mergeRstestConfig(createDefaultConfig(), config);
2904
2904
  merged.include = config.include || merged.include;
2905
2905
  merged.exclude = (config.exclude || merged.exclude || []).concat([
2906
- _utils__WEBPACK_IMPORTED_MODULE_3__.f1
2906
+ _utils__WEBPACK_IMPORTED_MODULE_3__.EJ
2907
2907
  ]);
2908
2908
  merged.reporters = config.reporters ?? merged.reporters;
2909
2909
  merged.pool = 'string' == typeof config.pool ? {
@@ -2914,11 +2914,11 @@ ${section.body}` : section.body).join("\n\n"));
2914
2914
  },
2915
2915
  "./src/utils/constants.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2916
2916
  __webpack_require__.d(__webpack_exports__, {
2917
- F7: ()=>DEFAULT_CONFIG_NAME,
2918
- Io: ()=>DEFAULT_CONFIG_EXTENSIONS,
2919
- Nk: ()=>TEMP_RSTEST_OUTPUT_DIR,
2920
- Qd: ()=>TEST_DELIMITER,
2921
- f1: ()=>TEMP_RSTEST_OUTPUT_DIR_GLOB
2917
+ EJ: ()=>TEMP_RSTEST_OUTPUT_DIR_GLOB,
2918
+ kv: ()=>DEFAULT_CONFIG_EXTENSIONS,
2919
+ t: ()=>DEFAULT_CONFIG_NAME,
2920
+ vO: ()=>TEST_DELIMITER,
2921
+ zZ: ()=>TEMP_RSTEST_OUTPUT_DIR
2922
2922
  });
2923
2923
  const DEFAULT_CONFIG_NAME = 'rstest.config';
2924
2924
  const TEST_DELIMITER = '>';
@@ -2935,17 +2935,17 @@ ${section.body}` : section.body).join("\n\n"));
2935
2935
  },
2936
2936
  "./src/utils/helper.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2937
2937
  __webpack_require__.d(__webpack_exports__, {
2938
- $_: ()=>picocolors__WEBPACK_IMPORTED_MODULE_2___default.a,
2939
- AS: ()=>prettyTime,
2940
- H: ()=>parsePosix,
2941
- PA: ()=>needFlagExperimentalDetectModule,
2942
- Tn: ()=>NODE_BUILTINS,
2943
- XQ: ()=>castArray,
2944
- Yz: ()=>getTaskNameWithPrefix,
2945
- Z: ()=>formatError,
2946
- ZY: ()=>getAbsolutePath,
2947
- _l: ()=>isTTY,
2948
- v8: ()=>serializableConfig
2938
+ C3: ()=>needFlagExperimentalDetectModule,
2939
+ FI: ()=>getAbsolutePath,
2940
+ Kv: ()=>NODE_BUILTINS,
2941
+ Ok: ()=>serializableConfig,
2942
+ P2: ()=>parsePosix,
2943
+ Un: ()=>isTTY,
2944
+ Wk: ()=>formatError,
2945
+ bg: ()=>castArray,
2946
+ fN: ()=>getTaskNameWithPrefix,
2947
+ kV: ()=>prettyTime,
2948
+ yW: ()=>picocolors__WEBPACK_IMPORTED_MODULE_2___default.a
2949
2949
  });
2950
2950
  var pathe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("pathe");
2951
2951
  var picocolors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
@@ -2997,7 +2997,7 @@ ${section.body}` : section.body).join("\n\n"));
2997
2997
  return time;
2998
2998
  };
2999
2999
  const getTaskNames = (test)=>(test.parentNames || []).concat(test.name).filter(Boolean);
3000
- const getTaskNameWithPrefix = (test, delimiter = _constants__WEBPACK_IMPORTED_MODULE_1__.Qd)=>getTaskNames(test).join(` ${delimiter} `);
3000
+ const getTaskNameWithPrefix = (test, delimiter = _constants__WEBPACK_IMPORTED_MODULE_1__.vO)=>getTaskNames(test).join(` ${delimiter} `);
3001
3001
  const REGEXP_FLAG_PREFIX = 'RSTEST_REGEXP:';
3002
3002
  const wrapRegex = (value)=>`${REGEXP_FLAG_PREFIX}${value.toString()}`;
3003
3003
  const serializableConfig = (normalizedConfig)=>{
@@ -3090,25 +3090,25 @@ ${section.body}` : section.body).join("\n\n"));
3090
3090
  },
3091
3091
  "./src/utils/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
3092
3092
  __webpack_require__.d(__webpack_exports__, {
3093
- F7: ()=>constants.F7,
3094
- GL: ()=>getTestEntries,
3095
- aj: ()=>prettyTestPath,
3096
- _l: ()=>helper._l,
3097
- aA: ()=>getSetupFiles,
3098
- kg: ()=>logger.k,
3099
- Io: ()=>constants.Io,
3100
- Ps: ()=>formatTestPath,
3101
- XQ: ()=>helper.XQ,
3102
- Nk: ()=>constants.Nk,
3103
- Tn: ()=>helper.Tn,
3104
- $_: ()=>helper.$_,
3105
- Yz: ()=>helper.Yz,
3106
- PA: ()=>helper.PA,
3107
- L1: ()=>logger.L,
3108
- v8: ()=>helper.v8,
3109
- Qd: ()=>constants.Qd,
3110
- f1: ()=>constants.f1,
3111
- AS: ()=>helper.AS
3093
+ C3: ()=>helper.C3,
3094
+ Ok: ()=>helper.Ok,
3095
+ XJ: ()=>formatTestPath,
3096
+ zZ: ()=>constants.zZ,
3097
+ fN: ()=>helper.fN,
3098
+ vF: ()=>logger.v,
3099
+ vO: ()=>constants.vO,
3100
+ tG: ()=>getTestEntries,
3101
+ kv: ()=>constants.kv,
3102
+ yW: ()=>helper.yW,
3103
+ EQ: ()=>prettyTestPath,
3104
+ _o: ()=>logger._,
3105
+ pr: ()=>getSetupFiles,
3106
+ Kv: ()=>helper.Kv,
3107
+ t: ()=>constants.t,
3108
+ kV: ()=>helper.kV,
3109
+ EJ: ()=>constants.EJ,
3110
+ bg: ()=>helper.bg,
3111
+ Un: ()=>helper.Un
3112
3112
  });
3113
3113
  var constants = __webpack_require__("./src/utils/constants.ts");
3114
3114
  var helper = __webpack_require__("./src/utils/helper.ts");
@@ -3177,12 +3177,12 @@ ${section.body}` : section.body).join("\n\n"));
3177
3177
  return;
3178
3178
  }
3179
3179
  };
3180
- const getSetupFiles = (setups, rootPath)=>Object.fromEntries((0, helper.XQ)(setups).map((setupFile)=>{
3181
- const setupFilePath = (0, helper.ZY)(rootPath, setupFile);
3180
+ const getSetupFiles = (setups, rootPath)=>Object.fromEntries((0, helper.bg)(setups).map((setupFile)=>{
3181
+ const setupFilePath = (0, helper.FI)(rootPath, setupFile);
3182
3182
  try {
3183
3183
  if (!(0, external_node_fs_.existsSync)(setupFilePath)) {
3184
- let errorMessage = `Setup file ${helper.$_.red(setupFile)} not found`;
3185
- if (setupFilePath !== setupFile) errorMessage += helper.$_.gray(` (resolved path: ${setupFilePath})`);
3184
+ let errorMessage = `Setup file ${helper.yW.red(setupFile)} not found`;
3185
+ if (setupFilePath !== setupFile) errorMessage += helper.yW.gray(` (resolved path: ${setupFilePath})`);
3186
3186
  throw errorMessage;
3187
3187
  }
3188
3188
  const relativePath = external_pathe_["default"].relative(rootPath, setupFilePath);
@@ -3199,8 +3199,8 @@ ${section.body}` : section.body).join("\n\n"));
3199
3199
  }
3200
3200
  }));
3201
3201
  const prettyTestPath = (testPath)=>{
3202
- const { dir, base } = (0, helper.H)(testPath);
3203
- return `${'.' !== dir ? helper.$_.gray(`${dir}/`) : ''}${helper.$_.cyan(base)}`;
3202
+ const { dir, base } = (0, helper.P2)(testPath);
3203
+ return `${'.' !== dir ? helper.yW.gray(`${dir}/`) : ''}${helper.yW.cyan(base)}`;
3204
3204
  };
3205
3205
  const formatTestPath = (root, testFilePath)=>{
3206
3206
  let testPath = testFilePath;
@@ -3210,8 +3210,8 @@ ${section.body}` : section.body).join("\n\n"));
3210
3210
  },
3211
3211
  "./src/utils/logger.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
3212
3212
  __webpack_require__.d(__webpack_exports__, {
3213
- L: ()=>isDebug,
3214
- k: ()=>src_logger
3213
+ v: ()=>src_logger,
3214
+ _: ()=>isDebug
3215
3215
  });
3216
3216
  var external_node_os_ = __webpack_require__("node:os");
3217
3217
  var external_node_tty_ = __webpack_require__("node:tty");
@@ -3482,8 +3482,8 @@ ${section.body}` : section.body).join("\n\n"));
3482
3482
  src_logger.override({
3483
3483
  debug: (message, ...args)=>{
3484
3484
  if ('verbose' !== src_logger.level) return;
3485
- const time = helper.$_.gray(getTime());
3486
- console.log(` ${helper.$_.magenta('rstest')} ${time} ${message}`, ...args);
3485
+ const time = helper.yW.gray(getTime());
3486
+ console.log(` ${helper.yW.magenta('rstest')} ${time} ${message}`, ...args);
3487
3487
  }
3488
3488
  });
3489
3489
  },
@@ -3825,7 +3825,7 @@ __webpack_require__.m = __webpack_modules__;
3825
3825
  })();
3826
3826
  (()=>{
3827
3827
  var installedChunks = {
3828
- 980: 0
3828
+ 410: 0
3829
3829
  };
3830
3830
  var installChunk = (data)=>{
3831
3831
  var __webpack_ids__ = data.__webpack_ids__;
@@ -3864,17 +3864,17 @@ var logger = __webpack_require__("./src/utils/logger.ts");
3864
3864
  var commands = __webpack_require__("./src/cli/commands.ts");
3865
3865
  var prepare = __webpack_require__("./src/cli/prepare.ts");
3866
3866
  async function runCLI() {
3867
- (0, prepare.n)();
3867
+ (0, prepare.k)();
3868
3868
  try {
3869
- (0, commands.X_)();
3869
+ (0, commands.QF)();
3870
3870
  } catch (err) {
3871
- logger.k.error('Failed to start Rstest CLI.');
3872
- logger.k.error(err);
3871
+ logger.v.error('Failed to start Rstest CLI.');
3872
+ logger.v.error(err);
3873
3873
  }
3874
3874
  }
3875
3875
  var src_config = __webpack_require__("./src/config.ts");
3876
3876
  function defineConfig(config) {
3877
3877
  return config;
3878
3878
  }
3879
- var __webpack_exports__mergeRstestConfig = src_config.en;
3879
+ var __webpack_exports__mergeRstestConfig = src_config.ST;
3880
3880
  export { defineConfig, runCLI, __webpack_exports__mergeRstestConfig as mergeRstestConfig };
package/dist/worker.js CHANGED
@@ -4967,11 +4967,11 @@ var __webpack_modules__ = {
4967
4967
  },
4968
4968
  "./src/runtime/util.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4969
4969
  __webpack_require__.d(__webpack_exports__, {
4970
- KY: ()=>formatName,
4971
- BH: ()=>getRealTimers,
4972
- CD: ()=>setRealTimers,
4973
- Ni: ()=>TestRegisterError,
4974
- ov: ()=>formatTestError
4970
+ zH: ()=>setRealTimers,
4971
+ nD: ()=>formatName,
4972
+ o9: ()=>formatTestError,
4973
+ si: ()=>TestRegisterError,
4974
+ rZ: ()=>getRealTimers
4975
4975
  });
4976
4976
  var external_node_util_ = __webpack_require__("node:util");
4977
4977
  var build = __webpack_require__("../../node_modules/.pnpm/jest-diff@30.0.5/node_modules/jest-diff/build/index.js");
@@ -5045,9 +5045,9 @@ var __webpack_modules__ = {
5045
5045
  },
5046
5046
  "./src/utils/constants.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5047
5047
  __webpack_require__.d(__webpack_exports__, {
5048
- Qd: ()=>TEST_DELIMITER,
5049
- io: ()=>globalApis,
5050
- n1: ()=>ROOT_SUITE_NAME
5048
+ TE: ()=>globalApis,
5049
+ q_: ()=>ROOT_SUITE_NAME,
5050
+ vO: ()=>TEST_DELIMITER
5051
5051
  });
5052
5052
  const TEST_DELIMITER = '>';
5053
5053
  const ROOT_SUITE_NAME = 'Rstest:_internal_root_suite';
@@ -5067,12 +5067,12 @@ var __webpack_modules__ = {
5067
5067
  },
5068
5068
  "./src/utils/helper.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5069
5069
  __webpack_require__.d(__webpack_exports__, {
5070
- $_: ()=>picocolors__WEBPACK_IMPORTED_MODULE_2___default.a,
5071
- AS: ()=>prettyTime,
5072
- Kn: ()=>isObject,
5073
- PQ: ()=>undoSerializableConfig,
5074
- XQ: ()=>castArray,
5075
- Yz: ()=>getTaskNameWithPrefix
5070
+ Gv: ()=>isObject,
5071
+ bg: ()=>castArray,
5072
+ fN: ()=>getTaskNameWithPrefix,
5073
+ gy: ()=>undoSerializableConfig,
5074
+ kV: ()=>prettyTime,
5075
+ yW: ()=>picocolors__WEBPACK_IMPORTED_MODULE_2___default.a
5076
5076
  });
5077
5077
  __webpack_require__("pathe");
5078
5078
  var picocolors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
@@ -5104,7 +5104,7 @@ var __webpack_modules__ = {
5104
5104
  return time;
5105
5105
  };
5106
5106
  const getTaskNames = (test)=>(test.parentNames || []).concat(test.name).filter(Boolean);
5107
- const getTaskNameWithPrefix = (test, delimiter = _constants__WEBPACK_IMPORTED_MODULE_1__.Qd)=>getTaskNames(test).join(` ${delimiter} `);
5107
+ const getTaskNameWithPrefix = (test, delimiter = _constants__WEBPACK_IMPORTED_MODULE_1__.vO)=>getTaskNames(test).join(` ${delimiter} `);
5108
5108
  const REGEXP_FLAG_PREFIX = 'RSTEST_REGEXP:';
5109
5109
  const unwrapRegex = (value)=>{
5110
5110
  if (value.startsWith(REGEXP_FLAG_PREFIX)) {
@@ -5127,7 +5127,7 @@ var __webpack_modules__ = {
5127
5127
  },
5128
5128
  "./src/utils/logger.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5129
5129
  __webpack_require__.d(__webpack_exports__, {
5130
- k: ()=>src_logger
5130
+ v: ()=>src_logger
5131
5131
  });
5132
5132
  var external_node_os_ = __webpack_require__("node:os");
5133
5133
  var external_node_tty_ = __webpack_require__("node:tty");
@@ -5398,8 +5398,8 @@ var __webpack_modules__ = {
5398
5398
  src_logger.override({
5399
5399
  debug: (message, ...args)=>{
5400
5400
  if ('verbose' !== src_logger.level) return;
5401
- const time = helper.$_.gray(getTime());
5402
- console.log(` ${helper.$_.magenta('rstest')} ${time} ${message}`, ...args);
5401
+ const time = helper.yW.gray(getTime());
5402
+ console.log(` ${helper.yW.magenta('rstest')} ${time} ${message}`, ...args);
5403
5403
  }
5404
5404
  });
5405
5405
  },
@@ -5533,7 +5533,7 @@ __webpack_require__.m = __webpack_modules__;
5533
5533
  })();
5534
5534
  (()=>{
5535
5535
  var installedChunks = {
5536
- 192: 0
5536
+ 270: 0
5537
5537
  };
5538
5538
  var installChunk = (data)=>{
5539
5539
  var __webpack_ids__ = data.__webpack_ids__;
@@ -5641,7 +5641,7 @@ const createRequire = (filename, distPath, rstestContext, assetFiles, interopDef
5641
5641
  interopDefault
5642
5642
  });
5643
5643
  } catch (err) {
5644
- logger.k.error(`load file ${joinedPath} failed:\n`, err instanceof Error ? err.message : err);
5644
+ logger.v.error(`load file ${joinedPath} failed:\n`, err instanceof Error ? err.message : err);
5645
5645
  }
5646
5646
  const resolved = _require.resolve(id);
5647
5647
  return _require(resolved);
@@ -5804,20 +5804,20 @@ class RstestSnapshotEnvironment extends NodeSnapshotEnvironment {
5804
5804
  return `// Rstest Snapshot v${this.getVersion()}`;
5805
5805
  }
5806
5806
  }
5807
- const getGlobalApi = (api)=>constants.io.reduce((apis, key)=>{
5807
+ const getGlobalApi = (api)=>constants.TE.reduce((apis, key)=>{
5808
5808
  apis[key] = api[key];
5809
5809
  return apis;
5810
5810
  }, {});
5811
5811
  const listeners = [];
5812
5812
  let isTeardown = false;
5813
5813
  const preparePool = async ({ entryInfo: { distPath, testPath }, sourceMaps, updateSnapshot, context })=>{
5814
- (0, util.CD)();
5815
- context.runtimeConfig = (0, helper.PQ)(context.runtimeConfig);
5814
+ (0, util.zH)();
5815
+ context.runtimeConfig = (0, helper.gy)(context.runtimeConfig);
5816
5816
  const cleanupFns = [];
5817
5817
  const { rpc } = createRuntimeRpc(createForksRpcOptions());
5818
5818
  const { runtimeConfig: { globals, printConsoleTrace, disableConsoleIntercept, testEnvironment } } = context;
5819
5819
  if (!disableConsoleIntercept) {
5820
- const { createCustomConsole } = await __webpack_require__.e("813").then(__webpack_require__.bind(__webpack_require__, "./src/runtime/worker/console.ts"));
5820
+ const { createCustomConsole } = await __webpack_require__.e("607").then(__webpack_require__.bind(__webpack_require__, "./src/runtime/worker/console.ts"));
5821
5821
  global.console = createCustomConsole({
5822
5822
  rpc,
5823
5823
  testPath,
@@ -5836,10 +5836,10 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, sourceMaps, upda
5836
5836
  environment: 'node'
5837
5837
  };
5838
5838
  const { createRstestRuntime } = await Promise.all([
5839
- __webpack_require__.e("208"),
5840
- __webpack_require__.e("867")
5839
+ __webpack_require__.e("655"),
5840
+ __webpack_require__.e("85")
5841
5841
  ]).then(__webpack_require__.bind(__webpack_require__, "./src/runtime/api/index.ts"));
5842
- const { install } = await __webpack_require__.e("64").then(__webpack_require__.t.bind(__webpack_require__, "../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js", 23));
5842
+ const { install } = await __webpack_require__.e("969").then(__webpack_require__.t.bind(__webpack_require__, "../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js", 23));
5843
5843
  install({
5844
5844
  retrieveSourceMap: (source)=>{
5845
5845
  if (sourceMaps[source]) return {
@@ -5849,14 +5849,16 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, sourceMaps, upda
5849
5849
  return null;
5850
5850
  }
5851
5851
  });
5852
- listeners.forEach((fn)=>fn());
5852
+ listeners.forEach((fn)=>{
5853
+ fn();
5854
+ });
5853
5855
  listeners.length = 0;
5854
5856
  const unhandledErrors = [];
5855
5857
  const handleError = (e, type)=>{
5856
5858
  const error = 'string' == typeof e ? new Error(e) : e;
5857
5859
  error.name = type;
5858
5860
  if (isTeardown) {
5859
- error.stack = `${helper.$_.yellow('Caught error after test environment was torn down:')}\n\n${error.stack}`;
5861
+ error.stack = `${helper.yW.yellow('Caught error after test environment was torn down:')}\n\n${error.stack}`;
5860
5862
  console.error(error);
5861
5863
  } else {
5862
5864
  console.error(error);
@@ -5877,14 +5879,14 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, sourceMaps, upda
5877
5879
  break;
5878
5880
  case 'jsdom':
5879
5881
  {
5880
- const { environment } = await __webpack_require__.e("965").then(__webpack_require__.bind(__webpack_require__, "./src/runtime/worker/env/jsdom.ts"));
5882
+ const { environment } = await __webpack_require__.e("711").then(__webpack_require__.bind(__webpack_require__, "./src/runtime/worker/env/jsdom.ts"));
5881
5883
  const { teardown } = await environment.setup(global, {});
5882
5884
  cleanupFns.push(()=>teardown(global));
5883
5885
  break;
5884
5886
  }
5885
5887
  case 'happy-dom':
5886
5888
  {
5887
- const { environment } = await __webpack_require__.e("44").then(__webpack_require__.bind(__webpack_require__, "./src/runtime/worker/env/happyDom.ts"));
5889
+ const { environment } = await __webpack_require__.e("350").then(__webpack_require__.bind(__webpack_require__, "./src/runtime/worker/env/happyDom.ts"));
5888
5890
  const { teardown } = await environment.setup(global, {});
5889
5891
  cleanupFns.push(async ()=>teardown(global));
5890
5892
  break;
@@ -5958,7 +5960,7 @@ const runInPool = async (options)=>{
5958
5960
  });
5959
5961
  process.off('SIGTERM', onExit);
5960
5962
  const teardown = async ()=>{
5961
- await new Promise((resolve)=>(0, util.BH)().setTimeout(resolve));
5963
+ await new Promise((resolve)=>(0, util.rZ)().setTimeout(resolve));
5962
5964
  await Promise.all(cleanups.map((fn)=>fn()));
5963
5965
  isTeardown = true;
5964
5966
  process.once('SIGTERM', onExit);
@@ -5979,13 +5981,13 @@ const runInPool = async (options)=>{
5979
5981
  return {
5980
5982
  testPath,
5981
5983
  tests,
5982
- errors: (0, util.ov)(unhandledErrors)
5984
+ errors: (0, util.o9)(unhandledErrors)
5983
5985
  };
5984
5986
  } catch (err) {
5985
5987
  return {
5986
5988
  testPath,
5987
5989
  tests: [],
5988
- errors: (0, util.ov)(err)
5990
+ errors: (0, util.o9)(err)
5989
5991
  };
5990
5992
  } finally{
5991
5993
  await teardown();
@@ -6015,7 +6017,7 @@ const runInPool = async (options)=>{
6015
6017
  }, api);
6016
6018
  if (unhandledErrors.length > 0) {
6017
6019
  results.status = 'fail';
6018
- results.errors = (results.errors || []).concat(...(0, util.ov)(unhandledErrors));
6020
+ results.errors = (results.errors || []).concat(...(0, util.o9)(unhandledErrors));
6019
6021
  }
6020
6022
  return results;
6021
6023
  } catch (err) {
@@ -6024,7 +6026,7 @@ const runInPool = async (options)=>{
6024
6026
  status: 'fail',
6025
6027
  name: '',
6026
6028
  results: [],
6027
- errors: (0, util.ov)(err)
6029
+ errors: (0, util.o9)(err)
6028
6030
  };
6029
6031
  } finally{
6030
6032
  await teardown();
@@ -646,6 +646,7 @@ declare class GithubActionsReporter {
646
646
  onWritePath: (path: string) => string;
647
647
  };
648
648
  });
649
+ private log;
649
650
  onTestRunEnd({ results, testResults, getSourcemap, }: {
650
651
  results: TestFileResult[];
651
652
  testResults: TestResult[];
@@ -543,6 +543,7 @@ declare class GithubActionsReporter {
543
543
  onWritePath: (path: string) => string;
544
544
  };
545
545
  });
546
+ private log;
546
547
  onTestRunEnd({ results, testResults, getSourcemap, }: {
547
548
  results: TestFileResult[];
548
549
  testResults: TestResult[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rstest/core",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "The Rsbuild-based test tool.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/web-infra-dev/rstest/issues"
@@ -46,7 +46,7 @@
46
46
  "dependencies": {
47
47
  "chai": "^5.2.1",
48
48
  "@types/chai": "^5.2.2",
49
- "@rsbuild/core": "1.4.15",
49
+ "@rsbuild/core": "1.5.0-beta.4",
50
50
  "birpc": "2.5.0",
51
51
  "pathe": "^2.0.3",
52
52
  "std-env": "^3.9.0",
@@ -56,9 +56,9 @@
56
56
  "@vitest/expect": "^3.2.4",
57
57
  "@vitest/snapshot": "^3.2.4",
58
58
  "@babel/code-frame": "^7.27.1",
59
- "@jridgewell/trace-mapping": "0.3.29",
59
+ "@jridgewell/trace-mapping": "0.3.30",
60
60
  "@microsoft/api-extractor": "^7.52.10",
61
- "@rslib/core": "0.11.2",
61
+ "@rslib/core": "0.12.2",
62
62
  "@sinonjs/fake-timers": "^14.0.0",
63
63
  "@types/babel__code-frame": "^7.0.6",
64
64
  "@types/jsdom": "^21.1.7",
File without changes
File without changes