vitest 0.26.0 → 0.26.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.
Files changed (41) hide show
  1. package/browser.d.ts +1 -0
  2. package/dist/browser.d.ts +5 -5
  3. package/dist/browser.js +16 -14
  4. package/dist/{chunk-api-setup.08f3b356.js → chunk-api-setup.46ee0021.js} +7 -5
  5. package/dist/{chunk-env-node.67948209.js → chunk-env-node.b3664da2.js} +1 -1
  6. package/dist/{chunk-install-pkg.579a5a27.js → chunk-install-pkg.31846bc1.js} +20 -20
  7. package/dist/chunk-integrations-globals.5af12e76.js +27 -0
  8. package/dist/{chunk-node-git.5a1b1656.js → chunk-node-git.43b341db.js} +10 -6
  9. package/dist/{chunk-runtime-chain.e655f6cc.js → chunk-runtime-chain.198631fd.js} +8 -7
  10. package/dist/{chunk-runtime-error.dfbbf9be.js → chunk-runtime-error.12631a44.js} +6 -4
  11. package/dist/{chunk-runtime-mocker.35fabb8b.js → chunk-runtime-mocker.03096876.js} +11 -4
  12. package/dist/{chunk-runtime-rpc.7959fc79.js → chunk-runtime-rpc.503623e9.js} +2 -2
  13. package/dist/{chunk-runtime-setup.4c1b529e.js → chunk-runtime-setup.f79addc3.js} +17 -16
  14. package/dist/{chunk-snapshot-manager.7d978f79.js → chunk-snapshot-manager.8c94a052.js} +74 -47
  15. package/dist/{chunk-typecheck-constants.3f865d14.js → chunk-typecheck-constants.e478eb98.js} +3 -3
  16. package/dist/{chunk-utils-env.03f840f2.js → chunk-utils-env.4afc6329.js} +8 -8
  17. package/dist/{chunk-utils-import.ca62c9d7.js → chunk-utils-import.dc87c88c.js} +41 -40
  18. package/dist/{chunk-utils-source-map.5bbb50cd.js → chunk-utils-source-map.95b8b3f0.js} +2 -2
  19. package/dist/{chunk-utils-timers.793fd179.js → chunk-utils-timers.54caa12a.js} +31 -15
  20. package/dist/cli-wrapper.js +10 -5
  21. package/dist/cli.js +31 -19
  22. package/dist/config.d.ts +3 -3
  23. package/dist/entry.js +16 -14
  24. package/dist/environments.d.ts +3 -3
  25. package/dist/environments.js +2 -2
  26. package/dist/{index-c3f83a58.d.ts → index-40ebba2b.d.ts} +1 -1
  27. package/dist/index.d.ts +6 -6
  28. package/dist/index.js +12 -10
  29. package/dist/loader.js +10 -6
  30. package/dist/node.d.ts +5 -4
  31. package/dist/node.js +26 -18
  32. package/dist/suite.js +10 -8
  33. package/dist/{types-56bcd6c3.d.ts → types-2a26f28c.d.ts} +28 -6
  34. package/dist/{vendor-index.96e022fd.js → vendor-index.2e96c50b.js} +6 -2
  35. package/dist/{vendor-index.e1d4cf84.js → vendor-index.62932580.js} +16 -16
  36. package/dist/{vendor-index.9c919048.js → vendor-index.808a85a6.js} +0 -0
  37. package/dist/{vendor-index.737c3cff.js → vendor-index.a323f2d0.js} +9 -8
  38. package/dist/worker.js +14 -9
  39. package/environments.d.ts +1 -0
  40. package/package.json +4 -4
  41. package/dist/chunk-integrations-globals.cab94a09.js +0 -25
@@ -1,10 +1,14 @@
1
1
  import 'acorn';
2
- import { builtinModules } from 'module';
2
+ import { builtinModules } from 'node:module';
3
+ import 'node:fs';
4
+ import { pathToFileURL } from 'node:url';
5
+ import 'url';
3
6
  import 'fs';
4
- import { pathToFileURL } from 'url';
5
7
  import 'path';
8
+ import 'module';
6
9
  import assert from 'assert';
7
10
  import { format, inspect } from 'util';
11
+ import 'node:path';
8
12
 
9
13
  const BUILTIN_MODULES = new Set(builtinModules);
10
14
 
@@ -1,11 +1,11 @@
1
- import childProcess from 'child_process';
2
- import path$3 from 'path';
1
+ import require$$0$1 from 'child_process';
2
+ import g from 'path';
3
3
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
4
- import fs$1 from 'fs';
4
+ import require$$0 from 'fs';
5
5
  import assert$1 from 'assert';
6
6
  import require$$2 from 'events';
