vitest 0.13.0 → 0.13.1

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.
@@ -1,5 +1,5 @@
1
1
  import { promises } from 'fs';
2
- import { c as createBirpc } from './chunk-vite-node-utils.6856b365.js';
2
+ import { c as createBirpc } from './chunk-vite-node-utils.52235551.js';
3
3
  import require$$0$1 from 'stream';
4
4
  import require$$0 from 'zlib';
5
5
  import require$$3 from 'net';
@@ -9,11 +9,11 @@ import require$$2 from 'events';
9
9
  import require$$1 from 'https';
10
10
  import require$$2$1 from 'http';
11
11
  import url from 'url';
12
- import { A as API_PATH } from './chunk-constants.d60bb984.js';
13
- import { j as interpretSourcePos, b as parseStacktrace } from './chunk-utils-source-map.ded50c88.js';
12
+ import { A as API_PATH } from './chunk-constants.b0ea3b74.js';
13
+ import { j as interpretSourcePos, b as parseStacktrace } from './chunk-utils-source-map.19e9554e.js';
14
14
  import 'module';
15
15
  import 'vm';
16
- import './chunk-utils-global.b9f8edf8.js';
16
+ import './chunk-utils-global.550519fc.js';
17
17
  import 'tty';
18
18
  import 'local-pkg';
19
19
  import 'path';
@@ -1,5 +1,5 @@
1
1
  import { fileURLToPath } from 'url';
2
- import { l as resolve } from './chunk-utils-global.b9f8edf8.js';
2
+ import { l as resolve } from './chunk-utils-global.550519fc.js';
3
3
 
4
4
  const distDir = resolve(fileURLToPath(import.meta.url), "../../dist");
5
5
  const defaultPort = 51204;
@@ -1,7 +1,7 @@
1
1
  import { existsSync, promises } from 'fs';
2
2
  import { createRequire } from 'module';
3
3
  import { pathToFileURL } from 'url';
4
- import { t as toArray, l as resolve } from './chunk-utils-global.b9f8edf8.js';
4
+ import { t as toArray, l as resolve } from './chunk-utils-global.550519fc.js';
5
5
 
6
6
  const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
7
7
  const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**"];
@@ -2,7 +2,7 @@ import path$2 from 'path';
2
2
  import fs$2 from 'fs';
3
3
  import require$$0 from 'util';
4
4
  import childProcess$1 from 'child_process';
5
- import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1, o as onetime$1 } from './vendor-index.42fcc02c.js';
5
+ import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1, o as onetime$1 } from './vendor-index.22581bd4.js';
6
6
  import require$$0$1 from 'os';
7
7
  import './vendor-_commonjsHelpers.addc3445.js';
8
8
  import 'assert';
@@ -1,20 +1,20 @@
1
- import { g as globalApis } from './chunk-constants.d60bb984.js';
2
- import { i as index } from './vendor-entry.6072d652.js';
1
+ import { g as globalApis } from './chunk-constants.b0ea3b74.js';
2
+ import { i as index } from './vendor-entry.225630f2.js';
3
3
  import 'url';
4
- import './chunk-utils-global.b9f8edf8.js';
4
+ import './chunk-utils-global.550519fc.js';
5
5
  import 'tty';
6
6
  import 'local-pkg';
7
7
  import 'path';
8
8
  import 'fs';
9
- import './chunk-runtime-chain.db87de48.js';
9
+ import './chunk-runtime-chain.46442ffe.js';
10
10
  import 'chai';
11
11
  import './vendor-_commonjsHelpers.addc3445.js';
12
- import './chunk-runtime-rpc.6e6614a9.js';
13
- import './chunk-utils-source-map.ded50c88.js';
12
+ import './chunk-runtime-rpc.50765c8b.js';
13
+ import './chunk-utils-source-map.19e9554e.js';
14
14
  import './chunk-integrations-spy.bee66426.js';
15
15
  import 'tinyspy';
16
16
  import 'util';
17
- import './chunk-defaults.c11f632f.js';
17
+ import './chunk-defaults.e5ec89dd.js';
18
18
  import 'module';
19
19
 
