vitest 0.34.1 → 0.34.3

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.
Files changed (42) hide show
  1. package/LICENSE.md +28 -0
  2. package/dist/browser.d.ts +3 -3
  3. package/dist/browser.js +1 -1
  4. package/dist/child.js +11 -6
  5. package/dist/{chunk-api-setup.644415c3.js → chunk-api-setup.3b016b1c.js} +26 -16
  6. package/dist/{chunk-install-pkg.dd40cbef.js → chunk-install-pkg.a036014e.js} +8 -4
  7. package/dist/{chunk-integrations-globals.877c84db.js → chunk-integrations-globals.7f4b17bf.js} +5 -4
  8. package/dist/cli.js +11 -7
  9. package/dist/config.cjs +3 -1
  10. package/dist/config.d.ts +3 -3
  11. package/dist/config.js +3 -1
  12. package/dist/coverage.d.ts +3 -3
  13. package/dist/entry-vm.js +5 -4
  14. package/dist/entry.js +5 -4
  15. package/dist/environments.d.ts +3 -3
  16. package/dist/environments.js +11 -2
  17. package/dist/execute.d.ts +139 -0
  18. package/dist/execute.js +1 -1
  19. package/dist/index.d.ts +10 -9
  20. package/dist/index.js +6 -5
  21. package/dist/loader.js +9 -528
  22. package/dist/node.d.ts +4 -4
  23. package/dist/node.js +8 -4
  24. package/dist/{types-3c7dbfa5.d.ts → reporters-2ff87305.d.ts} +72 -5
  25. package/dist/reporters.d.ts +16 -0
  26. package/dist/reporters.js +16 -0
  27. package/dist/runners.d.ts +3 -3
  28. package/dist/runners.js +4 -3
  29. package/dist/{vendor-environments.443ecd82.js → vendor-environments.8eb4d407.js} +28 -10
  30. package/dist/{vendor-execute.9ab1c1a7.js → vendor-execute.a63e187f.js} +416 -211
  31. package/dist/vendor-index.0b5b3600.js +2062 -0
  32. package/dist/{vendor-index.087d1af7.js → vendor-index.29282562.js} +1 -1
  33. package/dist/{vendor-index.eff408fd.js → vendor-index.7178e7a2.js} +1 -1
  34. package/dist/{vendor-node.caa511fc.js → vendor-node.5ce5f335.js} +302 -2757
  35. package/dist/vendor-reporters.f6975b8d.js +2584 -0
  36. package/dist/vendor-tasks.f9d75aed.js +14 -0
  37. package/dist/{vendor-vi.271667ef.js → vendor-vi.597d9e06.js} +3 -2
  38. package/dist/vm.js +14 -6
  39. package/dist/worker.js +12 -6
  40. package/package.json +11 -7
  41. package/reporters.d.ts +1 -0
  42. package/dist/vendor-source-map.e6c1997b.js +0 -747
@@ -0,0 +1,14 @@
1
+ import { getNames, getTests } from '@vitest/runner/utils';
2
+ import '@vitest/utils';
3
+
4
+ function hasFailedSnapshot(suite) {
5
+ return getTests(suite).some((s) => {
6
+ var _a, _b;
7
+ return (_b = (_a = s.result) == null ? void 0 : _a.errors) == null ? void 0 : _b.some((e) => typeof (e == null ? void 0 : e.message) === "string" && e.message.match(/Snapshot .* mismatched/));
8
+ });
9
+ }
10
+ function getFullName(task, separator = " > ") {
11
+ return getNames(task).join(separator);
12
+ }
13
+
14
+ export { getFullName as g, hasFailedSnapshot as h };
@@ -1,14 +1,15 @@
1
1
  import { getCurrentSuite, getCurrentTest } from '@vitest/runner';
2
2
  import { createChainable, getNames } from '@vitest/runner/utils';
3
3
  import { getSafeTimers, noop, assertTypes, createSimpleStackTrace } from '@vitest/utils';
4
- import { i as isRunningInBenchmark } from './vendor-index.087d1af7.js';
4
+ import { i as isRunningInBenchmark } from './vendor-index.29282562.js';
5
5
  import * as chai$1 from 'chai';
6
6
  import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './vendor-_commonjsHelpers.7d1333e8.js';
7
7
  import { equals, iterableEquality, subsetEquality, JestExtend, JestChaiExpect, JestAsymmetricMatchers, GLOBAL_EXPECT as GLOBAL_EXPECT$1, getState, setState } from '@vitest/expect';
8
8
  import { SnapshotClient, stripSnapshotIndentation, addSerializer } from '@vitest/snapshot';
9
9
  import '@vitest/utils/error';
10
- import { g as getFullName, a as parseSingleStack } from './vendor-source-map.e6c1997b.js';
10
+ import { g as getFullName } from './vendor-tasks.f9d75aed.js';
11
11
  import { g as getWorkerState, a as getCurrentEnvironment } from './vendor-global.97e4527c.js';
