vitest 0.0.80 → 0.0.81

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
@@ -1,10 +1,10 @@
1
1
  import require$$2, { EventEmitter } from 'events';
2
- import { s as stringWidth, a as ansiStyles, b as stripAnsi, c as sliceAnsi, d as c, F as F_POINTER, e as F_DOWN, f as F_LONG_DASH, g as F_DOWN_RIGHT, h as F_DOT, i as F_CHECK, j as F_CROSS, k as cliTruncate, l as F_RIGHT, p as printError } from './error-c9295525.js';
2
+ import { s as stringWidth, a as ansiStyles, b as stripAnsi, c as sliceAnsi, d as c, F as F_POINTER, e as F_DOWN, f as F_LONG_DASH, g as F_DOWN_RIGHT, h as F_DOT, i as F_CHECK, j as F_CROSS, k as cliTruncate, l as F_RIGHT, p as printError } from './error-6bb44a98.js';
3
3
  import path, { isAbsolute, relative, dirname, basename, resolve } from 'path';
4
4
  import process$2 from 'process';
5
5
  import { promises } from 'fs';
6
6
  import { createServer } from 'vite';
7
- import { d as defaultIncludes, a as defaultExcludes, b as defaultPort, c as configFiles, e as distDir } from './constants-9da0006f.js';
7
+ import { d as defaultInclude, a as defaultExclude, b as defaultPort, c as configFiles, e as distDir } from './constants-1268ea5c.js';
8
8
  import { performance } from 'perf_hooks';
9
9
  import { g as getNames, s as slash, a as getTests, b as getSuites, t as toArray, h as hasFailed } from './utils-9dcc4050.js';
10
10
  import require$$0 from 'assert';
@@ -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.80";
635
+ var version = "0.0.81";
636
636
 
637
637
  /*
638
638
  How it works:
@@ -2182,7 +2182,7 @@ async function initVitest(options = {}) {
2182
2182
  },
2183
2183
  async configureServer(server2) {
2184
2184
  if (resolved.api)
2185
- server2.middlewares.use((await import('./middleware-fe2b1f7f.js')).default());
2185
+ server2.middlewares.use((await import('./middleware-b567041c.js')).default());
2186
2186
  }
2187
2187
  }
2188
2188
  ],
@@ -2219,8 +2219,8 @@ function resolveConfig(resolved, viteConfig) {
2219
2219
  resolved.environment = resolved.environment || "node";
2220
2220
  resolved.threads = resolved.threads ?? true;
2221
2221
  resolved.interpretDefault = resolved.interpretDefault ?? true;
2222
- resolved.includes = resolved.includes ?? defaultIncludes;
2223
- resolved.excludes = resolved.excludes ?? defaultExcludes;
2222
+ resolved.include = resolved.include ?? defaultInclude;
2223
+ resolved.exclude = resolved.exclude ?? defaultExclude;
2224
2224
  const CI = !!process.env.CI;
2225
2225
  const UPDATE_SNAPSHOT = resolved.update || process.env.UPDATE_SNAPSHOT;
2226
2226
  resolved.snapshotOptions = {
@@ -2349,16 +2349,16 @@ function createChannel(ctx) {
2349
2349
  }
2350
2350
 
2351
2351
  function isTargetFile(id, config) {
2352
- if (mm.isMatch(id, config.excludes))
2352
+ if (mm.isMatch(id, config.exclude))
2353
2353
  return false;
2354
- return mm.isMatch(id, config.includes);
2354
+ return mm.isMatch(id, config.include);
2355
2355
  }
2356
2356
  async function globTestFiles(config) {
2357
2357
  var _a;
2358
- let testFilepaths = await fg(config.includes, {
2358
+ let testFilepaths = await fg(config.include, {
2359
2359
  absolute: true,
2360
2360
  cwd: config.root,
2361
- ignore: config.excludes
2361
+ ignore: config.exclude
2362
2362
  });
2363
2363
  if ((_a = config.cliFilters) == null ? void 0 : _a.length)
2364
2364
  testFilepaths = testFilepaths.filter((i) => config.cliFilters.some((f) => i.includes(f)));
@@ -2,8 +2,8 @@ import { resolve } from 'path';
2
2
  import { fileURLToPath } from 'url';
3
3
 
4
4
  const distDir = resolve(fileURLToPath(import.meta.url), "../../dist");
5
- const defaultIncludes = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
6
- const defaultExcludes = ["**/node_modules/**", "**/dist/**"];
5
+ const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
6
+ const defaultExclude = ["**/node_modules/**", "**/dist/**"];
7
7
  const defaultPort = 51204;
8
8
  const API_PATH = "/__vitest_api__";
9
9
  const configFiles = [
@@ -31,4 +31,4 @@ const globalApis = [
31
31
  "afterEach"
32
32
  ];
33
33
 
34
- export { API_PATH as A, defaultExcludes as a, defaultPort as b, configFiles as c, defaultIncludes as d, distDir as e, globalApis as g };
34
+ export { API_PATH as A, defaultExclude as a, defaultPort as b, configFiles as c, defaultInclude as d, distDir as e, globalApis as g };
package/dist/entry.js CHANGED
@@ -7,7 +7,7 @@ import path, { basename } from 'path';
7
7
  import { r as rpc, s as send } from './rpc-7de86f29.js';
8
8
  import { g as getNames, t as toArray, i as interpretOnlyMode, p as partitionSuiteChildren, c as hasTests, h as hasFailed } from './utils-9dcc4050.js';
9
9
  import fs from 'fs';
10
- import { d as c$1, m as generateDiff } from './error-c9295525.js';
10
+ import { d as c$1, m as generateDiff } from './error-6bb44a98.js';
11
11
  import { performance } from 'perf_hooks';
12
12
  import { b as setHooks, c as createSuiteHooks, e as clearContext, f as defaultSuite, h as context, j as getHooks, k as getFn } from './suite-95be5909.js';
13
13
  import { n as nanoid } from './index-9e71c815.js';
@@ -3597,7 +3597,7 @@ async function setupGlobalEnv(config) {
3597
3597
  setupConsoleLogSpy();
3598
3598
  await setupChai();
3599
3599
  if (config.global)
3600
- (await import('./global-6446cca1.js')).registerApiGlobally();
3600
+ (await import('./global-b8e9d6fe.js')).registerApiGlobally();
3601
3601
  }
3602
3602
  function setupConsoleLogSpy() {
3603
3603
  const stdout = new Writable({
@@ -1303,7 +1303,7 @@ async function printStack(ctx, stack, highlight, onStack) {
1303
1303
  const color = frame === highlight ? c.yellow : c.gray;
1304
1304
  const path = relative(ctx.config.root, frame.file);
1305
1305
  ctx.console.log(color(` ${c.dim(F_POINTER)} ${[frame.method, c.dim(`${path}:${pos.line}:${pos.column}`)].filter(Boolean).join(" ")}`));
1306
- onStack == null ? void 0 : onStack(frame, pos);
1306
+ await (onStack == null ? void 0 : onStack(frame, pos));
1307
1307
  if (frame.file in ctx.state.filesMap)
1308
1308
  break;
1309
1309
  }
@@ -1,4 +1,4 @@
1
- import { g as globalApis } from './constants-9da0006f.js';
1
+ import { g as globalApis } from './constants-1268ea5c.js';
2
2
  import { i as index } from './index-16a06164.js';
3
3
  import 'path';
4
4
  import 'url';
package/dist/index.d.ts CHANGED
@@ -300,12 +300,12 @@ interface UserOptions {
300
300
  *
301
301
  * @default ['**\/*.test.ts']
302
302
  */
