vitest 0.29.1 → 0.29.2

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.
@@ -3,7 +3,7 @@ import k from 'path';
3
3
  import require$$0$1 from 'util';
4
4
  import require$$0$3 from 'child_process';
5
5
  import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.2cbcdd1e.js';
6
- import { o as onetime$1 } from './chunk-node-pkg.4e9b4238.js';
6
+ import { o as onetime$1 } from './chunk-node-pkg.208acffb.js';
7
7
  import require$$0$2 from 'os';
8
8
  import 'node:buffer';
9
9
  import 'node:path';
@@ -47,6 +47,7 @@ import './chunk-utils-tasks.b41c8284.js';
47
47
  import 'crypto';
48
48
  import 'vite-node/utils';
49
49
  import '@vitest/utils/diff';
50
+ import 'node:module';
50
51
  import 'node:crypto';
51
52
  import './chunk-magic-string.3a794426.js';
52
53
  import 'strip-literal';
@@ -37,10 +37,11 @@ import { cpus, hostname } from 'node:os';
37
37
  import Tinypool from 'tinypool';
38
38
  import { performance } from 'perf_hooks';
39
39
  import { g as getFullName, h as hasFailedSnapshot, a as parseErrorStacktrace, p as positionToOffset, l as lineSplitRE } from './chunk-utils-tasks.b41c8284.js';
40
- import { getSafeTimers, shuffle, stringify as stringify$5 } from '@vitest/utils';
40
+ import { getSafeTimers, shuffle, stringify as stringify$5, toArray as toArray$1 } from '@vitest/utils';
41
41
  import { createHash } from 'crypto';
42
42
  import { slash as slash$2, cleanUrl } from 'vite-node/utils';
43
43
  import { unifiedDiff } from '@vitest/utils/diff';
44
+ import { builtinModules } from 'node:module';
44
45
  import { createHash as createHash$1 } from 'node:crypto';
45
46
  import MagicString from './chunk-magic-string.3a794426.js';
46
47
  import { stripLiteral } from 'strip-literal';
@@ -61,7 +62,7 @@ function _mergeNamespaces(n, m) {
61
62
  return Object.freeze(n);
62
63
  }
63
64
 
64
- var version$1 = "0.29.1";
65
+ var version$1 = "0.29.2";
65
66
 
66
67
  async function ensurePackageInstalled(dependency, root) {
67
68
  if (isPackageExists(dependency, { paths: [root] }))
@@ -79,7 +80,7 @@ async function ensurePackageInstalled(dependency, root) {
79
80
  message: c.reset(`Do you want to install ${c.green(dependency)}?`)
80
81
  });
