vitest 0.0.71 → 0.0.72

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/cli.js CHANGED
@@ -632,7 +632,7 @@ const cac = (name = "") => new CAC(name);
632
632
 
633
633
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
634
634
 
635
- var version = "0.0.71";
635
+ var version = "0.0.72";
636
636
 
637
637
  const ESC = '\u001B[';
638
638
  const OSC = '\u001B]';
@@ -2423,7 +2423,7 @@ cli.command("dev [...filters]").action(dev);
2423
2423
  cli.command("[...filters]").action(dev);
2424
2424
  cli.parse();
2425
2425
  async function dev(cliFilters, argv) {
2426
- argv.watch = !process.env.CI;
2426
+ argv.watch = !process.env.CI && !process.env.NODE_V8_COVERAGE;
2427
2427
  await run(cliFilters, argv);
2428
2428
  }
2429
2429
  async function run(cliFilters, argv) {
package/dist/worker.js CHANGED
@@ -53,6 +53,18 @@ async function interpretedImport(path, interpretDefault) {
53
53
  }
54
54
  return mod;
55
55
  }
56
+ let SOURCEMAPPING_URL = "sourceMa";
57
+ SOURCEMAPPING_URL += "ppingURL";
58
+ async function withInlineSourcemap(result) {
59
+ const { code, map } = result;
60
+ if (code.includes(`${SOURCEMAPPING_URL}=`))
61
+ return result;
62
+ if (map)
63
+ result.code = `${code}
64
+
65
+ //# ${SOURCEMAPPING_URL}=data:application/json;charset=utf-8;base64,${Buffer.from(JSON.stringify(map), "utf-8").toString("base64")}`;
66
+ return result;
67
+ }
56
68
  async function executeInViteNode(options) {
57
69
  const { moduleCache, root, files, fetch } = options;
58
70
  const externaled = new Set(builtinModules);
@@ -79,6 +91,8 @@ ${[...callstack, dep].reverse().map((p) => `- ${p}`).join("\n")}`);
79
91
  const result2 = await fetch(id);
80
92
  if (!result2)
81
93
  throw new Error(`failed to load ${id}`);
94
+ if (process.env.NODE_V8_COVERAGE)
95
+ withInlineSourcemap(result2);
82
96
  const url = pathToFileURL(fsPath).href;
83
97
  const exports = {};
84
98
  setCache(fsPath, { transformResult: result2, exports });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest",
3
- "version": "0.0.71",
3
+ "version": "0.0.72",
4
4
  "description": "A blazing fast unit test framework powered by Vite",
5
5
  "keywords": [
6
6
  "vite",