vitest 0.34.5 → 0.34.6

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/child.js CHANGED
@@ -2,7 +2,7 @@ import { performance } from 'node:perf_hooks';
2
2
  import v8 from 'node:v8';
3
3
  import { c as createBirpc } from './vendor-index.b271ebe4.js';
4
4
  import { parseRegexp } from '@vitest/utils';
5
- import { l as loadEnvironment } from './vendor-environments.b9b2f624.js';
5
+ import { l as loadEnvironment } from './vendor-environments.7aba93d9.js';
6
6
  import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.07d1a420.js';
7
7
  import { r as rpcDone, c as createSafeRpc } from './vendor-rpc.cbd8e972.js';
8
8
  import { s as setupInspect } from './vendor-inspector.47fc8cbb.js';
@@ -55,9 +55,8 @@ async function init(ctx) {
55
55
  ));
56
56
  const environment = await loadEnvironment(ctx.environment.name, {
57
57
  root: ctx.config.root,
58
- fetchModule(id) {
59
- return rpc.fetch(id, "ssr");
60
- }
58
+ fetchModule: (id) => rpc.fetch(id, "ssr"),
59
+ resolveId: (id, importer) => rpc.resolveId(id, importer, "ssr")
61
60
  });
62
61
  if (ctx.environment.transformMode)
63
62
  environment.transformMode = ctx.environment.transformMode;
@@ -4,7 +4,7 @@ import { g as getDefaultExportFromCjs } from './vendor-_commonjsHelpers.7d1333e8
4
4
  import require$$2 from 'util';
5
5
  import require$$0$1 from 'child_process';
6
6
  import { p as pathKeyExports, s as signalExitExports, m as mergeStream$1, g as getStreamExports, c as crossSpawnExports } from './vendor-index.85fc950a.js';
7
- import { o as onetimeExports } from './vendor-node.81dd929c.js';
7
+ import { o as onetimeExports } from './vendor-node.a7c48fe1.js';
8
8
  import require$$0 from 'os';
9
9
  import 'node:buffer';
10
10
  import 'node:path';
@@ -51,7 +51,7 @@ import 'acorn';
51
51
  import 'acorn-walk';
52
52
  import 'magic-string';
53
53
  import 'strip-literal';
54
- import './vendor-environments.b9b2f624.js';
54
+ import './vendor-environments.7aba93d9.js';
55
55
  import './vendor-index.0b5b3600.js';
56
56
  import 'node:assert';
57
57
  import 'node:console';
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { normalize } from 'pathe';
2
2
  import cac from 'cac';
3
3
  import c from 'picocolors';
4
- import { v as version, s as startVitest } from './vendor-node.81dd929c.js';
4
+ import { v as version, s as startVitest } from './vendor-node.a7c48fe1.js';
5
5
  import './vendor-index.29282562.js';
6
6
  import { d as divider } from './vendor-reporters.f6975b8d.js';
7
7
  import { t as toArray } from './vendor-base.9c08bbd0.js';
@@ -48,7 +48,7 @@ import 'acorn-walk';
48
48
  import '@vitest/runner/utils';
49
49
  import 'magic-string';
50
50
  import 'strip-literal';
51
- import './vendor-environments.b9b2f624.js';
51
+ import './vendor-environments.7aba93d9.js';
52
52
  import './vendor-index.0b5b3600.js';
53
53
  import 'node:module';
54
54
  import 'node:assert';
@@ -1,4 +1,4 @@
1
- export { e as builtinEnvironments, p as populateGlobal } from './vendor-environments.b9b2f624.js';
1
+ export { e as builtinEnvironments, p as populateGlobal } from './vendor-environments.7aba93d9.js';
2
2
  import 'pathe';
3
3
  import './vendor-index.0b5b3600.js';
4
4
  import 'acorn';
package/dist/node.js CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BaseSequencer, V as VitestPlugin, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor-node.81dd929c.js';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor-node.a7c48fe1.js';
2
2
  import 'pathe';
3
3
  import 'vite';
4
4
  import 'node:path';
@@ -51,7 +51,7 @@ import 'acorn';
51
51
  import 'acorn-walk';
52
52
  import 'magic-string';
53
53
  import 'strip-literal';
54
- import './vendor-environments.b9b2f624.js';
54
+ import './vendor-environments.7aba93d9.js';
55
55
  import './vendor-index.0b5b3600.js';
56
56
  import 'node:assert';
57
57
  import 'node:console';
