vitest 0.19.0 → 0.19.1
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/dist/browser.mjs +4 -4
- package/dist/{chunk-defaults.408a0cfe.mjs → chunk-defaults.ed196a9a.mjs} +4 -3
- package/dist/{chunk-integrations-globals.803277be.mjs → chunk-integrations-globals.1018e651.mjs} +2 -2
- package/dist/{chunk-runtime-chain.1e1aabb3.mjs → chunk-runtime-chain.f2e00f4c.mjs} +15 -1
- package/dist/{chunk-runtime-error.d82dd2cf.mjs → chunk-runtime-error.606e0393.mjs} +8 -8
- package/dist/{chunk-runtime-hooks.db398170.mjs → chunk-runtime-hooks.d4cadf47.mjs} +1 -1
- package/dist/{chunk-vite-node-externalize.a2813ad7.mjs → chunk-vite-node-externalize.e9af6472.mjs} +3 -3
- package/dist/cli.mjs +2 -2
- package/dist/entry.mjs +4 -4
- package/dist/index.mjs +2 -2
- package/dist/node.mjs +2 -2
- package/dist/suite.mjs +1 -1
- package/package.json +3 -3
package/dist/browser.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { c as createExpect, d as describe, b as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.
|
|
2
|
-
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './chunk-runtime-hooks.
|
|
3
|
-
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-error.
|
|
1
|
+
export { c as createExpect, d as describe, b as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.f2e00f4c.mjs';
|
|
2
|
+
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './chunk-runtime-hooks.d4cadf47.mjs';
|
|
3
|
+
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-error.606e0393.mjs';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
|
@@ -15,6 +15,6 @@ import 'fs';
|
|
|
15
15
|
import './chunk-utils-source-map.8b066ce2.mjs';
|
|
16
16
|
import './spy.mjs';
|
|
17
17
|
import 'tinyspy';
|
|
18
|
-
import './chunk-defaults.
|
|
18
|
+
import './chunk-defaults.ed196a9a.mjs';
|
|
19
19
|
import 'module';
|
|
20
20
|
import 'url';
|
|
@@ -2,6 +2,7 @@ import { existsSync, promises } from 'fs';
|
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import _url from 'url';
|
|
4
4
|
import { u as toArray, C as resolve } from './chunk-utils-global.2aa95025.mjs';
|
|
5
|
+
import { importModule } from 'local-pkg';
|
|
5
6
|
|
|
6
7
|
/*
|
|
7
8
|
How it works:
|
|
@@ -588,7 +589,7 @@ var jsdom = {
|
|
|
588
589
|
JSDOM,
|
|
589
590
|
ResourceLoader,
|
|
590
591
|
VirtualConsole
|
|
591
|
-
} = await
|
|
592
|
+
} = await importModule("jsdom");
|
|
592
593
|
const {
|
|
593
594
|
html = "<!DOCTYPE html>",
|
|
594
595
|
userAgent,
|
|
@@ -627,7 +628,7 @@ var jsdom = {
|
|
|
627
628
|
var happy = {
|
|
628
629
|
name: "happy-dom",
|
|
629
630
|
async setup(global) {
|
|
630
|
-
const { Window, GlobalWindow } = await
|
|
631
|
+
const { Window, GlobalWindow } = await importModule("happy-dom");
|
|
631
632
|
const win = new (GlobalWindow || Window)();
|
|
632
633
|
const { keys, originals } = populateGlobal(global, win, { bindFunctions: true });
|
|
633
634
|
return {
|
|
@@ -643,7 +644,7 @@ var happy = {
|
|
|
643
644
|
var edge = {
|
|
644
645
|
name: "edge-runtime",
|
|
645
646
|
async setup(global) {
|
|
646
|
-
const { EdgeVM } = await
|
|
647
|
+
const { EdgeVM } = await importModule("@edge-runtime/vm");
|
|
647
648
|
const vm = new EdgeVM({
|
|
648
649
|
extend: (context) => {
|
|
649
650
|
context.global = context;
|
package/dist/{chunk-integrations-globals.803277be.mjs → chunk-integrations-globals.1018e651.mjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { g as globalApis } from './chunk-constants.38b43a44.mjs';
|
|
2
|
-
import { i as index } from './chunk-runtime-hooks.
|
|
2
|
+
import { i as index } from './chunk-runtime-hooks.d4cadf47.mjs';
|
|
3
3
|
import 'url';
|
|
4
4
|
import './chunk-utils-global.2aa95025.mjs';
|
|
5
5
|
import 'path';
|
|
6
6
|
import 'tty';
|
|
7
7
|
import 'local-pkg';
|
|
8
|
-
import './chunk-runtime-chain.
|
|
8
|
+
import './chunk-runtime-chain.f2e00f4c.mjs';
|
|
9
9
|
import 'util';
|
|
10
10
|
import 'chai';
|
|
11
11
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
@@ -427,6 +427,19 @@ try {
|
|
|
427
427
|
String.naturalCompare = naturalCompare;
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
+
const serialize$1 = (val, config, indentation, depth, refs, printer) => {
|
|
431
|
+
const name = val.getMockName();
|
|
432
|
+
const nameString = name === "vi.fn()" ? "" : ` ${name}`;
|
|
433
|
+
let callsString = "";
|
|
434
|
+
if (val.mock.calls.length !== 0) {
|
|
435
|
+
const indentationNext = indentation + config.indent;
|
|
436
|
+
callsString = ` {${config.spacingOuter}${indentationNext}"calls": ${printer(val.mock.calls, config, indentationNext, depth, refs)}${config.min ? ", " : ","}${config.spacingOuter}${indentationNext}"results": ${printer(val.mock.results, config, indentationNext, depth, refs)}${config.min ? "" : ","}${config.spacingOuter}${indentation}}`;
|
|
437
|
+
}
|
|
438
|
+
return `[MockFunction${nameString}]${callsString}`;
|
|
439
|
+
};
|
|
440
|
+
const test$1 = (val) => val && !!val._isMockFunction;
|
|
441
|
+
const plugin = { serialize: serialize$1, test: test$1 };
|
|
442
|
+
|
|
430
443
|
const {
|
|
431
444
|
DOMCollection,
|
|
432
445
|
DOMElement,
|
|
@@ -441,7 +454,8 @@ let PLUGINS = [
|
|
|
441
454
|
DOMElement,
|
|
442
455
|
DOMCollection,
|
|
443
456
|
Immutable,
|
|
444
|
-
AsymmetricMatcher$1
|
|
457
|
+
AsymmetricMatcher$1,
|
|
458
|
+
plugin
|
|
445
459
|
];
|
|
446
460
|
const addSerializer = (plugin) => {
|
|
447
461
|
PLUGINS = [plugin].concat(PLUGINS);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { e as environments, t as takeCoverage, p as pLimit } from './chunk-defaults.
|
|
2
|
-
import { r as resetRunOnceCounter, i as index, v as vi } from './chunk-runtime-hooks.
|
|
1
|
+
import { e as environments, t as takeCoverage, p as pLimit } from './chunk-defaults.ed196a9a.mjs';
|
|
2
|
+
import { r as resetRunOnceCounter, i as index, v as vi } from './chunk-runtime-hooks.d4cadf47.mjs';
|
|
3
3
|
import { o as deepClone, q as getType, t as isNode, g as getWorkerState, R as RealDate, k as safeClearTimeout, s as safeSetTimeout, u as toArray, v as relativePath, x as isBrowser, y as partitionSuiteChildren, z as shuffle, A as hasTests, B as hasFailed, h as getFullName } from './chunk-utils-global.2aa95025.mjs';
|
|
4
|
-
import { e as clearCollectorContext, f as defaultSuite, h as setHooks, j as getHooks, k as collectorContext, l as setState, G as GLOBAL_EXPECT, m as getFn, n as getState } from './chunk-runtime-chain.
|
|
4
|
+
import { e as clearCollectorContext, f as defaultSuite, h as setHooks, j as getHooks, k as collectorContext, l as setState, G as GLOBAL_EXPECT, m as getFn, n as getState } from './chunk-runtime-chain.f2e00f4c.mjs';
|
|
5
5
|
import { r as rpc } from './chunk-runtime-rpc.45d8ee19.mjs';
|
|
6
6
|
import util$1 from 'util';
|
|
7
7
|
import { util } from 'chai';
|
|
@@ -128,7 +128,7 @@ async function setupGlobalEnv(config) {
|
|
|
128
128
|
if (isNode)
|
|
129
129
|
await setupConsoleLogSpy();
|
|
130
130
|
if (config.globals)
|
|
131
|
-
(await import('./chunk-integrations-globals.
|
|
131
|
+
(await import('./chunk-integrations-globals.1018e651.mjs')).registerApiGlobally();
|
|
132
132
|
}
|
|
133
133
|
function setupDefines(defines) {
|
|
134
134
|
for (const key in defines)
|
|
@@ -437,7 +437,7 @@ async function sendTasksUpdate() {
|
|
|
437
437
|
async function runTest(test) {
|
|
438
438
|
var _a, _b;
|
|
439
439
|
if (test.mode !== "run") {
|
|
440
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
440
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.f2e00f4c.mjs').then(function (n) { return n.p; });
|
|
441
441
|
getSnapshotClient().skipTestSnapshots(test);
|
|
442
442
|
return;
|
|
443
443
|
}
|
|
@@ -453,7 +453,7 @@ async function runTest(test) {
|
|
|
453
453
|
updateTask(test);
|
|
454
454
|
clearModuleMocks();
|
|
455
455
|
if (isNode) {
|
|
456
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
456
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.f2e00f4c.mjs').then(function (n) { return n.p; });
|
|
457
457
|
await getSnapshotClient().setTest(test);
|
|
458
458
|
}
|
|
459
459
|
const workerState = getWorkerState();
|
|
@@ -506,7 +506,7 @@ async function runTest(test) {
|
|
|
506
506
|
if (isBrowser && test.result.error)
|
|
507
507
|
console.error(test.result.error.message, test.result.error.stackStr);
|
|
508
508
|
if (isNode) {
|
|
509
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
509
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.f2e00f4c.mjs').then(function (n) { return n.p; });
|
|
510
510
|
getSnapshotClient().clearTest();
|
|
511
511
|
}
|
|
512
512
|
test.result.duration = now() - start;
|
|
@@ -618,7 +618,7 @@ async function startTestsBrowser(paths, config) {
|
|
|
618
618
|
async function startTestsNode(paths, config) {
|
|
619
619
|
const files = await collectTests(paths, config);
|
|
620
620
|
rpc().onCollected(files);
|
|
621
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
621
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.f2e00f4c.mjs').then(function (n) { return n.p; });
|
|
622
622
|
getSnapshotClient().clear();
|
|
623
623
|
await runFiles(files, config);
|
|
624
624
|
takeCoverage();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, c as createExpect, b as globalExpect } from './chunk-runtime-chain.
|
|
1
|
+
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, c as createExpect, b as globalExpect } from './chunk-runtime-chain.f2e00f4c.mjs';
|
|
2
2
|
import { g as getWorkerState, R as RealDate, r as resetDate, m as mockDate, a as resetModules, s as safeSetTimeout } from './chunk-utils-global.2aa95025.mjs';
|
|
3
3
|
import { p as parseStacktrace } from './chunk-utils-source-map.8b066ce2.mjs';
|
|
4
4
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.4da45ef5.mjs';
|
package/dist/{chunk-vite-node-externalize.a2813ad7.mjs → chunk-vite-node-externalize.e9af6472.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as join, D as basename, d as dirname, C as resolve, E as AggregateErrorPonyfill, p as picocolors, F as isAbsolute, G as relative, c as slash$2, t as isNode, v as relativePath, H as getTests, h as getFullName, B as hasFailed, I as hasFailedSnapshot, J as safeSetInterval, K as safeClearInterval, L as getSuites, s as safeSetTimeout, z as shuffle, u as toArray$1, M as normalize, n as noop$1, k as safeClearTimeout, N as deepMerge, O as toNamespacedPath, b as getCallLastIndex, l as notNullish, P as ensurePackageInstalled, Q as stdout } from './chunk-utils-global.2aa95025.mjs';
|
|
2
|
-
import { p as pLimit, c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage, d as envPackageNames } from './chunk-defaults.
|
|
2
|
+
import { p as pLimit, c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage, d as envPackageNames } from './chunk-defaults.ed196a9a.mjs';
|
|
3
3
|
import { loadConfigFromFile, createServer, mergeConfig } from 'vite';
|
|
4
4
|
import path$a from 'path';
|
|
5
5
|
import _url, { fileURLToPath } from 'url';
|
|
@@ -24,7 +24,7 @@ import MagicString from './chunk-magic-string.efe26975.mjs';
|
|
|
24
24
|
import require$$0$2 from 'readline';
|
|
25
25
|
import { p as prompts } from './vendor-index.de788b6a.mjs';
|
|
26
26
|
|
|
27
|
-
var version$1 = "0.19.
|
|
27
|
+
var version$1 = "0.19.1";
|
|
28
28
|
|
|
29
29
|
class EndError extends Error {
|
|
30
30
|
constructor(value) {
|
|
@@ -9041,7 +9041,7 @@ createLogUpdate(process$1.stdout);
|
|
|
9041
9041
|
|
|
9042
9042
|
createLogUpdate(process$1.stderr);
|
|
9043
9043
|
|
|
9044
|
-
var version = "0.19.
|
|
9044
|
+
var version = "0.19.1";
|
|
9045
9045
|
|
|
9046
9046
|
function fileFromParsedStack(stack) {
|
|
9047
9047
|
var _a, _b;
|
package/dist/cli.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
import { p as picocolors } from './chunk-utils-global.2aa95025.mjs';
|
|
3
|
-
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.
|
|
3
|
+
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.e9af6472.mjs';
|
|
4
4
|
import 'path';
|
|
5
5
|
import 'tty';
|
|
6
6
|
import 'local-pkg';
|
|
7
|
-
import './chunk-defaults.
|
|
7
|
+
import './chunk-defaults.ed196a9a.mjs';
|
|
8
8
|
import 'fs';
|
|
9
9
|
import 'module';
|
|
10
10
|
import 'url';
|
package/dist/entry.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
2
|
import { g as getWorkerState, a as resetModules } from './chunk-utils-global.2aa95025.mjs';
|
|
3
|
-
import { f as envs } from './chunk-defaults.
|
|
4
|
-
import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-error.
|
|
3
|
+
import { f as envs } from './chunk-defaults.ed196a9a.mjs';
|
|
4
|
+
import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-error.606e0393.mjs';
|
|
5
5
|
import 'path';
|
|
6
6
|
import 'tty';
|
|
7
7
|
import 'local-pkg';
|
|
8
8
|
import 'module';
|
|
9
9
|
import 'url';
|
|
10
|
-
import './chunk-runtime-hooks.
|
|
11
|
-
import './chunk-runtime-chain.
|
|
10
|
+
import './chunk-runtime-hooks.d4cadf47.mjs';
|
|
11
|
+
import './chunk-runtime-chain.f2e00f4c.mjs';
|
|
12
12
|
import 'util';
|
|
13
13
|
import 'chai';
|
|
14
14
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { c as createExpect, d as describe, b as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.
|
|
2
|
-
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, h as getRunningMode, f as isFirstRun, j as isWatchMode, e as runOnce, v as vi, g as vitest, w as withCallback } from './chunk-runtime-hooks.
|
|
1
|
+
export { c as createExpect, d as describe, b as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.f2e00f4c.mjs';
|
|
2
|
+
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, h as getRunningMode, f as isFirstRun, j as isWatchMode, e as runOnce, v as vi, g as vitest, w as withCallback } from './chunk-runtime-hooks.d4cadf47.mjs';
|
|
3
3
|
import * as chai from 'chai';
|
|
4
4
|
export { chai };
|
|
5
5
|
export { assert, should } from 'chai';
|
package/dist/node.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.
|
|
1
|
+
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.e9af6472.mjs';
|
|
2
2
|
export { V as VitestRunner } from './chunk-runtime-mocker.dfdfd57b.mjs';
|
|
3
3
|
import './chunk-utils-global.2aa95025.mjs';
|
|
4
4
|
import 'path';
|
|
5
5
|
import 'tty';
|
|
6
6
|
import 'local-pkg';
|
|
7
|
-
import './chunk-defaults.
|
|
7
|
+
import './chunk-defaults.ed196a9a.mjs';
|
|
8
8
|
import 'fs';
|
|
9
9
|
import 'module';
|
|
10
10
|
import 'url';
|
package/dist/suite.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'util';
|
|
2
2
|
import './chunk-utils-global.2aa95025.mjs';
|
|
3
|
-
export { e as clearCollectorContext, o as createSuiteHooks, f as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.
|
|
3
|
+
export { e as clearCollectorContext, o as createSuiteHooks, f as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.f2e00f4c.mjs';
|
|
4
4
|
import 'path';
|
|
5
5
|
import 'tty';
|
|
6
6
|
import 'local-pkg';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"@types/natural-compare": "^1.4.1",
|
|
110
110
|
"@types/prompts": "^2.4.0",
|
|
111
111
|
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
112
|
-
"@vitest/ui": "0.19.
|
|
112
|
+
"@vitest/ui": "0.19.1",
|
|
113
113
|
"birpc": "^0.2.3",
|
|
114
114
|
"c8": "^7.11.3",
|
|
115
115
|
"cac": "^6.7.12",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"source-map-js": "^1.0.2",
|
|
138
138
|
"strip-ansi": "^7.0.1",
|
|
139
139
|
"typescript": "^4.7.4",
|
|
140
|
-
"vite-node": "0.19.
|
|
140
|
+
"vite-node": "0.19.1",
|
|
141
141
|
"ws": "^8.8.1"
|
|
142
142
|
},
|
|
143
143
|
"scripts": {
|