@rstest/core 0.7.5 → 0.7.7

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 (44) 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} +10 -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 -8
  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~973.js → 0~6973.js} +5 -5
  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 +26 -13
  19. package/dist/0~8957.js +149 -0
  20. package/dist/{0~634.js → 0~9634.js} +6 -6
  21. package/dist/{157.js → 1157.js} +4 -4
  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/{734.js → 5734.js} +4 -4
  28. package/dist/6198.js +3 -0
  29. package/dist/{913.js → 7913.js} +7 -7
  30. package/dist/{131.js → 9131.js} +32 -15
  31. package/dist/globalSetupWorker.js +8 -6
  32. package/dist/index.d.ts +13 -1
  33. package/dist/index.js +1 -1
  34. package/dist/rslib-runtime.js +1 -1
  35. package/dist/worker.d.ts +13 -1
  36. package/package.json +5 -5
  37. package/dist/198.js +0 -4
  38. package/dist/881.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/{693.js → 5693.js} +0 -0
  44. /package/dist/{913.js.LICENSE.txt → 7913.js.LICENSE.txt} +0 -0
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025-present Bytedance, Inc. and its affiliates.
3
+ Copyright (c) 2025-present ByteDance, Inc. and its affiliates.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/0~130.js CHANGED
@@ -3,8 +3,8 @@ import 'module';
3
3
  import { __webpack_require__ } from "./rslib-runtime.js";
4
4
  import { AssertionError, strict } from "node:assert";
5
5
  import { Console } from "node:console";
6
- import "./693.js";
7
- import { prettyTime } from "./157.js";
6
+ import "./5693.js";
7
+ import { prettyTime } from "./1157.js";
8
8
  const external_node_util_ = __webpack_require__("node:util");
9
9
  const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
10
10
  var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
@@ -1,11 +1,11 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
3
  import { __webpack_require__ } from "./rslib-runtime.js";
4
- import "./693.js";
5
- import { getTestEntries, isTTY } from "./157.js";
6
- import { createCoverageProvider } from "./734.js";
4
+ import "./5693.js";
5
+ import { getTestEntries, isTTY } from "./1157.js";
6
+ import { createCoverageProvider } from "./5734.js";
7
7
  import { prepareRsbuild, createPool, createRsbuildServer, runGlobalTeardown, runGlobalSetup } from "./0~89.js";
8
- import { clearScreen, logger_logger } from "./278.js";
8
+ import { clearScreen, logger_logger } from "./3278.js";
9
9
  const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
10
10
  var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
11
11
  const isCliShortcutsEnabled = ()=>isTTY('stdin');
@@ -168,7 +168,7 @@ async function runTests(context) {
168
168
  });
169
169
  return entries;
170
170
  };
