@rstest/core 0.3.3 → 0.3.4

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/263.js CHANGED
@@ -555,7 +555,7 @@ export const __webpack_modules__ = {
555
555
  });
556
556
  this.reporters = reporters;
557
557
  this.snapshotManager = snapshotManager;
558
- this.version = "0.3.3";
558
+ this.version = "0.3.4";
559
559
  this.rootPath = rootPath;
560
560
  this.originalConfig = userConfig;
561
561
  this.normalizedConfig = rstestConfig;
package/dist/index.js CHANGED
@@ -2712,7 +2712,7 @@ ${section.body}` : section.body).join("\n\n"));
2712
2712
  function setupCommands() {
2713
2713
  const cli = dist('rstest');
2714
2714
  cli.help();
2715
- cli.version("0.3.3");
2715
+ cli.version("0.3.4");
2716
2716
  applyCommonOptions(cli);
2717
2717
  cli.command('[...filters]', 'run tests').option('-w, --watch', 'Run tests in watch mode').action(async (filters, options)=>{
2718
2718
  (0, prepare.N)();
@@ -2785,7 +2785,7 @@ ${section.body}` : section.body).join("\n\n"));
2785
2785
  if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
2786
2786
  }
2787
2787
  function showRstest() {
2788
- _utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.greet(" Rstest v0.3.3");
2788
+ _utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.greet(" Rstest v0.3.4");
2789
2789
  _utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.log('');
2790
2790
  }
2791
2791
  },
package/dist/worker.js CHANGED
@@ -5826,8 +5826,8 @@ class RstestSnapshotEnvironment extends NodeSnapshotEnvironment {
5826
5826
  return `// Rstest Snapshot v${this.getVersion()}`;
5827
5827
  }
5828
5828
  }
5829
- const getGlobalApi = (api)=>constants.TE.reduce((apis, key)=>{
5830
- apis[key] = api[key];
5829
+ const registerGlobalApi = (api)=>constants.TE.reduce((apis, key)=>{
5830
+ globalThis[key] = api[key];
5831
5831
  return apis;
5832
5832
  }, {});
5833
5833
  const listeners = [];
@@ -5916,11 +5916,11 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, sourceMaps, upda
5916
5916
  default:
5917
5917
  throw new Error(`Unknown test environment: ${testEnvironment}`);
5918
5918
  }
5919
+ if (globals) registerGlobalApi(api);
5919
5920
  const rstestContext = {
5920
5921
  global,
5921
5922
  console: global.console,
5922
- Error,
5923
- ...globals ? getGlobalApi(api) : {}
5923
+ Error
5924
5924
  };
5925
5925
  rstestContext.global['@rstest/core'] = api;
5926
5926
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rstest/core",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "The Rsbuild-based test tool.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/web-infra-dev/rstest/issues"