vitest 0.27.2 → 0.27.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 (36) hide show
  1. package/dist/browser.d.ts +3 -3
  2. package/dist/browser.js +12 -11
  3. package/dist/{chunk-api-setup.029198e3.js → chunk-api-setup.0a2398d8.js} +4 -3
  4. package/dist/{chunk-env-node.787e9561.js → chunk-env-node.ffd1183b.js} +26 -0
  5. package/dist/{chunk-integrations-coverage.44413252.js → chunk-integrations-coverage.18366936.js} +3 -1
  6. package/dist/{chunk-integrations-globals.0024ce21.js → chunk-integrations-globals.59b4d460.js} +7 -6
  7. package/dist/{chunk-mock-date.c543fa3e.js → chunk-mock-date.91595ccd.js} +3 -2
  8. package/dist/{chunk-node-git.125c9008.js → chunk-node-git.59caac18.js} +2 -1
  9. package/dist/{chunk-runtime-chain.2da9e75c.js → chunk-runtime-chain.07d16eac.js} +15 -16
  10. package/dist/{chunk-runtime-error.de671af0.js → chunk-runtime-error.f2062967.js} +1 -1
  11. package/dist/{chunk-runtime-mocker.58511c38.js → chunk-runtime-mocker.66533d65.js} +3 -3
  12. package/dist/{chunk-runtime-rpc.d709e91b.js → chunk-runtime-rpc.e79efa9a.js} +1 -1
  13. package/dist/{chunk-runtime-setup.35da9209.js → chunk-runtime-setup.8ca273cd.js} +17 -13
  14. package/dist/{chunk-snapshot-manager.ce714e21.js → chunk-snapshot-manager.d16903ef.js} +89 -4028
  15. package/dist/{chunk-utils-env.f4a39d2c.js → chunk-utils-env.4ebb0106.js} +1 -0
  16. package/dist/{chunk-utils-import.054ab315.js → chunk-utils-import.eb63557e.js} +3 -3
  17. package/dist/{chunk-utils-source-map.5f5d12cf.js → chunk-utils-source-map.832515f7.js} +2 -2
  18. package/dist/cli-wrapper.js +2 -1
  19. package/dist/cli.js +8 -6
  20. package/dist/config.cjs +10 -7
  21. package/dist/config.d.ts +16 -3
  22. package/dist/config.js +10 -8
  23. package/dist/entry.js +24 -13
  24. package/dist/environments.d.ts +1 -1
  25. package/dist/environments.js +1 -1
  26. package/dist/{index-50755efe.d.ts → index-2dd51af4.d.ts} +1 -1
  27. package/dist/index.d.ts +4 -4
  28. package/dist/index.js +8 -7
  29. package/dist/loader.js +5 -4
  30. package/dist/node.d.ts +2 -2
  31. package/dist/node.js +9 -7
  32. package/dist/suite.js +6 -5
  33. package/dist/{types-d97c72c7.d.ts → types-c1386a7d.d.ts} +332 -308
  34. package/dist/vendor-index.57682f0c.js +3964 -0
  35. package/dist/worker.js +11 -8
  36. package/package.json +7 -6
package/dist/worker.js CHANGED
@@ -1,14 +1,15 @@
1
- import { r as relative, b as resolve, f as distDir } from './chunk-utils-env.f4a39d2c.js';
1
+ import { b as resolve, f as distDir, r as relative } from './chunk-utils-env.4ebb0106.js';
2
2
  import { c as createBirpc } from './vendor-index.783e7f3e.js';
3
3
  import { workerId } from 'tinypool';
4
4
  import { ModuleCacheMap } from 'vite-node/client';
5
5
  import { isPrimitive } from 'vite-node/utils';
6
- import { g as getWorkerState } from './chunk-mock-date.c543fa3e.js';
7
- import { e as executeInViteNode } from './chunk-runtime-mocker.58511c38.js';
8
- import { r as rpc } from './chunk-runtime-rpc.d709e91b.js';
9
- import { p as processError } from './chunk-runtime-error.de671af0.js';
6
+ import { g as getWorkerState } from './chunk-mock-date.91595ccd.js';
7
+ import { e as executeInViteNode } from './chunk-runtime-mocker.66533d65.js';
8
+ import { r as rpc } from './chunk-runtime-rpc.e79efa9a.js';
9
+ import { p as processError } from './chunk-runtime-error.f2062967.js';
10
10
  import 'node:url';
11
11
  import 'path';
12
+ import 'std-env';
12
13
  import 'node:path';
13
14
  import 'picocolors';
14
15
  import 'local-pkg';
@@ -38,7 +39,7 @@ async function startViteNode(ctx) {
38
39
  rpc().onWorkerExit(error, code);
39
40
  return processExit(code);
40
41
  };
41
- process.on("unhandledRejection", (err) => {
42
+ function catchError(err, type) {
42
43
  var _a;
43
44
  const worker = getWorkerState();
44
45
  const error = processError(err);
@@ -46,8 +47,10 @@ async function startViteNode(ctx) {
46
47
  error.VITEST_TEST_NAME = (_a = worker.current) == null ? void 0 : _a.name;
47
48
  error.VITEST_TEST_PATH = relative(config.root, worker.filepath);
48
49
  }
49
- rpc().onUnhandledRejection(error);
50
- });
50
+ rpc().onUnhandledError(error, type);
51
+ }
52
+ process.on("uncaughtException", (e) => catchError(e, "Uncaught Exception"));
53
+ process.on("unhandledRejection", (e) => catchError(e, "Unhandled Rejection"));
51
54
  const { run: run2 } = (await executeInViteNode({
52
55
  files: [
53
56
  resolve(distDir, "entry.js")
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.27.2",
4
+ "version": "0.27.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",
@@ -112,13 +112,14 @@
112
112
  "local-pkg": "^0.4.2",
113
113
  "picocolors": "^1.0.0",
114
114
  "source-map": "^0.6.1",
115
+ "std-env": "^3.3.1",
115
116
  "strip-literal": "^1.0.0",
116
117
  "tinybench": "^2.3.1",
117
118
  "tinypool": "^0.3.0",
118
119
  "tinyspy": "^1.0.2",
119
120
  "vite": "^3.0.0 || ^4.0.0",
120
121
  "why-is-node-running": "^2.2.2",
121
- "vite-node": "0.27.2"
122
+ "vite-node": "0.27.3"
122
123
  },
123
124
  "devDependencies": {
124
125
  "@antfu/install-pkg": "^0.1.1",
@@ -157,10 +158,10 @@
157
158
  "strip-ansi": "^7.0.1",
158
159
  "typescript": "^4.9.4",
159
160
  "ws": "^8.12.0",
160
- "@vitest/expect": "0.27.2",
161
- "@vitest/spy": "0.27.2",
162
- "@vitest/utils": "0.27.2",
163
- "@vitest/ui": "0.27.2"
161
+ "@vitest/expect": "0.27.3",
162
+ "@vitest/spy": "0.27.3",
163
+ "@vitest/ui": "0.27.3",
164
+ "@vitest/utils": "0.27.3"
164
165
  },
165
166
  "scripts": {
166
167
  "build": "rimraf dist && rollup -c",