7
- import require$$0$1 from 'buffer';
8
- import require$$0 from 'stream';
7
+ import require$$0$3 from 'buffer';
8
+ import require$$0$2 from 'stream';
9
9
  import util from 'util';
10
10
 
11
11
  var crossSpawn = {exports: {}};
@@ -19,7 +19,7 @@ function requireWindows () {
19
19
  windows = isexe;
20
20
  isexe.sync = sync;
21
21
 
22
- var fs = fs$1;
22
+ var fs = require$$0;
23
23
 
24
24
  function checkPathExt (path, options) {
25
25
  var pathext = options.pathExt !== undefined ?
@@ -70,7 +70,7 @@ function requireMode () {
70
70
  mode = isexe;
71
71
  isexe.sync = sync;
72
72
 
73
- var fs = fs$1;
73
+ var fs = require$$0;
74
74
 
75
75
  function isexe (path, options, cb) {
76
76
  fs.stat(path, function (er, stat) {
@@ -172,7 +172,7 @@ const isWindows = process.platform === 'win32' ||
172
172
  process.env.OSTYPE === 'cygwin' ||
173
173
  process.env.OSTYPE === 'msys';
174
174
 
175
- const path$2 = path$3;
175
+ const path$2 = g;
176
176
  const COLON = isWindows ? ';' : ':';
177
177
  const isexe = isexe_1;
178
178
 
@@ -311,7 +311,7 @@ pathKey$1.exports = pathKey;
311
311
  // TODO: Remove this for the next major release
312
312
  pathKey$1.exports.default = pathKey;
313
313
 
314
- const path$1 = path$3;
314
+ const path$1 = g;
315
315
  const which = which_1;
316
316
  const getPathKey = pathKey$1.exports;
317
317
 
@@ -429,7 +429,7 @@ var shebangCommand$1 = (string = '') => {
429
429
  return argument ? `${binary} ${argument}` : binary;
430
430
  };
431
431
 
432
- const fs = fs$1;
432
+ const fs = require$$0;
433
433
  const shebangCommand = shebangCommand$1;
434
434
 
435
435
  function readShebang$1(command) {
@@ -451,7 +451,7 @@ function readShebang$1(command) {
451
451
 
452
452
  var readShebang_1 = readShebang$1;
453
453
 
454
- const path = path$3;
454
+ const path = g;
455
455
  const resolveCommand = resolveCommand_1;
456
456
  const escape = _escape;
457
457
  const readShebang = readShebang_1;
@@ -599,7 +599,7 @@ var enoent$1 = {
599
599
  notFoundError,
600
600
  };
601
601
 
602
- const cp = childProcess;
602
+ const cp = require$$0$1;
603
603
  const parse = parse_1;
604
604
  const enoent = enoent$1;
605
605
 
@@ -909,7 +909,7 @@ if (!processOk(process$1)) {
909
909
 
910
910
  var getStream$1 = {exports: {}};
911
911
 
912
- const {PassThrough: PassThroughStream} = require$$0;
912
+ const {PassThrough: PassThroughStream} = require$$0$2;
913
913
 
914
914
  var bufferStream$1 = options => {
915
915
  options = {...options};
@@ -961,8 +961,8 @@ var bufferStream$1 = options => {
961
961
  return stream;
962
962
  };
963
963
 
964
- const {constants: BufferConstants} = require$$0$1;
965
- const stream = require$$0;
964
+ const {constants: BufferConstants} = require$$0$3;
965
+ const stream = require$$0$2;
966
966
  const {promisify} = util;
967
967
  const bufferStream = bufferStream$1;
968
968
 
@@ -1022,7 +1022,7 @@ getStream$1.exports.buffer = (stream, options) => getStream(stream, {...options,
1022
1022
  getStream$1.exports.array = (stream, options) => getStream(stream, {...options, array: true});
1023
1023
  getStream$1.exports.MaxBufferError = MaxBufferError;
1024
1024
 
1025
- const { PassThrough } = require$$0;
1025
+ const { PassThrough } = require$$0$2;
1026
1026
 
1027
1027
  var mergeStream = function (/*streams...*/) {
1028
1028
  var sources = [];
@@ -1,10 +1,11 @@
1
- import { Buffer } from 'buffer';
2
- import path from 'path';
3
- import childProcess from 'child_process';
4
- import process$1 from 'process';
5
- import { s as signalExit, m as mergeStream, g as getStream, c as crossSpawn } from './vendor-index.e1d4cf84.js';
6
- import url from 'url';
7
- import require$$0, { constants } from 'os';
1
+ import { Buffer } from 'node:buffer';
2
+ import path from 'node:path';
3
+ import childProcess from 'node:child_process';
4
+ import process$1 from 'node:process';
5
+ import { s as signalExit, m as mergeStream, g as getStream, c as crossSpawn } from './vendor-index.62932580.js';
6
+ import url from 'node:url';
7
+ import { constants } from 'os';
8
+ import os from 'node:os';
8
9
 
9
10
  function stripFinalNewline(input) {
10
11
  const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
@@ -704,7 +705,7 @@ const setKillTimeout = (kill, signal, options, killResult) => {
704
705
 
705
706
  const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
706
707
 
707
- const isSigterm = signal => signal === require$$0.constants.signals.SIGTERM
708
+ const isSigterm = signal => signal === os.constants.signals.SIGTERM
708
709
  || (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM');
709
710
 
710
711
  const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => {
package/dist/worker.js CHANGED
@@ -1,23 +1,28 @@
1
- import { b as resolve, e as distDir } from './chunk-utils-env.03f840f2.js';
1
+ import { b as resolve, e as distDir } from './chunk-utils-env.4afc6329.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
- import { g as getWorkerState } from './chunk-typecheck-constants.3f865d14.js';
6
- import { e as executeInViteNode } from './chunk-runtime-mocker.35fabb8b.js';
7
- import { r as rpc } from './chunk-runtime-rpc.7959fc79.js';
8
- import { p as processError } from './chunk-runtime-error.dfbbf9be.js';
5
+ import { g as getWorkerState } from './chunk-typecheck-constants.e478eb98.js';
6
+ import { e as executeInViteNode } from './chunk-runtime-mocker.03096876.js';
7
+ import { r as rpc } from './chunk-runtime-rpc.503623e9.js';
8
+ import { p as processError } from './chunk-runtime-error.12631a44.js';
9
9
  import 'tty';
10
- import 'url';
10
+ import 'node:url';
11
11
  import 'path';
12
+ import 'node:path';
12
13
  import 'local-pkg';
14
+ import 'vite-node/utils';
13
15
  import 'vite';
14
- import 'fs';
15
- import './vendor-index.96e022fd.js';
16
+ import './vendor-index.2e96c50b.js';
16
17
  import 'acorn';
18
+ import 'node:module';
19
+ import 'node:fs';
20
+ import 'url';
21
+ import 'fs';
17
22
  import 'module';
18
23
  import 'assert';
19
24
  import 'util';
20
- import './chunk-utils-timers.793fd179.js';
25
+ import './chunk-utils-timers.54caa12a.js';
21
26
  import 'chai';
22
27
 
23
28
  let _viteNode;
@@ -0,0 +1 @@
1
+ export * from './dist/environments'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.26.0",
4
+ "version": "0.26.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",
@@ -114,12 +114,12 @@
114
114
  "tinypool": "^0.3.0",
115
115
  "tinyspy": "^1.0.2",
116
116
  "vite": "^3.0.0 || ^4.0.0",
117
- "vite-node": "0.26.0"
117
+ "vite-node": "0.26.2"
118
118
  },
119
119
  "devDependencies": {
120
120
  "@antfu/install-pkg": "^0.1.1",
121
121
  "@edge-runtime/vm": "2.0.2",
122
- "@sinonjs/fake-timers": "^10.0.0",
122
+ "@sinonjs/fake-timers": "^10.0.2",
123
123
  "@types/diff": "^5.0.2",
124
124
  "@types/jsdom": "^20.0.1",
125
125
  "@types/micromatch": "^4.0.2",
@@ -155,7 +155,7 @@
155
155
  "strip-ansi": "^7.0.1",
156
156
  "typescript": "^4.9.4",
157
157
  "ws": "^8.11.0",
158
- "@vitest/ui": "0.26.0"
158
+ "@vitest/ui": "0.26.2"
159
159
  },
160
160
  "scripts": {
161
161
  "build": "rimraf dist && rollup -c",
@@ -1,25 +0,0 @@
1
- import { m as globalApis } from './chunk-utils-env.03f840f2.js';
2
- import { i as index } from './chunk-utils-import.ca62c9d7.js';
3
- import 'tty';
4
- import 'url';
5
- import 'path';
6
- import './chunk-runtime-chain.e655f6cc.js';
7
- import 'util';
8
- import 'chai';
9
- import './chunk-typecheck-constants.3f865d14.js';
10
- import 'local-pkg';
11
- import './vendor-_commonjsHelpers.addc3445.js';
12
- import './chunk-runtime-rpc.7959fc79.js';
13
- import './chunk-utils-timers.793fd179.js';
14
- import 'fs';
15
- import './chunk-utils-source-map.5bbb50cd.js';
16
- import './spy.js';
17
- import 'tinyspy';
18
-
19
- function registerApiGlobally() {
20
- globalApis.forEach((api) => {
21
- globalThis[api] = index[api];
22
- });
23
- }
24
-
25
- export { registerApiGlobally };