81
82
  if (install) {
82
- await (await import('./chunk-install-pkg.cbeede46.js')).installPackage(dependency, { dev: true });
83
+ await (await import('./chunk-install-pkg.aa415fd6.js')).installPackage(dependency, { dev: true });
83
84
  process.stderr.write(c.yellow(`
84
85
  Package ${dependency} installed, re-run the command to start.
85
86
  `));
@@ -11285,7 +11286,7 @@ createLogUpdate(process$1.stdout);
11285
11286
 
11286
11287
  createLogUpdate(process$1.stderr);
11287
11288
 
11288
- var version = "0.29.1";
11289
+ var version = "0.29.2";
11289
11290
 
11290
11291
  async function printError(error, ctx, options = {}) {
11291
11292
  const { showCodeFrame = true, fullStack = false, type } = options;
@@ -11674,10 +11675,17 @@ class Vitest {
11674
11675
  return this.coverageProvider;
11675
11676
  }
11676
11677
  getSerializableConfig() {
11678
+ var _a, _b;
11677
11679
  return deepMerge(
11678
11680
  {
11679
11681
  ...this.config,
11680
11682
  reporters: [],
11683
+ deps: {
11684
+ ...this.config.deps,
11685
+ experimentalOptimizer: {
11686
+ enabled: ((_b = (_a = this.config.deps) == null ? void 0 : _a.experimentalOptimizer) == null ? void 0 : _b.enabled) ?? false
11687
+ }
11688
+ },
11681
11689
  snapshotOptions: {
11682
11690
  ...this.config.snapshotOptions,
11683
11691
  resolveSnapshotPath: void 0
@@ -12503,14 +12511,23 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
12503
12511
  entries: []
12504
12512
  };
12505
12513
  } else {
12506
- const entries = await ctx.globAllTestFiles(preOptions, preOptions.dir || getRoot());
12514
+ const root = config.root || process.cwd();
12515
+ const entries = await ctx.globAllTestFiles(preOptions, preOptions.dir || root);
12516
+ if (preOptions == null ? void 0 : preOptions.setupFiles) {
12517
+ const setupFiles = toArray$1(preOptions.setupFiles).map(
12518
+ (file) => normalize(
12519
+ resolveModule(file, { paths: [root] }) ?? resolve(root, file)
12520
+ )
12521
+ );
12522
+ entries.push(...setupFiles);
12523
+ }
12507
12524
  optimizeConfig.cacheDir = ((_f = preOptions.cache) == null ? void 0 : _f.dir) ?? "node_modules/.vitest";
12508
12525
  optimizeConfig.optimizeDeps = {
12509
12526
  ...viteConfig.optimizeDeps,
12510
12527
  ...optimizer,
12511
12528
  disabled: false,
12512
12529
  entries: [...optimizer.entries || ((_g = viteConfig.optimizeDeps) == null ? void 0 : _g.entries) || [], ...entries],
12513
- exclude: ["vitest", ...optimizer.exclude || ((_h = viteConfig.optimizeDeps) == null ? void 0 : _h.exclude) || []],
12530
+ exclude: ["vitest", ...builtinModules, ...optimizer.exclude || ((_h = viteConfig.optimizeDeps) == null ? void 0 : _h.exclude) || []],
12514
12531
  include: (optimizer.include || ((_i = viteConfig.optimizeDeps) == null ? void 0 : _i.include) || []).filter((n) => n !== "vitest")
12515
12532
  };
12516
12533
  const { error: logError } = 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, d as divider } from './chunk-node-pkg.4e9b4238.js';
4
+ import { v as version, s as startVitest, d as divider } from './chunk-node-pkg.208acffb.js';
5
5
  import './chunk-constants.797d3ebf.js';
6
6
  import 'node:url';
7
7
  import './chunk-utils-env.860d90c2.js';
@@ -48,6 +48,7 @@ import './chunk-utils-tasks.b41c8284.js';
48
48
  import 'crypto';
49
49
  import 'vite-node/utils';
50
50
  import '@vitest/utils/diff';
51
+ import 'node:module';
51
52
  import 'node:crypto';
52
53
  import './chunk-magic-string.3a794426.js';
53
54
  import 'strip-literal';
package/dist/node.js CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-node-pkg.4e9b4238.js';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-node-pkg.208acffb.js';
2
2
  export { V as VitestExecutor } from './chunk-runtime-mocker.a048e92d.js';
3
3
  import 'pathe';
4
4
  import './chunk-constants.797d3ebf.js';
@@ -48,12 +48,12 @@ import './chunk-utils-tasks.b41c8284.js';
48
48
  import 'crypto';
49
49
  import 'vite-node/utils';
50
50
  import '@vitest/utils/diff';
51
+ import 'node:module';
51
52
  import 'node:crypto';
52
53
  import './chunk-magic-string.3a794426.js';
53
54
  import 'strip-literal';
54
55
  import 'readline';
55
56
  import './vendor-index.bdee400f.js';
56
- import 'node:module';
57
57
  import 'node:assert';
58
58
  import 'node:util';
59
59
  import '@vitest/spy';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.29.1",
4
+ "version": "0.29.2",
5
5
  "description": "A blazing fast unit test framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -132,11 +132,11 @@
132
132
  "tinyspy": "^1.0.2",
133
133
  "vite": "^3.0.0 || ^4.0.0",
134
134
  "why-is-node-running": "^2.2.2",
135
- "@vitest/expect": "0.29.1",
136
- "@vitest/runner": "0.29.1",
137
- "vite-node": "0.29.1",
138
- "@vitest/utils": "0.29.1",
139
- "@vitest/spy": "0.29.1"
135
+ "@vitest/utils": "0.29.2",
136
+ "vite-node": "0.29.2",
137
+ "@vitest/spy": "0.29.2",
138
+ "@vitest/runner": "0.29.2",
139
+ "@vitest/expect": "0.29.2"
140
140
  },
141
141
  "devDependencies": {
142
142
  "@antfu/install-pkg": "^0.1.1",