171
- const { getSetupFiles } = await import("./0~973.js").then((mod)=>({
171
+ const { getSetupFiles } = await import("./0~6973.js").then((mod)=>({
172
172
  getSetupFiles: mod.getSetupFiles
173
173
  }));
174
174
  const setupFiles = Object.fromEntries(context.projects.map((project)=>{
@@ -202,7 +202,8 @@ async function runTests(context) {
202
202
  rsbuildInstance,
203
203
  rootPath
204
204
  });
205
- const recommendWorkerCount = 'watch' === command ? 1 / 0 : Array.from(entriesCache.values()).reduce((acc, entry)=>acc + Object.keys(entry.entries).length, 0);
205
+ const entryFiles = Array.from(entriesCache.values()).reduce((acc, entry)=>acc.concat(Object.values(entry.entries) || []), []);
206
+ const recommendWorkerCount = 'watch' === command ? 1 / 0 : entryFiles.length;
206
207
  const pool = await createPool({
207
208
  context,
208
209
  recommendWorkerCount
@@ -214,6 +215,7 @@ async function runTests(context) {
214
215
  const currentEntries = [];
215
216
  const currentDeletedEntries = [];
216
217
  context.stateManager.reset();
218
+ context.stateManager.testFiles = isWatchMode ? void 0 : entryFiles;
217
219
  const returns = await Promise.all(context.projects.map(async (p)=>{
218
220
  const { assetNames, entries, setupEntries, globalSetupEntries, getAssetFiles, getSourceMaps, affectedEntries, deletedEntries } = await getRsbuildStats({
219
221
  environmentName: p.environmentName,
@@ -312,7 +314,7 @@ async function runTests(context) {
312
314
  filterRerunTestPaths: currentEntries.length ? currentEntries.map((e)=>e.testPath) : void 0
313
315
  });
314
316
  if (coverageProvider && (!isFailure || coverage.reportOnFailure)) {
315
- const { generateCoverage } = await import("./0~403.js").then((mod)=>({
317
+ const { generateCoverage } = await import("./0~4403.js").then((mod)=>({
316
318
  generateCoverage: mod.generateCoverage
317
319
  }));
318
320
  await generateCoverage(context, results, coverageProvider);
@@ -329,7 +331,7 @@ async function runTests(context) {
329
331
  if (enableCliShortcuts) if (snapshotManager.summary.unmatched) logger_logger.log(` ${picocolors_default().dim('press')} ${picocolors_default().yellow(picocolors_default().bold('u'))} ${picocolors_default().dim('to update snapshot')}${picocolors_default().dim(', press')} ${picocolors_default().bold('h')} ${picocolors_default().dim('to show help')}\n`);
330
332
  else logger_logger.log(` ${picocolors_default().dim('press')} ${picocolors_default().bold('h')} ${picocolors_default().dim('to show help')}${picocolors_default().dim(', press')} ${picocolors_default().bold('q')} ${picocolors_default().dim('to quit')}\n`);
331
333
  };
332
- const { onBeforeRestart } = await import("./0~588.js").then((mod)=>({
334
+ const { onBeforeRestart } = await import("./0~6588.js").then((mod)=>({
333
335
  onBeforeRestart: mod.onBeforeRestart
334
336
  }));
335
337
  onBeforeRestart(async ()=>{
@@ -1,7 +1,7 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
3
  import { __webpack_require__ } from "./rslib-runtime.js";
4
- import "./693.js";
4
+ import "./5693.js";
5
5
  const external_node_fs_ = __webpack_require__("node:fs");
6
6
  const pluginCoverageCore = (coverageOptions)=>({
7
7
  name: 'rstest:coverage-core',
@@ -1,6 +1,5 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
- import node_vm from "node:vm";
4
3
  const shouldInterop = ({ interopDefault = true, modulePath, mod })=>{
5
4
  if (!interopDefault) return false;
6
5
  return !modulePath.endsWith('.mjs') && 'default' in mod;
@@ -43,4 +42,5 @@ const asModule = async (something, defaultExport, context, unlinked)=>{
43
42
  await m.evaluate();
44
43
  return m;
45
44
  };
46
- export { asModule, interopModule, node_vm, shouldInterop };
45
+ export { default as node_vm } from "node:vm";
46
+ export { asModule, interopModule, shouldInterop };
@@ -1,7 +1,7 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
3
  import { __webpack_require__ } from "./rslib-runtime.js";
4
- import "./693.js";
4
+ import "./5693.js";
5
5
  __webpack_require__.add({
6
6
  "../../node_modules/.pnpm/js-tokens@4.0.0/node_modules/js-tokens/index.js" (__unused_rspack_module, exports) {
7
7
  Object.defineProperty(exports, "__esModule", {
@@ -1,7 +1,7 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
- import { isDynamicPattern, glob } from "./157.js";
4
- import { normalize, logger_logger } from "./278.js";
3
+ import { isDynamicPattern, glob } from "./1157.js";
4
+ import { normalize, logger_logger } from "./3278.js";
5
5
  const getIncludedFiles = async (coverage, rootPath)=>{
6
6
  const ignoredPatterns = coverage.exclude?.filter((item)=>isDynamicPattern(item) || item.startsWith(rootPath) || item.startsWith('./'));
7
7
  const allFiles = await glob(coverage.include, {
@@ -42,7 +42,7 @@ async function generateCoverage(context, results, coverageProvider) {
42
42
  }
43
43
  await coverageProvider.generateReports(finalCoverageMap, coverage);
44
44
  if (coverage.thresholds) {
45
- const { checkThresholds } = await import("./0~426.js").then((mod)=>({
45
+ const { checkThresholds } = await import("./0~8426.js").then((mod)=>({
46
46
  checkThresholds: mod.checkThresholds
47
47
  }));
48
48
  const thresholdResult = checkThresholds({
@@ -1,7 +1,7 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
- import { checkPkgInstalled } from "./913.js";
4
- import { installGlobal, addDefaultErrorHandler } from "./0~681.js";
3
+ import { checkPkgInstalled } from "./7913.js";
4
+ import { installGlobal, addDefaultErrorHandler } from "./0~3062.js";
5
5
  const environment = {
6
6
  name: 'happy-dom',
7
7
  async setup (global, { happyDom = {} }) {
@@ -1,12 +1,16 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
3
  import { __webpack_require__ } from "./rslib-runtime.js";
4
- import "./693.js";
5
- import { createRequire as external_node_module_createRequire } from "./881.js";
6
- import { pathToFileURL } from "./198.js";
7
- import { node_vm, asModule, shouldInterop, interopModule } from "./0~346.js";
8
- import { posix, logger_logger } from "./278.js";
4
+ import "./5693.js";
5
+ import { createRequire as external_node_module_createRequire } from "./4881.js";
6
+ import { pathToFileURL } from "./6198.js";
7
+ import { node_vm, asModule, shouldInterop, interopModule } from "./0~3346.js";
8
+ import { posix, logger_logger } from "./3278.js";
9
9
  const external_node_path_ = __webpack_require__("node:path");
10
+ let latestAssetFiles = {};
11
+ const updateLatestAssetFiles = (assetFiles)=>{
12
+ latestAssetFiles = assetFiles;
13
+ };
10
14
  const isRelativePath = (p)=>/^\.\.?\//.test(p);
11
15
  const createRequire = (filename, distPath, rstestContext, assetFiles, interopDefault)=>{
12
16
  const _require = (()=>{
@@ -19,7 +23,7 @@ const createRequire = (filename, distPath, rstestContext, assetFiles, interopDef
19
23
  const require = (id)=>{
20
24
  const currentDirectory = posix.dirname(distPath);
21
25
  const joinedPath = isRelativePath(id) ? posix.join(currentDirectory, id) : id;
22
- const content = assetFiles[joinedPath];
26
+ const content = assetFiles[joinedPath] || latestAssetFiles[joinedPath];
23
27
  if (content) try {
24
28
  return cacheableLoadModule({
25
29
  codeContent: content,
@@ -101,7 +105,7 @@ const loadModule = ({ codeContent, distPath, testPath, rstestContext, assetFiles
101
105
  require: createRequire(testPath, distPath, rstestContext, assetFiles, interopDefault),
102
106
  readWasmFile: (wasmPath, callback)=>{
103
107
  const joinedPath = isRelativePath(wasmPath) ? posix.join(posix.dirname(distPath), wasmPath) : wasmPath;
104
- const content = assetFiles[posix.normalize(joinedPath)];
108
+ const content = assetFiles[posix.normalize(joinedPath)] || latestAssetFiles[posix.normalize(joinedPath)];
105
109
  if (content) callback(null, Buffer.from(content, 'base64'));
106
110
  else callback(new Error(`WASM file ${joinedPath} not found in asset files.`));
107
111
  },
@@ -142,4 +146,4 @@ const cacheableLoadModule = ({ codeContent, distPath, testPath, rstestContext, a
142
146
  moduleCache.set(testPath, mod);
143
147
  return mod;
144
148
  };
145
- export { cacheableLoadModule, loadModule };
149
+ export { cacheableLoadModule, loadModule, updateLatestAssetFiles };