12
+ import { parseSingleStack } from '@vitest/utils/source-map';
12
13
  import require$$2 from 'util';
13
14
  import { R as RealDate, r as resetDate, m as mockDate } from './vendor-date.6e993429.js';
14
15
  import { spyOn, fn, isMockFunction, spies } from '@vitest/spy';
package/dist/vm.js CHANGED
@@ -7,20 +7,26 @@ 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.443ecd82.js';
11
- import { b as startVitestExecutor } from './vendor-execute.9ab1c1a7.js';
10
+ import { l as loadEnvironment } from './vendor-environments.8eb4d407.js';
11
+ import { b as startVitestExecutor } from './vendor-execute.a63e187f.js';
12
12
  import { createCustomConsole } from './chunk-runtime-console.ea222ffb.js';
13
13
  import { c as createSafeRpc } from './vendor-rpc.cbd8e972.js';
14
- import 'local-pkg';
14
+ import './vendor-index.0b5b3600.js';
15
+ import 'acorn';
16
+ import 'node:module';
17
+ import 'node:fs';
18
+ import 'node:assert';
19
+ import 'node:process';
20
+ import 'node:path';
21
+ import 'node:v8';
22
+ import 'node:util';
15
23
  import 'node:console';
24
+ import 'local-pkg';
16
25
  import 'vite-node/utils';
17
26
  import '@vitest/utils/error';
18
27
  import './vendor-global.97e4527c.js';
19
- import 'node:fs';
20
28
  import '@vitest/utils';
21
29
  import './vendor-base.9c08bbd0.js';
22
- import 'node:path';
23
- import 'node:module';
24
30
  import 'vite-node/constants';
25
31
  import 'node:stream';
26
32
  import './vendor-date.6e993429.js';
@@ -88,6 +94,8 @@ async function run(ctx) {
88
94
  context.process = process;
89
95
  context.global = context;
90
96
  context.console = createCustomConsole(state);
97
+ context.setImmediate = setImmediate;
98
+ context.clearImmediate = clearImmediate;
91
99
  if (ctx.invalidates) {
92
100
  ctx.invalidates.forEach((fsPath) => {
93
101
  moduleCache.delete(fsPath);
package/dist/worker.js CHANGED
@@ -2,24 +2,30 @@ 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.443ecd82.js';
6
- import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.9ab1c1a7.js';
5
+ import { l as loadEnvironment } from './vendor-environments.8eb4d407.js';
6
+ import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.a63e187f.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';
9
9
  import 'node:url';
10
10
  import 'pathe';
11
- import 'local-pkg';
11
+ import './vendor-index.0b5b3600.js';
12
+ import 'acorn';
13
+ import 'node:module';
14
+ import 'node:fs';
15
+ import 'node:assert';
16
+ import 'node:process';
17
+ import 'node:path';
18
+ import 'node:v8';
19
+ import 'node:util';
12
20
  import 'node:console';
21
+ import 'local-pkg';
13
22
  import 'node:vm';
14
23
  import 'vite-node/client';
15
24
  import 'vite-node/utils';
16
25
  import '@vitest/utils/error';
17
26
  import './vendor-paths.84fc7a99.js';
18
- import 'node:fs';
19
27
  import '@vitest/utils';
20
28
  import './vendor-base.9c08bbd0.js';
21
- import 'node:path';
22
- import 'node:module';
23
29
  import 'vite-node/constants';
24
30
 
25
31
  async function init(ctx) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.34.1",
4
+ "version": "0.34.3",
5
5
  "description": "A blazing fast unit test framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -77,6 +77,10 @@
77
77
  "./coverage": {
78
78
  "types": "./coverage.d.ts",
79
79
  "import": "./dist/coverage.js"
80
+ },
81
+ "./reporters": {
82
+ "types": "./dist/reporters.d.ts",
83
+ "import": "./dist/reporters.js"
80
84
  }
81
85
  },
82
86
  "main": "./dist/index.js",
@@ -151,12 +155,12 @@
151
155
  "tinypool": "^0.7.0",
152
156
  "vite": "^3.0.0 || ^4.0.0",
153
157
  "why-is-node-running": "^2.2.2",
154
- "@vitest/utils": "0.34.1",
155
- "vite-node": "0.34.1",
156
- "@vitest/runner": "0.34.1",
157
- "@vitest/expect": "0.34.1",
158
- "@vitest/snapshot": "0.34.1",
159
- "@vitest/spy": "0.34.1"
158
+ "@vitest/runner": "0.34.3",
159
+ "@vitest/utils": "0.34.3",
160
+ "vite-node": "0.34.3",
161
+ "@vitest/expect": "0.34.3",
162
+ "@vitest/snapshot": "0.34.3",
163
+ "@vitest/spy": "0.34.3"
160
164
  },
161
165
  "devDependencies": {
162
166
  "@ampproject/remapping": "^2.2.1",
package/reporters.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/reporters.js'