vitest 0.0.122 → 0.0.123

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
@@ -7,8 +7,8 @@ import process$1 from 'process';
7
7
  import { m as mergeStream, g as getStream, c as crossSpawn } from './index-6e709f57.js';
8
8
  import require$$0, { constants } from 'os';
9
9
  import { s as signalExit } from './index-648e7ab2.js';
10
- import { e as ensurePackageInstalled } from './index-090545ef.js';
11
- import { c as createVitest } from './index-123a18df.js';
10
+ import { e as ensurePackageInstalled } from './index-250bdca0.js';
11
+ import { c as createVitest } from './index-a7ae9662.js';
12
12
  import './_commonjsHelpers-c9e3b764.js';
13
13
  import 'fs';
14
14
  import 'stream';
@@ -18,10 +18,10 @@ import 'url';
18
18
  import 'tty';
19
19
  import 'local-pkg';
20
20
  import 'vite';
21
- import './constants-22bbd600.js';
21
+ import './constants-744cb76d.js';
22
22
  import './magic-string.es-94000aea.js';
23
23
  import 'perf_hooks';
24
- import './diff-a295cb37.js';
24
+ import './diff-a0cbb825.js';
25
25
  import 'module';
26
26
  import 'worker_threads';
27
27
  import 'tinypool';
@@ -1700,7 +1700,7 @@ function execa(file, args, options) {
1700
1700
  return mergePromise(spawned, handlePromiseOnce);
1701
1701
  }
1702
1702
 
1703
- var version = "0.0.122";
1703
+ var version = "0.0.123";
1704
1704
 
1705
1705
  const CLOSE_TIMEOUT = 1e3;
1706
1706
  const cli = cac("vitest");
@@ -1,5 +1,5 @@
1
1
  import { fileURLToPath } from 'url';
2
- import { k as resolve } from './index-090545ef.js';
2
+ import { k as resolve } from './index-250bdca0.js';
3
3
 
4
4
  const distDir = resolve(fileURLToPath(import.meta.url), "../../dist");
5
5
  const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
@@ -1,5 +1,5 @@
1
1
  import { existsSync, promises } from 'fs';
2
- import { o as notNullish, c, r as relative } from './index-090545ef.js';
2
+ import { o as notNullish, c, r as relative } from './index-250bdca0.js';
3
3
 
4
4
  function Diff() {}
