vitest 0.12.4 → 0.12.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 +72 -0
- package/dist/{chunk-api-setup.ed61899f.js → chunk-api-setup.62de6413.js} +4 -4
- package/dist/{chunk-constants.0567483c.js → chunk-constants.153353ee.js} +1 -1
- package/dist/{chunk-defaults.ecb46baf.js → chunk-defaults.374342ed.js} +1 -1
- package/dist/{chunk-install-pkg.73b84ae1.js → chunk-install-pkg.eb979c48.js} +11 -9
- package/dist/chunk-integrations-globals.4fea033a.js +25 -0
- package/dist/{chunk-runtime-chain.f8567c17.js → chunk-runtime-chain.eb563278.js} +7 -7
- package/dist/{chunk-runtime-mocker.acd615bd.js → chunk-runtime-mocker.efd6b7ac.js} +3 -3
- package/dist/{chunk-runtime-rpc.63398738.js → chunk-runtime-rpc.ef131645.js} +1 -1
- package/dist/{chunk-utils-global.a5a8641f.js → chunk-utils-global.03413604.js} +29 -9
- package/dist/{chunk-utils-timers.f25e8f44.js → chunk-utils-timers.a0f0fe66.js} +1 -1
- package/dist/{chunk-vite-node-externalize.cfbecaaf.js → chunk-vite-node-externalize.8560ca65.js} +20 -18
- package/dist/{chunk-vite-node-utils.1536f168.js → chunk-vite-node-utils.1064f66b.js} +1067 -3
- package/dist/cli.js +7 -8
- package/dist/entry.js +6 -10
- package/dist/index.js +4 -5
- package/dist/node.js +10 -11
- package/dist/{vendor-entry.d50b0f20.js → vendor-entry.5b810598.js} +21 -13
- package/dist/{vendor-index.40be925a.js → vendor-index.4e550a2c.js} +5 -5
- package/dist/worker.js +5 -5
- package/package.json +3 -3
- package/dist/chunk-integrations-globals.f3e83abb.js +0 -29
- package/dist/vendor-_commonjsHelpers.addc3445.js +0 -3
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { p as picocolors } from './chunk-utils-global.
|
|
3
|
-
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.
|
|
2
|
+
import { p as picocolors } from './chunk-utils-global.03413604.js';
|
|
3
|
+
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.8560ca65.js';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'local-pkg';
|
|
6
6
|
import 'path';
|
|
7
7
|
import 'buffer';
|
|
8
8
|
import 'child_process';
|
|
9
9
|
import 'process';
|
|
10
|
-
import './vendor-index.
|
|
11
|
-
import './vendor-_commonjsHelpers.addc3445.js';
|
|
10
|
+
import './vendor-index.4e550a2c.js';
|
|
12
11
|
import 'fs';
|
|
13
12
|
import 'assert';
|
|
14
13
|
import 'stream';
|
|
@@ -16,16 +15,16 @@ import 'util';
|
|
|
16
15
|
import 'url';
|
|
17
16
|
import 'os';
|
|
18
17
|
import 'vite';
|
|
19
|
-
import './chunk-constants.
|
|
18
|
+
import './chunk-constants.153353ee.js';
|
|
20
19
|
import 'readline';
|
|
21
|
-
import './chunk-vite-node-utils.
|
|
20
|
+
import './chunk-vite-node-utils.1064f66b.js';
|
|
22
21
|
import 'module';
|
|
23
22
|
import 'vm';
|
|
24
|
-
import './chunk-defaults.
|
|
23
|
+
import './chunk-defaults.374342ed.js';
|
|
25
24
|
import 'worker_threads';
|
|
26
25
|
import 'tinypool';
|
|
27
26
|
import 'perf_hooks';
|
|
28
|
-
import './chunk-utils-timers.
|
|
27
|
+
import './chunk-utils-timers.a0f0fe66.js';
|
|
29
28
|
import './chunk-magic-string.d5e0e473.js';
|
|
30
29
|
import './vendor-index.405e58ef.js';
|
|
31
30
|
|
package/dist/entry.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
export { r as run } from './vendor-entry.
|
|
1
|
+
export { r as run } from './vendor-entry.5b810598.js';
|
|
2
2
|
import 'fs';
|
|
3
|
-
import './chunk-utils-global.
|
|
3
|
+
import './chunk-utils-global.03413604.js';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'local-pkg';
|
|
6
6
|
import 'path';
|
|
7
|
-
import '
|
|
8
|
-
import 'stream';
|
|
9
|
-
import './chunk-runtime-chain.f8567c17.js';
|
|
7
|
+
import './chunk-runtime-chain.eb563278.js';
|
|
10
8
|
import 'chai';
|
|
11
|
-
import './
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-utils-timers.f25e8f44.js';
|
|
9
|
+
import './chunk-runtime-rpc.ef131645.js';
|
|
10
|
+
import './chunk-utils-timers.a0f0fe66.js';
|
|
14
11
|
import './chunk-integrations-spy.bee66426.js';
|
|
15
12
|
import 'tinyspy';
|
|
16
13
|
import 'util';
|
|
17
|
-
import './chunk-defaults.
|
|
14
|
+
import './chunk-defaults.374342ed.js';
|
|
18
15
|
import 'module';
|
|
19
16
|
import 'url';
|
|
20
|
-
import 'crypto';
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
export { c as afterAll, f as afterEach, b as beforeAll, e as beforeEach, g as createExpect, d as describe, h as expect, k as getRunningMode, a as isFirstRun, l as isWatchMode, i as it, r as runOnce, s as suite, t as test, j as vi, v as vitest, w as withCallback } from './chunk-runtime-chain.
|
|
1
|
+
export { c as afterAll, f as afterEach, b as beforeAll, e as beforeEach, g as createExpect, d as describe, h as expect, k as getRunningMode, a as isFirstRun, l as isWatchMode, i as it, r as runOnce, s as suite, t as test, j as vi, v as vitest, w as withCallback } from './chunk-runtime-chain.eb563278.js';
|
|
2
2
|
export { assert, default as chai, should } from 'chai';
|
|
3
|
-
import './
|
|
4
|
-
import './chunk-runtime-rpc.63398738.js';
|
|
5
|
-
import './chunk-utils-global.a5a8641f.js';
|
|
3
|
+
import './chunk-utils-global.03413604.js';
|
|
6
4
|
import 'tty';
|
|
7
5
|
import 'local-pkg';
|
|
8
6
|
import 'path';
|
|
7
|
+
import './chunk-runtime-rpc.ef131645.js';
|
|
9
8
|
import 'fs';
|
|
10
|
-
import './chunk-utils-timers.
|
|
9
|
+
import './chunk-utils-timers.a0f0fe66.js';
|
|
11
10
|
import './chunk-integrations-spy.bee66426.js';
|
|
12
11
|
import 'tinyspy';
|
|
13
12
|
import 'util';
|
package/dist/node.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
export { V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.
|
|
2
|
-
export { V as VitestRunner } from './chunk-runtime-mocker.
|
|
1
|
+
export { V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.8560ca65.js';
|
|
2
|
+
export { V as VitestRunner } from './chunk-runtime-mocker.efd6b7ac.js';
|
|
3
3
|
import 'buffer';
|
|
4
4
|
import 'path';
|
|
5
5
|
import 'child_process';
|
|
6
6
|
import 'process';
|
|
7
|
-
import './vendor-index.
|
|
8
|
-
import './
|
|
7
|
+
import './vendor-index.4e550a2c.js';
|
|
8
|
+
import './chunk-utils-global.03413604.js';
|
|
9
|
+
import 'tty';
|
|
10
|
+
import 'local-pkg';
|
|
9
11
|
import 'fs';
|
|
10
12
|
import 'assert';
|
|
11
13
|
import 'events';
|
|
@@ -13,19 +15,16 @@ import 'stream';
|
|
|
13
15
|
import 'util';
|
|
14
16
|
import 'url';
|
|
15
17
|
import 'os';
|
|
16
|
-
import './chunk-utils-global.a5a8641f.js';
|
|
17
|
-
import 'tty';
|
|
18
|
-
import 'local-pkg';
|
|
19
18
|
import 'vite';
|
|
20
|
-
import './chunk-constants.
|
|
19
|
+
import './chunk-constants.153353ee.js';
|
|
21
20
|
import 'readline';
|
|
22
|
-
import './chunk-vite-node-utils.
|
|
21
|
+
import './chunk-vite-node-utils.1064f66b.js';
|
|
23
22
|
import 'module';
|
|
24
23
|
import 'vm';
|
|
25
|
-
import './chunk-defaults.
|
|
24
|
+
import './chunk-defaults.374342ed.js';
|
|
26
25
|
import 'worker_threads';
|
|
27
26
|
import 'tinypool';
|
|
28
27
|
import 'perf_hooks';
|
|
29
|
-
import './chunk-utils-timers.
|
|
28
|
+
import './chunk-utils-timers.a0f0fe66.js';
|
|
30
29
|
import './chunk-magic-string.d5e0e473.js';
|
|
31
30
|
import './vendor-index.405e58ef.js';
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import { a as getWorkerState, t as toArray,
|
|
3
|
-
import { Console } from 'console';
|
|
4
|
-
import { Writable } from 'stream';
|
|
2
|
+
import { I as isNode, a as getWorkerState, t as toArray, J as clone, G as getType, m as relative, K as partitionSuiteChildren, L as hasTests, u as hasFailed, q as getFullName, r as resetModules } from './chunk-utils-global.03413604.js';
|
|
5
3
|
import { importModule } from 'local-pkg';
|
|
6
|
-
import { s as suite, t as test, d as describe, i as it, r as runOnce, a as isFirstRun, b as beforeAll, c as afterAll, e as beforeEach, f as afterEach, w as withCallback, g as createExpect, h as expect, v as vitest, j as vi, k as getRunningMode, l as isWatchMode, m as resetRunOnceCounter, R as RealDate, n as clearCollectorContext, o as defaultSuite, p as setHooks, q as getHooks, u as collectorContext, x as getSnapshotClient, y as setState, z as getFn, A as getState } from './chunk-runtime-chain.
|
|
4
|
+
import { s as suite, t as test, d as describe, i as it, r as runOnce, a as isFirstRun, b as beforeAll, c as afterAll, e as beforeEach, f as afterEach, w as withCallback, g as createExpect, h as expect, v as vitest, j as vi, k as getRunningMode, l as isWatchMode, m as resetRunOnceCounter, R as RealDate, n as clearCollectorContext, o as defaultSuite, p as setHooks, q as getHooks, u as collectorContext, x as getSnapshotClient, y as setState, z as getFn, A as getState } from './chunk-runtime-chain.eb563278.js';
|
|
7
5
|
import chai, { assert, should, util } from 'chai';
|
|
8
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
9
|
-
import { d as clearTimeout, c as setTimeout, s as stringify } from './chunk-utils-timers.
|
|
10
|
-
import { t as takeCoverage } from './chunk-defaults.
|
|
11
|
-
import { createHash } from 'crypto';
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.ef131645.js';
|
|
7
|
+
import { d as clearTimeout, c as setTimeout, s as stringify } from './chunk-utils-timers.a0f0fe66.js';
|
|
8
|
+
import { t as takeCoverage } from './chunk-defaults.374342ed.js';
|
|
12
9
|
import { format } from 'util';
|
|
13
10
|
|
|
14
11
|
var index = /*#__PURE__*/Object.freeze({
|
|
@@ -493,19 +490,22 @@ async function setupGlobalEnv(config) {
|
|
|
493
490
|
if (globalSetup)
|
|
494
491
|
return;
|
|
495
492
|
globalSetup = true;
|
|
496
|
-
|
|
493
|
+
if (isNode)
|
|
494
|
+
await setupConsoleLogSpy();
|
|
497
495
|
if (config.globals)
|
|
498
|
-
(await import('./chunk-integrations-globals.
|
|
496
|
+
(await import('./chunk-integrations-globals.4fea033a.js')).registerApiGlobally();
|
|
499
497
|
}
|
|
500
498
|
function setupDefines(defines) {
|
|
501
499
|
for (const key in defines)
|
|
502
500
|
globalThis[key] = defines[key];
|
|
503
501
|
}
|
|
504
|
-
function setupConsoleLogSpy() {
|
|
502
|
+
async function setupConsoleLogSpy() {
|
|
505
503
|
const stdoutBuffer = /* @__PURE__ */ new Map();
|
|
506
504
|
const stderrBuffer = /* @__PURE__ */ new Map();
|
|
507
505
|
const timers = /* @__PURE__ */ new Map();
|
|
508
506
|
const unknownTestId = "__vitest__unknown_test__";
|
|
507
|
+
const { Writable } = await import('stream');
|
|
508
|
+
const { Console } = await import('console');
|
|
509
509
|
function schedule(taskId) {
|
|
510
510
|
const timer = timers.get(taskId);
|
|
511
511
|
const { stdoutTime, stderrTime } = timer;
|
|
@@ -722,8 +722,16 @@ function replaceAsymmetricMatcher(actual, expected) {
|
|
|
722
722
|
}
|
|
723
723
|
|
|
724
724
|
const now$1 = Date.now;
|
|
725
|
-
function hash(str
|
|
726
|
-
|
|
725
|
+
function hash(str) {
|
|
726
|
+
let hash2 = 0;
|
|
727
|
+
if (str.length === 0)
|
|
728
|
+
return `${hash2}`;
|
|
729
|
+
for (let i = 0; i < str.length; i++) {
|
|
730
|
+
const char = str.charCodeAt(i);
|
|
731
|
+
hash2 = (hash2 << 5) - hash2 + char;
|
|
732
|
+
hash2 = hash2 & hash2;
|
|
733
|
+
}
|
|
734
|
+
return `${hash2}`;
|
|
727
735
|
}
|
|
728
736
|
async function collectTests(paths, config) {
|
|
729
737
|
const files = [];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import childProcess from 'child_process';
|
|
2
2
|
import path$3 from 'path';
|
|
3
|
-
import { c as commonjsGlobal } from './
|
|
3
|
+
import { c as commonjsGlobal } from './chunk-utils-global.03413604.js';
|
|
4
4
|
import fs$1 from 'fs';
|
|
5
5
|
import assert$1 from 'assert';
|
|
6
6
|
import require$$2 from 'events';
|
|
7
|
-
import require$$0$
|
|
7
|
+
import require$$0$1 from 'buffer';
|
|
8
8
|
import require$$0 from 'stream';
|
|
9
|
-
import require$$
|
|
9
|
+
import require$$1 from 'util';
|
|
10
10
|
|
|
11
11
|
var crossSpawn = {exports: {}};
|
|
12
12
|
|
|
@@ -961,9 +961,9 @@ var bufferStream$1 = options => {
|
|
|
961
961
|
return stream;
|
|
962
962
|
};
|
|
963
963
|
|
|
964
|
-
const {constants: BufferConstants} = require$$0$
|
|
964
|
+
const {constants: BufferConstants} = require$$0$1;
|
|
965
965
|
const stream = require$$0;
|
|
966
|
-
const {promisify} = require$$
|
|
966
|
+
const {promisify} = require$$1;
|
|
967
967
|
const bufferStream = bufferStream$1;
|
|
968
968
|
|
|
969
969
|
const streamPipelinePromisified = promisify(stream.pipeline);
|
package/dist/worker.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { d as distDir } from './chunk-constants.
|
|
4
|
-
import { e as executeInViteNode } from './chunk-runtime-mocker.
|
|
5
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
1
|
+
import { k as resolve, a as getWorkerState } from './chunk-utils-global.03413604.js';
|
|
2
|
+
import { b as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-utils.1064f66b.js';
|
|
3
|
+
import { d as distDir } from './chunk-constants.153353ee.js';
|
|
4
|
+
import { e as executeInViteNode } from './chunk-runtime-mocker.efd6b7ac.js';
|
|
5
|
+
import { r as rpc } from './chunk-runtime-rpc.ef131645.js';
|
|
6
6
|
import 'tty';
|
|
7
7
|
import 'local-pkg';
|
|
8
8
|
import 'path';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.5",
|
|
5
5
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vite",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@types/node": "^17.0.31",
|
|
94
94
|
"@types/prompts": "^2.4.0",
|
|
95
95
|
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
96
|
-
"@vitest/ui": "0.12.
|
|
96
|
+
"@vitest/ui": "0.12.5",
|
|
97
97
|
"birpc": "^0.2.2",
|
|
98
98
|
"c8": "^7.11.2",
|
|
99
99
|
"cac": "^6.7.12",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"source-map-js": "^1.0.2",
|
|
121
121
|
"strip-ansi": "^7.0.1",
|
|
122
122
|
"typescript": "^4.6.4",
|
|
123
|
-
"vite-node": "0.12.
|
|
123
|
+
"vite-node": "0.12.5",
|
|
124
124
|
"ws": "^8.6.0"
|
|
125
125
|
},
|
|
126
126
|
"engines": {
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { g as globalApis } from './chunk-constants.0567483c.js';
|
|
2
|
-
import { i as index } from './vendor-entry.d50b0f20.js';
|
|
3
|
-
import 'url';
|
|
4
|
-
import './chunk-utils-global.a5a8641f.js';
|
|
5
|
-
import 'tty';
|
|
6
|
-
import 'local-pkg';
|
|
7
|
-
import 'path';
|
|
8
|
-
import 'fs';
|
|
9
|
-
import 'console';
|
|
10
|
-
import 'stream';
|
|
11
|
-
import './chunk-runtime-chain.f8567c17.js';
|
|
12
|
-
import 'chai';
|
|
13
|
-
import './vendor-_commonjsHelpers.addc3445.js';
|
|
14
|
-
import './chunk-runtime-rpc.63398738.js';
|
|
15
|
-
import './chunk-utils-timers.f25e8f44.js';
|
|
16
|
-
import './chunk-integrations-spy.bee66426.js';
|
|
17
|
-
import 'tinyspy';
|
|
18
|
-
import 'util';
|
|
19
|
-
import './chunk-defaults.ecb46baf.js';
|
|
20
|
-
import 'module';
|
|
21
|
-
import 'crypto';
|
|
22
|
-
|
|
23
|
-
function registerApiGlobally() {
|
|
24
|
-
globalApis.forEach((api) => {
|
|
25
|
-
globalThis[api] = index[api];
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { registerApiGlobally };
|