@rstest/core 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/353.js CHANGED
@@ -454,7 +454,7 @@ export const __webpack_modules__ = {
454
454
  });
455
455
  return {
456
456
  command,
457
- version: "0.0.8",
457
+ version: "0.0.9",
458
458
  rootPath,
459
459
  reporters,
460
460
  snapshotManager,
package/dist/612.js CHANGED
@@ -263,15 +263,15 @@ global.__rstest_clean_core_cache__ = __rstest_clean_core_cache__;
263
263
  return callback();
264
264
  });
265
265
  };
266
- const autoExternalNodeBuiltin = ({ request, dependencyType }, callback)=>{
267
- if (!request) return callback();
266
+ function autoExternalNodeBuiltin({ request, dependencyType }, callback) {
267
+ if (!request) return void callback();
268
268
  const isNodeBuiltin = utils.Tn.some((builtin)=>{
269
269
  if ('string' == typeof builtin) return builtin === request;
270
270
  return builtin.test(request);
271
271
  });
272
272
  if (isNodeBuiltin) callback(void 0, request, 'commonjs' === dependencyType ? 'commonjs' : 'module-import');
273
273
  else callback();
274
- };
274
+ }
275
275
  const prepareRsbuild = async (context, globTestSourceEntries, setupFiles)=>{
276
276
  const { command, normalizedConfig: { isolate, name, plugins, resolve, source, output, tools, testEnvironment, performance, dev = {} } } = context;
277
277
  const debugMode = (0, utils.L1)();
@@ -311,6 +311,9 @@ global.__rstest_clean_core_cache__ = __rstest_clean_core_cache__;
311
311
  sourceMap: {
312
312
  js: 'source-map'
313
313
  },
314
+ externals: 'node' === testEnvironment ? [
315
+ autoExternalNodeModules
316
+ ] : void 0,
314
317
  distPath: {
315
318
  root: utils.Nk
316
319
  },
@@ -333,7 +336,6 @@ global.__rstest_clean_core_cache__ = __rstest_clean_core_cache__;
333
336
  config.externals.unshift({
334
337
  '@rstest/core': 'global @rstest/core'
335
338
  });
336
- if ('node' === testEnvironment) config.externals.push(autoExternalNodeModules);
337
339
  config.externalsPresets ??= {};
338
340
  config.externalsPresets.node = false;
339
341
  config.externals.push(autoExternalNodeBuiltin);
@@ -342,6 +344,7 @@ global.__rstest_clean_core_cache__ = __rstest_clean_core_cache__;
342
344
  importDynamic: false,
343
345
  requireDynamic: false,
344
346
  requireAsExpression: false,
347
+ requireResolve: false,
345
348
  ...config.module.parser.javascript || {}
346
349
  };
347
350
  config.resolve ??= {};
package/dist/cli.js CHANGED
@@ -3690,7 +3690,7 @@ function prepareCli() {
3690
3690
  if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
3691
3691
  }
3692
3692
  function showRstest() {
3693
- logger.k.greet(" Rstest v0.0.8");
3693
+ logger.k.greet(" Rstest v0.0.9");
3694
3694
  logger.k.log('');
3695
3695
  }
3696
3696
  const applyCommonOptions = (cli)=>{
@@ -3738,7 +3738,7 @@ async function initCli(options) {
3738
3738
  function setupCommands() {
3739
3739
  const cli = dist('rstest');
3740
3740
  cli.help();
3741
- cli.version("0.0.8");
3741
+ cli.version("0.0.9");
3742
3742
  applyCommonOptions(cli);
3743
3743
  cli.command('[...filters]', 'run tests').action(async (filters, options)=>{
3744
3744
  showRstest();
@@ -746,7 +746,7 @@ declare type RstestUtilities = {
746
746
  /**
747
747
  * Mock a module
748
748
  */
749
- mock: <T = unknown>(moduleName: string, moduleFactory?: () => T) => void;
749
+ mock: <T = unknown>(moduleName: string, moduleFactory?: () => T | Promise<T>) => void;
750
750
  /**
751
751
  * Mock a module
752
752
  */
@@ -754,7 +754,7 @@ declare type RstestUtilities = {
754
754
  /**
755
755
  * Mock a module, not hoisted.
756
756
  */
757
- doMock: <T = unknown>(moduleName: string, moduleFactory?: () => T) => void;
757
+ doMock: <T = unknown>(moduleName: string, moduleFactory?: () => T | Promise<T>) => void;
758
758
  /**
759
759
  * Mock a module, not hoisted.
760
760
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rstest/core",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "The Rsbuild-based test tool.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/web-infra-dev/rstest/issues"
@@ -48,11 +48,11 @@
48
48
  "importMeta.d.ts"
49
49
  ],
50
50
  "dependencies": {
51
- "@rsbuild/core": "1.4.7",
51
+ "@rsbuild/core": "1.4.8",
52
52
  "@types/chai": "^5.2.2",
53
53
  "@vitest/expect": "^3.2.4",
54
54
  "@vitest/snapshot": "^3.2.4",
55
- "birpc": "2.4.0",
55
+ "birpc": "2.5.0",
56
56
  "chai": "^5.2.1",
57
57
  "pathe": "^2.0.3",
58
58
  "std-env": "^3.9.0",
@@ -62,7 +62,7 @@
62
62
  "@babel/code-frame": "^7.27.1",
63
63
  "@jridgewell/trace-mapping": "0.3.29",
64
64
  "@microsoft/api-extractor": "^7.52.8",
65
- "@rslib/core": "0.10.5",
65
+ "@rslib/core": "0.10.6",
66
66
  "@sinonjs/fake-timers": "^14.0.0",
67
67
  "@types/babel__code-frame": "^7.0.6",
68
68
  "@types/jsdom": "^21.1.7",