20
20
  function registerApiGlobally() {
@@ -1,9 +1,9 @@
1
1
  import chai$1, { expect as expect$1, AssertionError, util } from 'chai';
2
2
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
3
- import { r as rpc } from './chunk-runtime-rpc.6e6614a9.js';
4
- import { i as isObject, j as join, d as dirname, g as getCallLastIndex, s as slash, a as getWorkerState, b as getNames, c as assertTypes, p as picocolors, e as safeSetTimeout, f as safeClearTimeout, n as noop, t as toArray, r as resetModules } from './chunk-utils-global.b9f8edf8.js';
3
+ import { r as rpc } from './chunk-runtime-rpc.50765c8b.js';
4
+ import { i as isObject, j as join, d as dirname, g as getCallLastIndex, s as slash, a as getWorkerState, b as getNames, c as assertTypes, p as picocolors, e as safeSetTimeout, f as safeClearTimeout, n as noop, t as toArray, r as resetModules } from './chunk-utils-global.550519fc.js';
5
5
  import fs, { promises } from 'fs';
6
- import { p as plugins_1, f as format_1, g as getOriginalPos, a as posToNumber, n as numberToPos, l as lineSplitRE, b as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils } from './chunk-utils-source-map.ded50c88.js';
6
+ import { p as plugins_1, f as format_1, g as getOriginalPos, a as posToNumber, n as numberToPos, l as lineSplitRE, b as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils } from './chunk-utils-source-map.19e9554e.js';
7
7
  import { i as isMockFunction, s as spyOn, f as fn, a as spies } from './chunk-integrations-spy.bee66426.js';
8
8
  import require$$0, { format } from 'util';
9
9
 
@@ -621,14 +621,14 @@ function prepareSnapString(snap, source, index) {
621
621
  const line = source.split(lineSplitRE)[lineIndex - 1];
622
622
  const indent = line.match(/^\s*/)[0] || "";
623
623
  const indentNext = indent.includes(" ") ? `${indent} ` : `${indent} `;
624
- const lines = snap.trim().replace(/\\/g, "\\\\").replace(/\$/g, "\\$").split(/\n/g);
624
+ const lines = snap.trim().replace(/\\/g, "\\\\").split(/\n/g);
625
625
  const isOneline = lines.length <= 1;
626
626
  const quote = isOneline ? "'" : "`";
627
627
  if (isOneline)
628
628
  return `'${lines.join("\n").replace(/'/g, "\\'")}'`;
629
629
  else
630
630
  return `${quote}
631
- ${lines.map((i) => i ? indentNext + i : "").join("\n").replace(/`/g, "\\`")}
631
+ ${lines.map((i) => i ? indentNext + i : "").join("\n").replace(/`/g, "\\`").replace(/\${/g, "\\${")}
632
632
  ${indent}${quote}`;
633
633
  }
634
634
  const startRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*[\w_$]*(['"`\)])/m;