303
- includes?: string[];
303
+ include?: string[];
304
304
  /**
305
305
  * Exclude globs for test files
306
306
  * @default ['**\/node_modules\/**']
307
307
  */
308
- excludes?: string[];
308
+ exclude?: string[];
309
309
  /**
310
310
  * Handling for dependencies inlining or externalizing
311
311
  */
@@ -313,7 +313,7 @@ interface UserOptions {
313
313
  /**
314
314
  * Externalize means that Vite will bypass the package to native Node.
315
315
  *
316
- * Externaled dependencies will not be applied Vite's transformers and resolvers.
316
+ * Externalized dependencies will not be applied Vite's transformers and resolvers.
317
317
  * And does not support HMR on reload.
318
318
  *
319
319
  * Typically, packages under `node_modules` are externalized.
@@ -408,7 +408,7 @@ interface UserOptions {
408
408
  /**
409
409
  * Listen to port and serve API
410
410
  *
411
- * When set to try, the default port is 55555
411
+ * When set to true, the default port is 55555
412
412
  *
413
413
  * @default false
414
414
  */
@@ -1,5 +1,5 @@
1
1
  import { stringify } from 'flatted';
2
- import { A as API_PATH } from './constants-9da0006f.js';
2
+ import { A as API_PATH } from './constants-1268ea5c.js';
3
3
  import 'path';
4
4
  import 'url';
5
5
 
package/dist/worker.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { resolve, dirname } from 'path';
2
2
  import { n as nanoid } from './index-9e71c815.js';
3
- import { e as distDir } from './constants-9da0006f.js';
3
+ import { e as distDir } from './constants-1268ea5c.js';
4
4
  import { builtinModules, createRequire } from 'module';
5
5
  import { pathToFileURL, fileURLToPath } from 'url';
6
6
  import vm from 'vm';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest",
3
- "version": "0.0.80",
3
+ "version": "0.0.81",
4
4
  "description": "A blazing fast unit test framework powered by Vite",
5
5
  "keywords": [
6
6
  "vite",