@@ -350,8 +350,7 @@ const skipKeys = [
350
350
  "window",
351
351
  "self",
352
352
  "top",
353
- "parent",
354
- "URL"
353
+ "parent"
355
354
  ];
356
355
  function getWindowKeys(global, win) {
357
356
  const keys = new Set(KEYS.concat(Object.getOwnPropertyNames(win)).filter((k) => {
@@ -42,7 +42,7 @@ import { ancestor, simple, findNodeAround } from 'acorn-walk';
42
42
  import { generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, getTasks, hasFailed } from '@vitest/runner/utils';
43
43
  import MagicString from 'magic-string';
44
44
  import { stripLiteral } from 'strip-literal';
45
- import { g as getEnvPackageName } from './vendor-environments.b9b2f624.js';
45
+ import { g as getEnvPackageName } from './vendor-environments.7aba93d9.js';
46
46
  import readline from 'node:readline';
47
47
  import require$$0$2 from 'readline';
48
48
 
@@ -61,7 +61,7 @@ function _mergeNamespaces(n, m) {
61
61
  return Object.freeze(n);
62
62
  }
63
63
 
64
- var version$1 = "0.34.5";
64
+ var version$1 = "0.34.6";
65
65
 
66
66
  const __dirname$1 = url.fileURLToPath(new URL(".", import.meta.url));
67
67
  async function ensurePackageInstalled(dependency, root) {
@@ -80,7 +80,7 @@ async function ensurePackageInstalled(dependency, root) {
80
80
  message: c.reset(`Do you want to install ${c.green(dependency)}?`)
81
81
  });
82
82
  if (install) {
83
- await (await import('./chunk-install-pkg.e623b1bf.js')).installPackage(dependency, { dev: true });
83
+ await (await import('./chunk-install-pkg.6c4f388a.js')).installPackage(dependency, { dev: true });
84
84
  process.stderr.write(c.yellow(`
85
85
  Package ${dependency} installed, re-run the command to start.
86
86
  `));
@@ -9021,7 +9021,7 @@ createLogUpdate(process$1.stdout);
9021
9021
 
9022
9022
  createLogUpdate(process$1.stderr);
9023
9023
 
9024
- var version = "0.34.5";
9024
+ var version = "0.34.6";
9025
9025
 
9026
9026
  const A=r=>r!==null&&typeof r=="object",a=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),_$1="ERR_INVALID_PACKAGE_CONFIG",E="ERR_INVALID_PACKAGE_TARGET",I="ERR_PACKAGE_PATH_NOT_EXPORTED",R$1=/^\d+$/,O=/^(\.{1,2}|node_modules)$/i,w=/\/|\\/;var h=(r=>(r.Export="exports",r.Import="imports",r))(h||{});const f=(r,t,e,o,c)=>{if(t==null)return [];if(typeof t=="string"){const[n,...i]=t.split(w);if(n===".."||i.some(l=>O.test(l)))throw a(E,`Invalid "${r}" target "${t}" defined in the package config`);return [c?t.replace(/\*/g,c):t]}if(Array.isArray(t))return t.flatMap(n=>f(r,n,e,o,c));if(A(t)){for(const n of Object.keys(t)){if(R$1.test(n))throw a(_$1,"Cannot contain numeric property keys");if(n==="default"||o.includes(n))return f(r,t[n],e,o,c)}return []}throw a(E,`Invalid "${r}" target "${t}"`)},s="*",m=(r,t)=>{const e=r.indexOf(s),o=t.indexOf(s);return e===o?t.length>r.length:o>e};function d$1(r,t){if(!t.includes(s)&&r.hasOwnProperty(t))return [t];let e,o;for(const c of Object.keys(r))if(c.includes(s)){const[n,i,l]=c.split(s);if(l===void 0&&t.startsWith(n)&&t.endsWith(i)){const g=t.slice(n.length,-i.length||void 0);g&&(!e||m(e,c))&&(e=c,o=g);}}return [e,o]}const p=r=>Object.keys(r).reduce((t,e)=>{const o=e===""||e[0]!==".";if(t===void 0||t===o)return o;throw a(_$1,'"exports" cannot contain some keys starting with "." and some not')},void 0),u=/^\w+:/,v=(r,t,e)=>{if(!r)throw new Error('"exports" is required');t=t===""?".":`./${t}`,(typeof r=="string"||Array.isArray(r)||A(r)&&p(r))&&(r={".":r});const[o,c]=d$1(r,t),n=f(h.Export,r[o],t,e,c);if(n.length===0)throw a(I,t==="."?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const i of n)if(!i.startsWith("./")&&!u.test(i))throw a(E,`Invalid "exports" target "${i}" defined in the package config`);return n};
9027
9027
 
package/dist/vm.js CHANGED
@@ -7,7 +7,7 @@ import { c as createBirpc } from './vendor-index.b271ebe4.js';
7
7
  import { resolve } from 'pathe';
8
8
  import { installSourcemapsSupport } from 'vite-node/source-map';
9
9
  import { d as distDir } from './vendor-paths.84fc7a99.js';
10
- import { l as loadEnvironment } from './vendor-environments.b9b2f624.js';
10
+ import { l as loadEnvironment } from './vendor-environments.7aba93d9.js';
11
11
  import { b as startVitestExecutor } from './vendor-execute.07d1a420.js';
12
12
  import { createCustomConsole } from './chunk-runtime-console.ea222ffb.js';
13
13
  import { c as createSafeRpc } from './vendor-rpc.cbd8e972.js';
@@ -58,9 +58,8 @@ async function run(ctx) {
58
58
  ));
59
59
  const environment = await loadEnvironment(ctx.environment.name, {
60
60
  root: ctx.config.root,
61
- fetchModule(id) {
62
- return rpc.fetch(id, "ssr");
63
- }
61
+ fetchModule: (id) => rpc.fetch(id, "ssr"),
62
+ resolveId: (id, importer) => rpc.resolveId(id, importer, "ssr")
64
63
  });
65
64
  if (!environment.setupVM) {
66
65
  const envName = ctx.environment.name;
package/dist/worker.js CHANGED
@@ -2,7 +2,7 @@ import { performance } from 'node:perf_hooks';
2
2
  import { c as createBirpc } from './vendor-index.b271ebe4.js';
3
3
  import { workerId } from 'tinypool';
4
4
  import { g as getWorkerState } from './vendor-global.97e4527c.js';
5
- import { l as loadEnvironment } from './vendor-environments.b9b2f624.js';
5
+ import { l as loadEnvironment } from './vendor-environments.7aba93d9.js';
6
6
  import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.07d1a420.js';
7
7
  import { s as setupInspect } from './vendor-inspector.47fc8cbb.js';
8
8
  import { r as rpcDone, c as createSafeRpc } from './vendor-rpc.cbd8e972.js';
@@ -55,9 +55,8 @@ async function init(ctx) {
55
55
  ));
56
56
  const environment = await loadEnvironment(ctx.environment.name, {
57
57
  root: ctx.config.root,
58
- fetchModule(id) {
59
- return rpc.fetch(id, "ssr");
60
- }
58
+ fetchModule: (id) => rpc.fetch(id, "ssr"),
59
+ resolveId: (id, importer) => rpc.resolveId(id, importer, "ssr")
61
60
  });
62
61
  if (ctx.environment.transformMode)
63
62
  environment.transformMode = ctx.environment.transformMode;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.34.5",
4
+ "version": "0.34.6",
5
5
  "description": "A blazing fast unit test framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -143,7 +143,7 @@
143
143
  "acorn": "^8.9.0",
144
144
  "acorn-walk": "^8.2.0",
145
145
  "cac": "^6.7.14",
146
- "chai": "^4.3.7",
146
+ "chai": "^4.3.10",
147
147
  "debug": "^4.3.4",
148
148
  "local-pkg": "^0.4.3",
149
149
  "magic-string": "^0.30.1",
@@ -155,12 +155,12 @@
155
155
  "tinypool": "^0.7.0",
156
156
  "vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0",
157
157
  "why-is-node-running": "^2.2.2",
158
- "@vitest/runner": "0.34.5",
159
- "@vitest/snapshot": "0.34.5",
160
- "vite-node": "0.34.5",
161
- "@vitest/spy": "0.34.5",
162
- "@vitest/utils": "0.34.5",
163
- "@vitest/expect": "0.34.5"
158
+ "@vitest/runner": "0.34.6",
159
+ "@vitest/utils": "0.34.6",
160
+ "vite-node": "0.34.6",
161
+ "@vitest/expect": "0.34.6",
162
+ "@vitest/snapshot": "0.34.6",
163
+ "@vitest/spy": "0.34.6"
164
164
  },
165
165
  "devDependencies": {
166
166
  "@ampproject/remapping": "^2.2.1",