@@ -1,8 +1,8 @@
1
- import { n as normalizeRequestId, i as isNodeBuiltin, t as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.6856b365.js';
1
+ import { n as normalizeRequestId, i as isNodeBuiltin, t as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.52235551.js';
2
2
  import { normalizePath } from 'vite';
3
- import { a as getWorkerState, J as isWindows, K as mergeSlashes, d as dirname, l as resolve, k as basename, L as getType, M as getAllProperties, s as slash } from './chunk-utils-global.b9f8edf8.js';
3
+ import { a as getWorkerState, J as isWindows, K as mergeSlashes, d as dirname, l as resolve, k as basename, L as getType, M as getAllProperties, s as slash } from './chunk-utils-global.550519fc.js';
4
4
  import { existsSync, readdirSync } from 'fs';
5
- import { d as distDir } from './chunk-constants.d60bb984.js';
5
+ import { d as distDir } from './chunk-constants.b0ea3b74.js';
6
6
 
7
7
  var __defProp = Object.defineProperty;
8
8
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -1,4 +1,4 @@
1
- import { a as getWorkerState, w as withSafeTimers } from './chunk-utils-global.b9f8edf8.js';
1
+ import { a as getWorkerState, w as withSafeTimers } from './chunk-utils-global.550519fc.js';
2
2
 
3
3
  const rpc = () => {
4
4
  const { rpc: rpc2 } = getWorkerState();
@@ -459,7 +459,7 @@ async function ensurePackageInstalled(dependency, promptInstall = !process.env.C
459
459
  message: picocolors.exports.reset(`Do you want to install ${picocolors.exports.green(dependency)}?`)
460
460
  });
461
461
  if (install) {
462
- await (await import('./chunk-install-pkg.8a034cf6.js')).installPackage(dependency, { dev: true });
462
+ await (await import('./chunk-install-pkg.e11db438.js')).installPackage(dependency, { dev: true });
463
463
  process.stderr.write(picocolors.exports.yellow(`
464
464
  Package ${dependency} installed, re-run the command to start.
465
465
  `));
@@ -1,4 +1,4 @@
1
- import { s as slash, h as notNullish, p as picocolors } from './chunk-utils-global.b9f8edf8.js';
1
+ import { s as slash, h as notNullish, p as picocolors } from './chunk-utils-global.550519fc.js';
2
2
 
3
3
  var build = {};
4
4
 
@@ -1,31 +1,31 @@
1
- import { j as join, k as basename, d as dirname, l as resolve, A as AggregateErrorPonyfill, p as picocolors, s as slash$2, m as isAbsolute, o as relative, q as isNode, u as getTests, v as getFullName, x as hasFailed, y as hasFailedSnapshot, z as getSuites, B as safeSetInterval, C as safeClearInterval, e as safeSetTimeout, t as toArray, D as normalize, n as noop$1, f as safeClearTimeout, E as deepMerge, F as toNamespacedPath, g as getCallLastIndex, h as notNullish, G as ensurePackageInstalled, H as stdout } from './chunk-utils-global.b9f8edf8.js';
1
+ import { j as join, k as basename, d as dirname, l as resolve, A as AggregateErrorPonyfill, p as picocolors, s as slash$2, m as isAbsolute, o as relative, q as isNode, u as getTests, v as getFullName, x as hasFailed, y as hasFailedSnapshot, z as getSuites, B as safeSetInterval, C as safeClearInterval, e as safeSetTimeout, t as toArray, D as normalize, n as noop$1, f as safeClearTimeout, E as deepMerge, F as toNamespacedPath, g as getCallLastIndex, h as notNullish, G as ensurePackageInstalled, H as stdout } from './chunk-utils-global.550519fc.js';
2
2
  import { createServer, mergeConfig } from 'vite';
3
3
  import path$a from 'path';
4
4
  import url, { fileURLToPath, pathToFileURL } from 'url';
5
5
  import process$1 from 'process';
6
6
  import fs$8, { promises, existsSync, readFileSync } from 'fs';
7
- import { d as distDir, a as defaultPort, c as configFiles } from './chunk-constants.d60bb984.js';
7
+ import { d as distDir, a as defaultPort, c as configFiles } from './chunk-constants.b0ea3b74.js';
8
8
  import readline from 'readline';
9
9
  import require$$0, { cpus, hostname, constants as constants$5 } from 'os';
10
10
  import require$$0$1 from 'util';
11
11
  import require$$0$2 from 'stream';
12
12
  import require$$2 from 'events';
13
13
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
14
- import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toFilePath, w as withInlineSourcemap, c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-utils.6856b365.js';
14
+ import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toFilePath, w as withInlineSourcemap, c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-utils.52235551.js';
15
15
  import createDebug from 'debug';
16
- import { c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage } from './chunk-defaults.c11f632f.js';
16
+ import { c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage } from './chunk-defaults.e5ec89dd.js';
17
17
  import { MessageChannel } from 'worker_threads';
18
18
  import { Tinypool } from 'tinypool';
19
19
  import { performance } from 'perf_hooks';
20
- import { c as stripAnsi, d as stringWidth, e as ansiStyles, h as sliceAnsi, i as cliTruncate, b as parseStacktrace, j as interpretSourcePos, s as stringify$5, u as unifiedDiff, a as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.ded50c88.js';
21
- import { o as onetime$1, s as signalExit, m as mergeStream, g as getStream, c as crossSpawn } from './vendor-index.42fcc02c.js';
20
+ import { c as stripAnsi, d as stringWidth, e as ansiStyles, h as sliceAnsi, i as cliTruncate, b as parseStacktrace, j as interpretSourcePos, s as stringify$5, u as unifiedDiff, a as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.19e9554e.js';
21
+ import { o as onetime$1, s as signalExit, m as mergeStream, g as getStream, c as crossSpawn } from './vendor-index.22581bd4.js';
22
22
  import { resolveModule } from 'local-pkg';
23
23
  import { Buffer } from 'buffer';
24
24
  import childProcess from 'child_process';
25
25
  import MagicString from './chunk-magic-string.41232190.js';
26
26
  import { p as prompts } from './vendor-index.405e58ef.js';
27
27
 
28
- var version = "0.13.0";
28
+ var version = "0.13.1";
29
29
 
30
30
  /*
31
31
  How it works:
@@ -188,7 +188,7 @@ async function pLocate(
188
188
  {
189
189
  concurrency = Number.POSITIVE_INFINITY,
190
190
  preserveOrder = true,
191
- } = {},
191
+ },
192
192
  ) {
193
193
  const limit = pLimit(concurrency);
194
194
 
@@ -255,7 +255,7 @@ const toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath)
255
255
 
256
256
  const findUpStop = Symbol('findUpStop');
257
257
 
258
- async function findUpMultiple(name, options = {}) {
258
+ async function findUpMultiple(name, options) {
259
259
  let directory = path$a.resolve(toPath(options.cwd) || '');
260
260
  const {root} = path$a.parse(directory);
261
261
  const stopAt = path$a.resolve(directory, options.stopAt || root);
@@ -299,7 +299,7 @@ async function findUpMultiple(name, options = {}) {
299
299
  return matches;
300
300
  }
301
301
 
302
- async function findUp(name, options = {}) {
302
+ async function findUp(name, options) {
303
303
  const matches = await findUpMultiple(name, {...options, limit: 1});
304
304
  return matches[0];
305
305
  }
@@ -1189,7 +1189,7 @@ const invalidStep = (step, options) => {
1189
1189
  return [];
1190
1190
  };
1191
1191
 
1192
- const fillNumbers = (start, end, step = 1, options = {}) => {
1192
+ const fillNumbers = (start, end, step = 1, options) => {
1193
1193
  let a = Number(start);
1194
1194
  let b = Number(end);
1195
1195
 
@@ -1241,7 +1241,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
1241
1241
  return range;
1242
1242
  };
1243
1243
 
1244
- const fillLetters = (start, end, step = 1, options = {}) => {
1244
+ const fillLetters = (start, end, step = 1, options) => {
1245
1245
  if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) {
1246
1246
  return invalidRange(start, end, options);
1247
1247
  }
@@ -7153,7 +7153,7 @@ function createPool(ctx) {
7153
7153
  options.maxThreads = 1;
7154
7154
  options.minThreads = 1;
7155
7155
  }
7156
- if (ctx.config.coverage)
7156
+ if (ctx.config.coverage.enabled)
7157
7157
  (_a = process.env).NODE_V8_COVERAGE || (_a.NODE_V8_COVERAGE = ctx.config.coverage.tempDirectory);
7158
7158
  options.env = __spreadValues$5(__spreadValues$5({
7159
7159
  TEST: "true",
@@ -9001,7 +9001,7 @@ function fileFromParsedStack(stack) {
9001
9001
  return join(stack.file, "../", stack.sourcePos.source);
9002
9002
  return stack.file;
9003
9003
  }
9004
- async function printError(error, ctx, options = {}) {
9004
+ async function printError(error, ctx, options) {
9005
9005
  const { showCodeFrame = true, fullStack = false, type } = options;
9006
9006
  let e = error;
9007
9007
  if (typeof error === "string") {
@@ -9116,7 +9116,7 @@ function printStack(ctx, stack, highlight, errorProperties, onStack) {
9116
9116
  ctx.log(picocolors.exports.red(picocolors.exports.bold("Serialized Error:")), picocolors.exports.gray(propertiesString));
9117
9117
  }
9118
9118
  }
9119
- function generateCodeFrame(source, indent = 0, start = 0, end, range = 2) {
9119
+ function generateCodeFrame(source, indent, start = 0, end, range = 2) {
9120
9120
  var _a;
9121
9121
  start = posToNumber(source, start);
9122
9122
  end = end || start;
@@ -9209,7 +9209,7 @@ function npmRunPath(options = {}) {
9209
9209
  return [...result, path_].join(path$a.delimiter);
9210
9210
  }
9211
9211
 
9212
- function npmRunPathEnv({env = process$1.env, ...options} = {}) {
9212
+ function npmRunPathEnv({env = process$1.env, ...options}) {
9213
9213
  env = {...env};
9214
9214
 
9215
9215
  const path = pathKey({env});
@@ -10940,6 +10940,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest()) {
10940
10940
  },
10941
10941
  server: __spreadProps(__spreadValues({}, preOptions.api), {
10942
10942
  open,
10943
+ hmr: false,
10943
10944
  preTransformRequests: false
10944
10945
  }),
10945
10946
  cacheDir: void 0,
@@ -10970,7 +10971,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest()) {
10970
10971
  await ctx.setServer(options, server);
10971
10972
  haveStarted = true;
10972
10973
  if (options.api && options.watch)
10973
- (await import('./chunk-api-setup.554e8dcb.js')).setup(ctx);
10974
+ (await import('./chunk-api-setup.8d604f90.js')).setup(ctx);
10974
10975
  if (!options.watch)
10975
10976
  await server.watcher.close();
10976
10977
  }
@@ -1,7 +1,7 @@
1
1
  import { builtinModules, createRequire } from 'module';
2
2
  import { pathToFileURL, fileURLToPath as fileURLToPath$2, URL as URL$1 } from 'url';
3
3
  import vm from 'vm';
4
- import { m as isAbsolute$2, l as resolve, j as join$2, I as extname$2, d as dirname$2 } from './chunk-utils-global.b9f8edf8.js';
4
+ import { m as isAbsolute$2, l as resolve, j as join$2, I as extname$2, d as dirname$2 } from './chunk-utils-global.550519fc.js';
5
5
  import path from 'path';
6
6
  import fs, { realpathSync, statSync, Stats, promises, existsSync } from 'fs';
7
7
  import assert from 'assert';
@@ -2776,7 +2776,7 @@ const compare$b = compare_1$1;
2776
2776
  // - If no C has a prerelease and the LT.semver tuple, return false
2777
2777
  // - Else return true
2778
2778
 
2779
- const subset$1 = (sub, dom, options = {}) => {
2779
+ const subset$1 = (sub, dom, options) => {
2780
2780
  if (sub === dom)
2781
2781
  return true
2782
2782
 
@@ -7290,7 +7290,7 @@ const compare = compare_1;
7290
7290
  // - If no C has a prerelease and the LT.semver tuple, return false
7291
7291
  // - Else return true
7292
7292
 
7293
- const subset = (sub, dom, options = {}) => {
7293
+ const subset = (sub, dom, options) => {
7294
7294
  if (sub === dom)
7295
7295
  return true
7296
7296
 
@@ -7948,7 +7948,7 @@ const defaultFindOptions = {
7948
7948
  return null;
7949
7949
  }
7950
7950
  };
7951
- async function findNearestFile(filename, _options = {}) {
7951
+ async function findNearestFile(filename, _options) {
7952
7952
  const options = { ...defaultFindOptions, ..._options };
7953
7953
  const basePath = resolve(options.startingFrom);
7954
7954
  const leadingSlash = basePath[0] === "/";
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'events';
2
- import { p as picocolors } from './chunk-utils-global.b9f8edf8.js';
3
- import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.0094db73.js';
2
+ import { p as picocolors } from './chunk-utils-global.550519fc.js';
3
+ import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.61cc47ef.js';
4
4
  import 'tty';
5
5
  import 'local-pkg';
6
6
  import 'path';
@@ -8,23 +8,23 @@ import 'vite';
8
8
  import 'url';
9
9
  import 'process';
10
10
  import 'fs';
11
- import './chunk-constants.d60bb984.js';
11
+ import './chunk-constants.b0ea3b74.js';
12
12
  import 'readline';
13
13
  import 'os';
14
14
  import 'util';
15
15
  import 'stream';
16
16
  import './vendor-_commonjsHelpers.addc3445.js';
17
- import './chunk-vite-node-utils.6856b365.js';
17
+ import './chunk-vite-node-utils.52235551.js';
18
18
  import 'module';
19
19
  import 'vm';
20
20
  import 'assert';
21
21
  import 'debug';
22
- import './chunk-defaults.c11f632f.js';
22
+ import './chunk-defaults.e5ec89dd.js';
23
23
  import 'worker_threads';
24
24
  import 'tinypool';
25
25
  import 'perf_hooks';
26
- import './chunk-utils-source-map.ded50c88.js';
27
- import './vendor-index.42fcc02c.js';
26
+ import './chunk-utils-source-map.19e9554e.js';
27
+ import './vendor-index.22581bd4.js';
28
28
  import 'child_process';
29
29
  import 'buffer';
30
30
  import './chunk-magic-string.41232190.js';
@@ -641,7 +641,7 @@ class CAC extends EventEmitter {
641
641
  }
642
642
  }
643
643
 
644
- const cac = (name = "") => new CAC(name);
644
+ const cac = (name) => new CAC(name);
645
645
 
646
646
  const cli = cac("vitest");
647
647
  cli.version(version).option("-r, --root <path>", "root path").option("-c, --config <path>", "path to config file").option("-u, --update", "update snapshot").option("-w, --watch", "watch mode").option("-t, --testNamePattern <pattern>", "run tests with full names matching the specified pattern").option("--dir <path>", "base directory to scan for the test files").option("--ui", "enable UI").option("--open", "open UI automatically (default: !process.env.CI))").option("--api [api]", "serve API, available options: --api.port <port>, --api.host [host] and --api.strictPort").option("--threads", "enabled threads (default: true)").option("--silent", "silent console output from tests").option("--isolate", "isolate environment for each test file (default: true)").option("--reporter <name>", "reporter").option("--outputTruncateLength <length>", "diff output length").option("--outputFile <filename/-s>", "write test results to a file when the --reporter=json or --reporter=junit option is also specified, use cac's dot notation for individual outputs of mutliple reporters").option("--coverage", "use c8 for coverage").option("--run", "do not watch").option("--mode <name>", "override Vite mode (default: test)").option("--globals", "inject apis globally").option("--dom", "mock browser api with happy-dom").option("--environment <env>", "runner environment (default: node)").option("--passWithNoTests", "pass when no tests found").option("--allowOnly", "Allow tests and suites that are marked as only (default: !process.env.CI)").option("--changed [since]", "Run tests that are affected by the changed files (default: false)").help();
package/dist/entry.js CHANGED
@@ -1,17 +1,17 @@
1
- export { r as run } from './vendor-entry.6072d652.js';
1
+ export { r as run } from './vendor-entry.225630f2.js';
2
2
  import 'fs';
3
- import './chunk-utils-global.b9f8edf8.js';
3
+ import './chunk-utils-global.550519fc.js';
4
4
  import 'tty';
5
5
  import 'local-pkg';
6
6
  import 'path';
7
- import './chunk-runtime-chain.db87de48.js';
7
+ import './chunk-runtime-chain.46442ffe.js';
8
8
  import 'chai';
9
9
  import './vendor-_commonjsHelpers.addc3445.js';
10
- import './chunk-runtime-rpc.6e6614a9.js';
11
- import './chunk-utils-source-map.ded50c88.js';
10
+ import './chunk-runtime-rpc.50765c8b.js';
11
+ import './chunk-utils-source-map.19e9554e.js';
12
12
  import './chunk-integrations-spy.bee66426.js';
13
13
  import 'tinyspy';
14
14
  import 'util';
15
- import './chunk-defaults.c11f632f.js';
15
+ import './chunk-defaults.e5ec89dd.js';
16
16
  import 'module';
17
17
  import 'url';
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- export { c as afterAll, f as afterEach, b as beforeAll, e as beforeEach, g as createExpect, d as describe, h as expect, k as getRunningMode, a as isFirstRun, l as isWatchMode, i as it, r as runOnce, s as suite, t as test, j as vi, v as vitest, w as withCallback } from './chunk-runtime-chain.db87de48.js';
1
+ export { c as afterAll, f as afterEach, b as beforeAll, e as beforeEach, g as createExpect, d as describe, h as expect, k as getRunningMode, a as isFirstRun, l as isWatchMode, i as it, r as runOnce, s as suite, t as test, j as vi, v as vitest, w as withCallback } from './chunk-runtime-chain.46442ffe.js';
2
2
  export { assert, default as chai, should } from 'chai';
3
3
  import './vendor-_commonjsHelpers.addc3445.js';
4
- import './chunk-runtime-rpc.6e6614a9.js';
5
- import './chunk-utils-global.b9f8edf8.js';
4
+ import './chunk-runtime-rpc.50765c8b.js';
5
+ import './chunk-utils-global.550519fc.js';
6
6
  import 'tty';
7
7
  import 'local-pkg';
8
8
  import 'path';
9
9
  import 'fs';
10
- import './chunk-utils-source-map.ded50c88.js';
10
+ import './chunk-utils-source-map.19e9554e.js';
11
11
  import './chunk-integrations-spy.bee66426.js';
12
12
  import 'tinyspy';
13
13
  import 'util';
package/dist/node.js CHANGED
@@ -1,6 +1,6 @@
1
- export { V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.0094db73.js';
2
- export { V as VitestRunner } from './chunk-runtime-mocker.8436db18.js';
3
- import './chunk-utils-global.b9f8edf8.js';
1
+ export { V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.61cc47ef.js';
2
+ export { V as VitestRunner } from './chunk-runtime-mocker.e9fdf718.js';
3
+ import './chunk-utils-global.550519fc.js';
4
4
  import 'tty';
5
5
  import 'local-pkg';
6
6
  import 'path';
@@ -8,24 +8,24 @@ import 'vite';
8
8
  import 'url';
9
9
  import 'process';
10
10
  import 'fs';
11
- import './chunk-constants.d60bb984.js';
11
+ import './chunk-constants.b0ea3b74.js';
12
12
  import 'readline';
13
13
  import 'os';
14
14
  import 'util';
15
15
  import 'stream';
16
16
  import 'events';
17
17
  import './vendor-_commonjsHelpers.addc3445.js';
18
- import './chunk-vite-node-utils.6856b365.js';
18
+ import './chunk-vite-node-utils.52235551.js';
19
19
  import 'module';
20
20
  import 'vm';
21
21
  import 'assert';
22
22
  import 'debug';
23
- import './chunk-defaults.c11f632f.js';
23
+ import './chunk-defaults.e5ec89dd.js';
24
24
  import 'worker_threads';
25
25
  import 'tinypool';
26
26
  import 'perf_hooks';
27
- import './chunk-utils-source-map.ded50c88.js';
28
- import './vendor-index.42fcc02c.js';
27
+ import './chunk-utils-source-map.19e9554e.js';
28
+ import './vendor-index.22581bd4.js';
29
29
  import 'child_process';
30
30
  import 'buffer';
31
31
  import './chunk-magic-string.41232190.js';
@@ -1,12 +1,12 @@
1
1
  import { promises } from 'fs';
2
- import { q as isNode, a as getWorkerState, f as safeClearTimeout, e as safeSetTimeout, t as toArray, N as clone, L as getType, o as relative, O as partitionSuiteChildren, P as hasTests, x as hasFailed, v as getFullName, r as resetModules } from './chunk-utils-global.b9f8edf8.js';
2
+ import { q as isNode, a as getWorkerState, f as safeClearTimeout, e as safeSetTimeout, t as toArray, N as clone, L as getType, o as relative, O as partitionSuiteChildren, P as hasTests, x as hasFailed, v as getFullName, r as resetModules } from './chunk-utils-global.550519fc.js';
3
3
  import { importModule } from 'local-pkg';
4
- import { s as suite, t as test, d as describe, i as it, r as runOnce, a as isFirstRun, b as beforeAll, c as afterAll, e as beforeEach, f as afterEach, w as withCallback, g as createExpect, h as expect, v as vitest, j as vi, k as getRunningMode, l as isWatchMode, m as resetRunOnceCounter, R as RealDate, n as clearCollectorContext, o as defaultSuite, p as setHooks, q as getHooks, u as collectorContext, x as getSnapshotClient, y as setState, z as getFn, A as getState } from './chunk-runtime-chain.db87de48.js';
4
+ import { s as suite, t as test, d as describe, i as it, r as runOnce, a as isFirstRun, b as beforeAll, c as afterAll, e as beforeEach, f as afterEach, w as withCallback, g as createExpect, h as expect, v as vitest, j as vi, k as getRunningMode, l as isWatchMode, m as resetRunOnceCounter, R as RealDate, n as clearCollectorContext, o as defaultSuite, p as setHooks, q as getHooks, u as collectorContext, x as getSnapshotClient, y as setState, z as getFn, A as getState } from './chunk-runtime-chain.46442ffe.js';
5
5
  import chai, { assert, should, util } from 'chai';
6
- import { r as rpc } from './chunk-runtime-rpc.6e6614a9.js';
7
- import { t as takeCoverage } from './chunk-defaults.c11f632f.js';
6
+ import { r as rpc } from './chunk-runtime-rpc.50765c8b.js';
7
+ import { t as takeCoverage } from './chunk-defaults.e5ec89dd.js';
8
8
  import { format } from 'util';
9
- import { s as stringify } from './chunk-utils-source-map.ded50c88.js';
9
+ import { s as stringify } from './chunk-utils-source-map.19e9554e.js';
10
10
 
11
11
  var index = /*#__PURE__*/Object.freeze({
12
12
  __proto__: null,
@@ -284,7 +284,7 @@ function getWindowKeys(global, win) {
284
284
  function isClassLikeName(name) {
285
285
  return name[0] === name[0].toUpperCase();
286
286
  }
287
- function populateGlobal(global, win, options = {}) {
287
+ function populateGlobal(global, win, options) {
288
288
  const { bindFunctions = false } = options;
289
289
  const keys = getWindowKeys(global, win);
290
290
  const originals = new Map(allowRewrite.map(([key]) => [key, global[key]]));
@@ -435,7 +435,7 @@ async function setupGlobalEnv(config) {
435
435
  if (isNode)
436
436
  await setupConsoleLogSpy();
437
437
  if (config.globals)
438
- (await import('./chunk-integrations-globals.f7036c09.js')).registerApiGlobally();
438
+ (await import('./chunk-integrations-globals.1cc5e231.js')).registerApiGlobally();
439
439
  }
440
440
  function setupDefines(defines) {
441
441
  for (const key in defines)
package/dist/worker.js CHANGED
@@ -1,8 +1,8 @@
1
- import { l as resolve, a as getWorkerState } from './chunk-utils-global.b9f8edf8.js';
2
- import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-utils.6856b365.js';
3
- import { d as distDir } from './chunk-constants.d60bb984.js';
4
- import { e as executeInViteNode } from './chunk-runtime-mocker.8436db18.js';
5
- import { r as rpc } from './chunk-runtime-rpc.6e6614a9.js';
1
+ import { l as resolve, a as getWorkerState } from './chunk-utils-global.550519fc.js';
2
+ import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-utils.52235551.js';
3
+ import { d as distDir } from './chunk-constants.b0ea3b74.js';
4
+ import { e as executeInViteNode } from './chunk-runtime-mocker.e9fdf718.js';
5
+ import { r as rpc } from './chunk-runtime-rpc.50765c8b.js';
6
6
  import 'tty';
7
7
  import 'local-pkg';
8
8
  import 'path';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.13.0",
4
+ "version": "0.13.1",
5
5
  "description": "A blazing fast unit test framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "./config": {
40
40
  "types": "./config.d.ts",
41
- "import": "./dist/config.js",
42
- "require": "./dist/config.cjs"
41
+ "require": "./dist/config.cjs",
42
+ "import": "./dist/config.js"
43
43
  }
44
44
  },
45
45
  "main": "./dist/index.js",
@@ -97,7 +97,7 @@
97
97
  "@types/node": "^17.0.35",
98
98
  "@types/prompts": "^2.4.0",
99
99
  "@types/sinonjs__fake-timers": "^8.1.2",
100
- "@vitest/ui": "0.13.0",
100
+ "@vitest/ui": "0.13.1",
101
101
  "birpc": "^0.2.3",
102
102
  "c8": "^7.11.3",
103
103
  "cac": "^6.7.12",
@@ -120,11 +120,11 @@
120
120
  "pkg-types": "^0.3.2",
121
121
  "pretty-format": "^27.5.1",
122
122
  "prompts": "^2.4.2",
123
- "rollup": "^2.74.1",
123
+ "rollup": "^2.75.3",
124
124
  "source-map-js": "^1.0.2",
125
125
  "strip-ansi": "^7.0.1",
126
126
  "typescript": "^4.7.2",
127
- "vite-node": "0.13.0",
127
+ "vite-node": "0.13.1",
128
128
  "ws": "^8.7.0"
129
129
  },
130
130
  "scripts": {