5
5
  Diff.prototype = {
package/dist/entry.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import fs, { promises } from 'fs';
2
- import { f as format_1, h as getSerializers, p as plugins_1, b as getState, j as equals, k as iterableEquality, l as subsetEquality, m as isA, J as JestChaiExpect, n as clearContext, o as defaultSuite, q as setHooks, r as getHooks, u as context, s as setState, x as getFn, e as vi } from './vi-c99184a5.js';
2
+ import { f as format_1, h as getSerializers, p as plugins_1, b as getState, j as equals, k as iterableEquality, l as subsetEquality, m as isA, J as JestChaiExpect, n as clearContext, o as defaultSuite, q as setHooks, r as getHooks, u as context, s as setState, x as getFn, e as vi } from './vi-aef0a94d.js';
3
3
  import { Console } from 'console';
4
4
  import { Writable } from 'stream';
5
5
  import { importModule } from 'local-pkg';
6
6
  import chai$1, { expect, util } from 'chai';
7
7
  import { a as commonjsRequire, c as commonjsGlobal } from './_commonjsHelpers-c9e3b764.js';
8
- import { u as index, s as slash, v as getNames, c, t as toArray, r as relative, w as partitionSuiteChildren, x as hasTests, h as hasFailed } from './index-090545ef.js';
8
+ import { u as index, s as slash, v as getNames, c, t as toArray, r as relative, w as partitionSuiteChildren, x as hasTests, h as hasFailed } from './index-250bdca0.js';
9
9
  import { r as rpc } from './rpc-8c7cc374.js';
10
- import { l as getOriginalPos, m as posToNumber, n as parseStack, u as unifiedDiff } from './diff-a295cb37.js';
11
- import { performance } from 'perf_hooks';
10
+ import { l as getOriginalPos, m as posToNumber, n as parseStack, u as unifiedDiff } from './diff-a0cbb825.js';
11
+ import { performance as performance$1 } from 'perf_hooks';
12
12
  import { createHash } from 'crypto';
13
13
  import { format } from 'util';
14
14
  import './jest-mock-038a01b3.js';
@@ -1228,7 +1228,7 @@ async function setupGlobalEnv(config) {
1228
1228
  setupConsoleLogSpy();
1229
1229
  await setupChai();
1230
1230
  if (config.global)
1231
- (await import('./global-71c4f178.js')).registerApiGlobally();
1231
+ (await import('./global-f9288768.js')).registerApiGlobally();
1232
1232
  }
1233
1233
  function setupConsoleLogSpy() {
1234
1234
  const stdout = new Writable({
@@ -1332,7 +1332,6 @@ async function collectTests(paths, config) {
1332
1332
  name: path,
1333
1333
  type: "suite",
1334
1334
  mode: "run",
1335
- computeMode: "serial",
1336
1335
  filepath,
1337
1336
  tasks: []
1338
1337
  };
@@ -1350,14 +1349,15 @@ async function collectTests(paths, config) {
1350
1349
  } else if (c.type === "suite") {
1351
1350
  file.tasks.push(c);
1352
1351
  } else {
1352
+ const start = performance.now();
1353
1353
  const suite = await c.collect(file);
1354
+ file.collectDuration = performance.now() - start;
1354
1355
  if (suite.name || suite.tasks.length)
1355
1356
  file.tasks.push(suite);
1356
1357
  }
1357
1358
  }
1358
1359
  } catch (e) {
1359
1360
  file.result = {
1360
- start: performance.now(),
1361
1361
  state: "fail",
1362
1362
  error: processError(e)
1363
1363
  };
@@ -1446,8 +1446,8 @@ async function sendTasksUpdate() {
1446
1446
  async function runTest(test) {
1447
1447
  if (test.mode !== "run")
1448
1448
  return;
1449
+ const start = performance$1.now();
1449
1450
  test.result = {
1450
- start: performance.now(),
1451
1451
  state: "run"
1452
1452
  };
1453
1453
  updateTask(test);
@@ -1490,7 +1490,7 @@ async function runTest(test) {
1490
1490
  }
1491
1491
  }
1492
1492
  getSnapshotClient().clearTest();
1493
- test.result.end = performance.now();
1493
+ test.result.duration = performance$1.now() - start;
1494
1494
  process.__vitest_worker__.current = void 0;
1495
1495
  updateTask(test);
1496
1496
  }
@@ -1498,8 +1498,8 @@ async function runSuite(suite) {
1498
1498
  var _a;
1499
1499
  if (((_a = suite.result) == null ? void 0 : _a.state) === "fail")
1500
1500
  return;
1501
+ const start = performance$1.now();
1501
1502
  suite.result = {
1502
- start: performance.now(),
1503
1503
  state: "run"
1504
1504
  };
1505
1505
  updateTask(suite);
@@ -1511,12 +1511,11 @@ async function runSuite(suite) {
1511
1511
  try {
1512
1512
  await callSuiteHook(suite, "beforeAll", [suite]);
1513
1513
  for (const tasksGroup of partitionSuiteChildren(suite)) {
1514
- const computeMode = tasksGroup[0].computeMode;
1515
- if (computeMode === "serial") {
1514
+ if (tasksGroup[0].concurrent === true) {
1515
+ await Promise.all(tasksGroup.map((c) => runSuiteChild(c)));
1516
+ } else {
1516
1517
  for (const c of tasksGroup)
1517
1518
  await runSuiteChild(c);
1518
- } else if (computeMode === "concurrent") {
1519
- await Promise.all(tasksGroup.map((c) => runSuiteChild(c)));
1520
1519
  }
1521
1520
  }
1522
1521
  await callSuiteHook(suite, "afterAll", [suite]);
@@ -1525,7 +1524,7 @@ async function runSuite(suite) {
1525
1524
  suite.result.error = processError(e);
1526
1525
  }
1527
1526
  }
1528
- suite.result.end = performance.now();
1527
+ suite.result.duration = performance$1.now() - start;
1529
1528
  if (suite.mode === "run") {
1530
1529
  if (!hasTests(suite)) {
1531
1530
  suite.result.state = "fail";