vitest 1.0.0-beta.4 → 1.0.0-beta.5
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/LICENSE.md +1 -513
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +4 -4
- package/dist/child.js +13 -17
- package/dist/{chunk-api-setup.6d19ab38.js → chunks/api-setup.jHV5vgr2.js} +97 -39
- package/dist/chunks/install-pkg.ORGzQeqb.js +457 -0
- package/dist/chunks/integrations-globals.-pds_Gug.js +29 -0
- package/dist/{chunk-node-git.6c12e560.js → chunks/node-git.Hw101KjS.js} +1 -18
- package/dist/{chunk-runtime-console.f3263f87.js → chunks/runtime-console.iCAG0Yz3.js} +1 -1
- package/dist/cli-wrapper.js +2 -18
- package/dist/cli.js +18 -23
- package/dist/config.cjs +1 -1
- package/dist/config.d.ts +4 -6
- package/dist/config.js +1 -1
- package/dist/coverage.d.ts +25 -15
- package/dist/coverage.js +118 -49
- package/dist/entry-vm.js +13 -13
- package/dist/entry.js +14 -14
- package/dist/environments.d.ts +1 -1
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/execute.js +3 -3
- package/dist/index.d.ts +166 -38
- package/dist/index.js +10 -10
- package/dist/node.d.ts +5 -5
- package/dist/node.js +17 -22
- package/dist/{vendor-paths.84fc7a99.js → paths.js} +1 -1
- package/dist/{reporters-50c2bd49.d.ts → reporters-ANEBTnOh.d.ts} +324 -361
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +7 -8
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +8 -8
- package/dist/{suite-ad69b7cd.d.ts → suite-C1OmA61l.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/suite.js +3 -3
- package/dist/{vendor-benchmark.b6befc50.js → vendor/benchmark.WVm6DARl.js} +1 -1
- package/dist/{vendor-execute.157302d6.js → vendor/execute.aMjV5C9u.js} +2 -4
- package/dist/{vendor-index.72df742e.js → vendor/index.Npc-eff0.js} +4 -4
- package/dist/{vendor-index.2b92937b.js → vendor/index.XU72Rmy8.js} +1 -1
- package/dist/{vendor-index.57925a34.js → vendor/index.h0j9y5vy.js} +5 -5
- package/dist/vendor/index.xL8XjTLv.js +3962 -0
- package/dist/vendor/loader.CU0NY2Is.js +39 -0
- package/dist/{vendor-node.65461b16.js → vendor/node.c-kzGvOB.js} +1874 -5960
- package/dist/{vendor-reporters.d24d80a4.js → vendor/reporters.1xKxm8im.js} +424 -374
- package/dist/{vendor-rpc.171f65fb.js → vendor/rpc.Bl-ysZIr.js} +1 -1
- package/dist/{vendor-run-once.fb836747.js → vendor/run-once.X3E7xx3F.js} +1 -1
- package/dist/{vendor-vi.3baa7c4a.js → vendor/vi.voNYQWB_.js} +4 -4
- package/dist/vm.js +13 -18
- package/dist/worker.js +13 -18
- package/index.cjs +5 -0
- package/package.json +49 -53
- package/dist/chunk-install-pkg.e1d6323e.js +0 -1740
- package/dist/chunk-integrations-globals.2b099e04.js +0 -29
- package/dist/vendor-index.8efe7746.js +0 -2236
- package/dist/vendor-loader.9c966f23.js +0 -2089
- /package/dist/{vendor-_commonjsHelpers.7d1333e8.js → vendor/_commonjsHelpers.jjO7Zipk.js} +0 -0
- /package/dist/{vendor-base.9c08bbd0.js → vendor/base._79unx2z.js} +0 -0
- /package/dist/{vendor-constants.538d9b49.js → vendor/constants.WSvnD_fn.js} +0 -0
- /package/dist/{vendor-coverage.78040316.js → vendor/coverage.v6aD8iAh.js} +0 -0
- /package/dist/{vendor-date.6e993429.js → vendor/date.W90-E5kF.js} +0 -0
- /package/dist/{vendor-environments.dcc4a34e.js → vendor/environments.hpEVJZPC.js} +0 -0
- /package/dist/{vendor-global.c3664e75.js → vendor/global.L7JRz1qU.js} +0 -0
- /package/dist/{vendor-index.1ca68bd5.js → vendor/index.cAUulNDf.js} +0 -0
- /package/dist/{vendor-inspector.209edf5a.js → vendor/inspector.lFAeuaAt.js} +0 -0
- /package/dist/{vendor-tasks.f9d75aed.js → vendor/tasks.IknbGB2n.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as chai$1 from 'chai';
|
|
2
|
-
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './
|
|
2
|
+
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers.jjO7Zipk.js';
|
|
3
3
|
import { equals, iterableEquality, subsetEquality, JestExtend, JestChaiExpect, JestAsymmetricMatchers, GLOBAL_EXPECT as GLOBAL_EXPECT$1, ASYMMETRIC_MATCHERS_OBJECT as ASYMMETRIC_MATCHERS_OBJECT$1, getState, setState } from '@vitest/expect';
|
|
4
4
|
import { stripSnapshotIndentation, addSerializer, SnapshotClient } from '@vitest/snapshot';
|
|
5
5
|
import { getNames } from '@vitest/runner/utils';
|
|
6
6
|
import '@vitest/utils/error';
|
|
7
7
|
import { getCurrentTest } from '@vitest/runner';
|
|
8
|
-
import { g as getFullName } from './
|
|
9
|
-
import { g as getWorkerState, a as getCurrentEnvironment } from './
|
|
8
|
+
import { g as getFullName } from './tasks.IknbGB2n.js';
|
|
9
|
+
import { g as getWorkerState, a as getCurrentEnvironment } from './global.L7JRz1qU.js';
|
|
10
10
|
import { getSafeTimers, assertTypes, createSimpleStackTrace } from '@vitest/utils';
|
|
11
11
|
import { parseSingleStack } from '@vitest/utils/source-map';
|
|
12
|
-
import { R as RealDate, r as resetDate, m as mockDate } from './
|
|
12
|
+
import { R as RealDate, r as resetDate, m as mockDate } from './date.W90-E5kF.js';
|
|
13
13
|
import { spyOn, fn, isMockFunction, mocks } from '@vitest/spy';
|
|
14
14
|
|
|
15
15
|
function resetModules(modules, resetMocks = false) {
|
package/dist/vm.js
CHANGED
|
@@ -3,33 +3,28 @@ import { performance } from 'node:perf_hooks';
|
|
|
3
3
|
import { isContext } from 'node:vm';
|
|
4
4
|
import { ModuleCacheMap } from 'vite-node/client';
|
|
5
5
|
import { workerId } from 'tinypool';
|
|
6
|
-
import { c as createBirpc } from './vendor
|
|
6
|
+
import { c as createBirpc } from './vendor/index.cAUulNDf.js';
|
|
7
7
|
import { resolve } from 'pathe';
|
|
8
8
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
9
|
-
import {
|
|
10
|
-
import { l as loadEnvironment } from './vendor
|
|
11
|
-
import { b as startVitestExecutor } from './vendor
|
|
12
|
-
import { createCustomConsole } from './
|
|
13
|
-
import { c as createSafeRpc } from './vendor
|
|
14
|
-
import '
|
|
15
|
-
import 'node:module';
|
|
16
|
-
import 'node:fs';
|
|
17
|
-
import 'node:assert';
|
|
18
|
-
import 'node:process';
|
|
19
|
-
import 'node:path';
|
|
20
|
-
import 'node:v8';
|
|
21
|
-
import 'node:util';
|
|
22
|
-
import './vendor-environments.dcc4a34e.js';
|
|
9
|
+
import { distDir } from './paths.js';
|
|
10
|
+
import { l as loadEnvironment } from './vendor/loader.CU0NY2Is.js';
|
|
11
|
+
import { b as startVitestExecutor } from './vendor/execute.aMjV5C9u.js';
|
|
12
|
+
import { createCustomConsole } from './chunks/runtime-console.iCAG0Yz3.js';
|
|
13
|
+
import { c as createSafeRpc } from './vendor/rpc.Bl-ysZIr.js';
|
|
14
|
+
import './vendor/environments.hpEVJZPC.js';
|
|
23
15
|
import 'node:console';
|
|
24
16
|
import 'local-pkg';
|
|
25
17
|
import 'vite-node/utils';
|
|
26
18
|
import '@vitest/utils/error';
|
|
19
|
+
import 'node:fs';
|
|
27
20
|
import '@vitest/utils';
|
|
28
|
-
import './vendor
|
|
21
|
+
import './vendor/base._79unx2z.js';
|
|
22
|
+
import 'node:path';
|
|
23
|
+
import 'node:module';
|
|
29
24
|
import 'vite-node/constants';
|
|
30
25
|
import 'node:stream';
|
|
31
|
-
import './vendor
|
|
32
|
-
import './vendor
|
|
26
|
+
import './vendor/date.W90-E5kF.js';
|
|
27
|
+
import './vendor/global.L7JRz1qU.js';
|
|
33
28
|
|
|
34
29
|
const entryFile = pathToFileURL(resolve(distDir, "entry-vm.js")).href;
|
|
35
30
|
async function run(ctx) {
|
package/dist/worker.js
CHANGED
|
@@ -1,31 +1,26 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
|
-
import { c as createBirpc } from './vendor
|
|
2
|
+
import { c as createBirpc } from './vendor/index.cAUulNDf.js';
|
|
3
3
|
import { workerId } from 'tinypool';
|
|
4
|
-
import { g as getWorkerState } from './vendor
|
|
5
|
-
import { l as loadEnvironment } from './vendor
|
|
6
|
-
import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor
|
|
7
|
-
import { s as setupInspect } from './vendor
|
|
8
|
-
import { r as rpcDone, c as createSafeRpc } from './vendor
|
|
4
|
+
import { g as getWorkerState } from './vendor/global.L7JRz1qU.js';
|
|
5
|
+
import { l as loadEnvironment } from './vendor/loader.CU0NY2Is.js';
|
|
6
|
+
import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor/execute.aMjV5C9u.js';
|
|
7
|
+
import { s as setupInspect } from './vendor/inspector.lFAeuaAt.js';
|
|
8
|
+
import { r as rpcDone, c as createSafeRpc } from './vendor/rpc.Bl-ysZIr.js';
|
|
9
9
|
import 'pathe';
|
|
10
|
-
import 'acorn';
|
|
11
|
-
import 'node:module';
|
|
12
|
-
import 'node:fs';
|
|
13
|
-
import 'node:url';
|
|
14
|
-
import 'node:assert';
|
|
15
|
-
import 'node:process';
|
|
16
|
-
import 'node:path';
|
|
17
|
-
import 'node:v8';
|
|
18
|
-
import 'node:util';
|
|
19
10
|
import 'vite-node/client';
|
|
20
|
-
import './vendor
|
|
11
|
+
import './vendor/environments.hpEVJZPC.js';
|
|
21
12
|
import 'node:console';
|
|
22
13
|
import 'local-pkg';
|
|
14
|
+
import 'node:url';
|
|
23
15
|
import 'node:vm';
|
|
24
16
|
import 'vite-node/utils';
|
|
25
17
|
import '@vitest/utils/error';
|
|
26
|
-
import './
|
|
18
|
+
import './paths.js';
|
|
19
|
+
import 'node:fs';
|
|
27
20
|
import '@vitest/utils';
|
|
28
|
-
import './vendor
|
|
21
|
+
import './vendor/base._79unx2z.js';
|
|
22
|
+
import 'node:path';
|
|
23
|
+
import 'node:module';
|
|
29
24
|
import 'vite-node/constants';
|
|
30
25
|
|
|
31
26
|
async function init(ctx) {
|
package/index.cjs
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
throw new Error(
|
|
2
|
+
'Vitest cannot be imported in a CommonJS module using require(). Please use "import" instead.'
|
|
3
|
+
+ '\n\nIf you are using "import" in your source code, then it\'s possible it was bundled into require() automatically by your bundler. '
|
|
4
|
+
+ 'In that case, do not bundle CommonJS output since it will never work with Vitest, or use dynamic import() which is available in all CommonJS modules.',
|
|
5
|
+
)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.5",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
|
-
"require": {
|
|
29
|
-
"types": "./index.d.cts",
|
|
30
|
-
"default": "./index.cjs"
|
|
31
|
-
},
|
|
32
28
|
"import": {
|
|
33
29
|
"types": "./dist/index.d.ts",
|
|
34
30
|
"default": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./index.d.cts",
|
|
34
|
+
"default": "./index.cjs"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"./*": "./*",
|
|
@@ -43,44 +43,44 @@
|
|
|
43
43
|
},
|
|
44
44
|
"./node": {
|
|
45
45
|
"types": "./dist/node.d.ts",
|
|
46
|
-
"
|
|
46
|
+
"default": "./dist/node.js"
|
|
47
47
|
},
|
|
48
48
|
"./execute": {
|
|
49
49
|
"types": "./dist/execute.d.ts",
|
|
50
|
-
"
|
|
50
|
+
"default": "./dist/execute.js"
|
|
51
51
|
},
|
|
52
52
|
"./browser": {
|
|
53
53
|
"types": "./dist/browser.d.ts",
|
|
54
|
-
"
|
|
54
|
+
"default": "./dist/browser.js"
|
|
55
55
|
},
|
|
56
56
|
"./runners": {
|
|
57
57
|
"types": "./dist/runners.d.ts",
|
|
58
|
-
"
|
|
58
|
+
"default": "./dist/runners.js"
|
|
59
59
|
},
|
|
60
60
|
"./suite": {
|
|
61
61
|
"types": "./dist/suite.d.ts",
|
|
62
|
-
"
|
|
62
|
+
"default": "./dist/suite.js"
|
|
63
63
|
},
|
|
64
64
|
"./environments": {
|
|
65
65
|
"types": "./dist/environments.d.ts",
|
|
66
|
-
"
|
|
66
|
+
"default": "./dist/environments.js"
|
|
67
67
|
},
|
|
68
68
|
"./utils": {
|
|
69
69
|
"types": "./dist/utils.d.ts",
|
|
70
|
-
"
|
|
70
|
+
"default": "./dist/utils.js"
|
|
71
71
|
},
|
|
72
72
|
"./config": {
|
|
73
73
|
"types": "./config.d.ts",
|
|
74
74
|
"require": "./dist/config.cjs",
|
|
75
|
-
"
|
|
75
|
+
"default": "./dist/config.js"
|
|
76
76
|
},
|
|
77
77
|
"./coverage": {
|
|
78
78
|
"types": "./coverage.d.ts",
|
|
79
|
-
"
|
|
79
|
+
"default": "./dist/coverage.js"
|
|
80
80
|
},
|
|
81
81
|
"./reporters": {
|
|
82
82
|
"types": "./dist/reporters.d.ts",
|
|
83
|
-
"
|
|
83
|
+
"default": "./dist/reporters.js"
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"main": "./dist/index.js",
|
|
@@ -90,12 +90,12 @@
|
|
|
90
90
|
"vitest": "./vitest.mjs"
|
|
91
91
|
},
|
|
92
92
|
"files": [
|
|
93
|
-
"
|
|
94
|
-
"bin",
|
|
95
|
-
"*.d.ts",
|
|
93
|
+
"*.cjs",
|
|
96
94
|
"*.d.cts",
|
|
95
|
+
"*.d.ts",
|
|
97
96
|
"*.mjs",
|
|
98
|
-
"
|
|
97
|
+
"bin",
|
|
98
|
+
"dist"
|
|
99
99
|
],
|
|
100
100
|
"engines": {
|
|
101
101
|
"node": "^18.0.0 || >=20.0.0"
|
|
@@ -129,61 +129,57 @@
|
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
131
|
"dependencies": {
|
|
132
|
-
"acorn": "^8.
|
|
133
|
-
"acorn-walk": "^8.2.0",
|
|
132
|
+
"acorn-walk": "^8.3.0",
|
|
134
133
|
"cac": "^6.7.14",
|
|
135
134
|
"chai": "^4.3.10",
|
|
136
135
|
"debug": "^4.3.4",
|
|
137
|
-
"
|
|
136
|
+
"execa": "^8.0.1",
|
|
137
|
+
"local-pkg": "^0.5.0",
|
|
138
138
|
"magic-string": "^0.30.5",
|
|
139
139
|
"pathe": "^1.1.1",
|
|
140
140
|
"picocolors": "^1.0.0",
|
|
141
|
-
"std-env": "^3.
|
|
142
|
-
"strip-literal": "^1.0
|
|
143
|
-
"tinybench": "^2.5.
|
|
141
|
+
"std-env": "^3.4.3",
|
|
142
|
+
"strip-literal": "^1.3.0",
|
|
143
|
+
"tinybench": "^2.5.1",
|
|
144
144
|
"tinypool": "^0.8.1",
|
|
145
|
-
"vite": "^
|
|
145
|
+
"vite": "^5.0.0-beta.19 || ^5.0.0",
|
|
146
146
|
"why-is-node-running": "^2.2.2",
|
|
147
|
-
"@vitest/
|
|
148
|
-
"@vitest/
|
|
149
|
-
"@vitest/runner": "1.0.0-beta.
|
|
150
|
-
"@vitest/
|
|
151
|
-
"@vitest/
|
|
152
|
-
"vite-node": "1.0.0-beta.
|
|
147
|
+
"@vitest/expect": "1.0.0-beta.5",
|
|
148
|
+
"@vitest/snapshot": "1.0.0-beta.5",
|
|
149
|
+
"@vitest/runner": "1.0.0-beta.5",
|
|
150
|
+
"@vitest/utils": "1.0.0-beta.5",
|
|
151
|
+
"@vitest/spy": "1.0.0-beta.5",
|
|
152
|
+
"vite-node": "1.0.0-beta.5"
|
|
153
153
|
},
|
|
154
154
|
"devDependencies": {
|
|
155
155
|
"@ampproject/remapping": "^2.2.1",
|
|
156
156
|
"@antfu/install-pkg": "^0.1.1",
|
|
157
|
-
"@edge-runtime/vm": "3.
|
|
157
|
+
"@edge-runtime/vm": "^3.1.7",
|
|
158
158
|
"@sinonjs/fake-timers": "11.1.0",
|
|
159
|
-
"@types/
|
|
160
|
-
"@types/
|
|
161
|
-
"@types/istanbul-
|
|
162
|
-
"@types/
|
|
163
|
-
"@types/
|
|
164
|
-
"@types/
|
|
165
|
-
"@types/
|
|
166
|
-
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
159
|
+
"@types/estree": "^1.0.5",
|
|
160
|
+
"@types/istanbul-lib-coverage": "^2.0.6",
|
|
161
|
+
"@types/istanbul-reports": "^3.0.4",
|
|
162
|
+
"@types/jsdom": "^21.1.5",
|
|
163
|
+
"@types/micromatch": "^4.0.5",
|
|
164
|
+
"@types/prompts": "^2.4.8",
|
|
165
|
+
"@types/sinonjs__fake-timers": "^8.1.5",
|
|
167
166
|
"birpc": "0.2.14",
|
|
168
167
|
"chai-subset": "^1.6.0",
|
|
169
|
-
"cli-truncate": "^
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"fast-glob": "^3.3.0",
|
|
168
|
+
"cli-truncate": "^4.0.0",
|
|
169
|
+
"expect-type": "^0.17.3",
|
|
170
|
+
"fast-glob": "^3.3.2",
|
|
173
171
|
"find-up": "^6.3.0",
|
|
174
|
-
"flatted": "^3.2.
|
|
175
|
-
"get-tsconfig": "^4.
|
|
176
|
-
"happy-dom": "^
|
|
172
|
+
"flatted": "^3.2.9",
|
|
173
|
+
"get-tsconfig": "^4.7.2",
|
|
174
|
+
"happy-dom": "^12.10.3",
|
|
177
175
|
"jsdom": "^22.1.0",
|
|
178
176
|
"log-update": "^6.0.0",
|
|
179
177
|
"micromatch": "^4.0.5",
|
|
180
|
-
"
|
|
181
|
-
"
|
|
182
|
-
"pkg-types": "^1.0.3",
|
|
183
|
-
"pretty-format": "^29.5.0",
|
|
178
|
+
"p-limit": "^5.0.0",
|
|
179
|
+
"pretty-format": "^29.7.0",
|
|
184
180
|
"prompts": "^2.4.2",
|
|
185
181
|
"strip-ansi": "^7.1.0",
|
|
186
|
-
"ws": "^8.
|
|
182
|
+
"ws": "^8.14.2"
|
|
187
183
|
},
|
|
188
184
|
"scripts": {
|
|
189
185
|
"build": "rimraf dist && rollup -c",
|