vitest 0.0.123 → 0.0.124
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/cli.js +5 -5
- package/dist/{constants-744cb76d.js → constants-8b3a9b31.js} +1 -1
- package/dist/{diff-a0cbb825.js → diff-aeba6bd6.js} +1 -1
- package/dist/entry.js +4 -4
- package/dist/{global-f9288768.js → global-3b7dd162.js} +4 -4
- package/dist/{index-a7ae9662.js → index-0963bf06.js} +5 -10
- package/dist/{index-68c0c743.js → index-7f52a6d6.js} +1 -1
- package/dist/{index-250bdca0.js → index-9fdde2e8.js} +24 -23
- package/dist/index.js +3 -3
- package/dist/node.js +4 -4
- package/dist/{setup-647e44ef.js → setup-e485f26d.js} +2 -2
- package/dist/{vi-aef0a94d.js → vi-56df0b20.js} +1 -1
- package/dist/worker.js +2 -2
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -7,8 +7,8 @@ import process$1 from 'process';
|
|
|
7
7
|
import { m as mergeStream, g as getStream, c as crossSpawn } from './index-6e709f57.js';
|
|
8
8
|
import require$$0, { constants } from 'os';
|
|
9
9
|
import { s as signalExit } from './index-648e7ab2.js';
|
|
10
|
-
import { e as ensurePackageInstalled } from './index-
|
|
11
|
-
import { c as createVitest } from './index-
|
|
10
|
+
import { e as ensurePackageInstalled } from './index-9fdde2e8.js';
|
|
11
|
+
import { c as createVitest } from './index-0963bf06.js';
|
|
12
12
|
import './_commonjsHelpers-c9e3b764.js';
|
|
13
13
|
import 'fs';
|
|
14
14
|
import 'stream';
|
|
@@ -18,10 +18,10 @@ import 'url';
|
|
|
18
18
|
import 'tty';
|
|
19
19
|
import 'local-pkg';
|
|
20
20
|
import 'vite';
|
|
21
|
-
import './constants-
|
|
21
|
+
import './constants-8b3a9b31.js';
|
|
22
22
|
import './magic-string.es-94000aea.js';
|
|
23
23
|
import 'perf_hooks';
|
|
24
|
-
import './diff-
|
|
24
|
+
import './diff-aeba6bd6.js';
|
|
25
25
|
import 'module';
|
|
26
26
|
import 'worker_threads';
|
|
27
27
|
import 'tinypool';
|
|
@@ -1700,7 +1700,7 @@ function execa(file, args, options) {
|
|
|
1700
1700
|
return mergePromise(spawned, handlePromiseOnce);
|
|
1701
1701
|
}
|
|
1702
1702
|
|
|
1703
|
-
var version = "0.0.
|
|
1703
|
+
var version = "0.0.124";
|
|
1704
1704
|
|
|
1705
1705
|
const CLOSE_TIMEOUT = 1e3;
|
|
1706
1706
|
const cli = cac("vitest");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from 'url';
|
|
2
|
-
import { k as resolve } from './index-
|
|
2
|
+
import { k as resolve } from './index-9fdde2e8.js';
|
|
3
3
|
|
|
4
4
|
const distDir = resolve(fileURLToPath(import.meta.url), "../../dist");
|
|
5
5
|
const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
|
package/dist/entry.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import fs, { promises } from 'fs';
|
|
2
|
-
import { f as format_1, h as getSerializers, p as plugins_1, b as getState, j as equals, k as iterableEquality, l as subsetEquality, m as isA, J as JestChaiExpect, n as clearContext, o as defaultSuite, q as setHooks, r as getHooks, u as context, s as setState, x as getFn, e as vi } from './vi-
|
|
2
|
+
import { f as format_1, h as getSerializers, p as plugins_1, b as getState, j as equals, k as iterableEquality, l as subsetEquality, m as isA, J as JestChaiExpect, n as clearContext, o as defaultSuite, q as setHooks, r as getHooks, u as context, s as setState, x as getFn, e as vi } from './vi-56df0b20.js';
|
|
3
3
|
import { Console } from 'console';
|
|
4
4
|
import { Writable } from 'stream';
|
|
5
5
|
import { importModule } from 'local-pkg';
|
|
6
6
|
import chai$1, { expect, util } from 'chai';
|
|
7
7
|
import { a as commonjsRequire, c as commonjsGlobal } from './_commonjsHelpers-c9e3b764.js';
|
|
8
|
-
import { u as index, s as slash, v as getNames, c, t as toArray, r as relative, w as partitionSuiteChildren, x as hasTests, h as hasFailed } from './index-
|
|
8
|
+
import { u as index, s as slash, v as getNames, c, t as toArray, r as relative, w as partitionSuiteChildren, x as hasTests, h as hasFailed } from './index-9fdde2e8.js';
|
|
9
9
|
import { r as rpc } from './rpc-8c7cc374.js';
|
|
10
|
-
import { l as getOriginalPos, m as posToNumber, n as parseStack, u as unifiedDiff } from './diff-
|
|
10
|
+
import { l as getOriginalPos, m as posToNumber, n as parseStack, u as unifiedDiff } from './diff-aeba6bd6.js';
|
|
11
11
|
import { performance as performance$1 } from 'perf_hooks';
|
|
12
12
|
import { createHash } from 'crypto';
|
|
13
13
|
import { format } from 'util';
|
|
@@ -1228,7 +1228,7 @@ async function setupGlobalEnv(config) {
|
|
|
1228
1228
|
setupConsoleLogSpy();
|
|
1229
1229
|
await setupChai();
|
|
1230
1230
|
if (config.global)
|
|
1231
|
-
(await import('./global-
|
|
1231
|
+
(await import('./global-3b7dd162.js')).registerApiGlobally();
|
|
1232
1232
|
}
|
|
1233
1233
|
function setupConsoleLogSpy() {
|
|
1234
1234
|
const stdout = new Writable({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { g as globalApis } from './constants-
|
|
2
|
-
import { i as index } from './index-
|
|
1
|
+
import { g as globalApis } from './constants-8b3a9b31.js';
|
|
2
|
+
import { i as index } from './index-7f52a6d6.js';
|
|
3
3
|
import 'url';
|
|
4
|
-
import './index-
|
|
4
|
+
import './index-9fdde2e8.js';
|
|
5
5
|
import 'tty';
|
|
6
6
|
import 'local-pkg';
|
|
7
7
|
import 'path';
|
|
8
|
-
import './vi-
|
|
8
|
+
import './vi-56df0b20.js';
|
|
9
9
|
import './_commonjsHelpers-c9e3b764.js';
|
|
10
10
|
import './jest-mock-038a01b3.js';
|
|
11
11
|
import 'chai';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c, s as slash$1, a as isAbsolute, r as relative, d as dirname, b as basename, g as getFullName, h as hasFailed, f as getSuites, j as getTests, t as toArray, k as resolve, l as deepMerge, m as toFilePath, n as noop$1, e as ensurePackageInstalled } from './index-
|
|
1
|
+
import { c, s as slash$1, a as isAbsolute, r as relative, d as dirname, b as basename, g as getFullName, h as hasFailed, f as getSuites, j as getTests, t as toArray, k as resolve, l as deepMerge, m as toFilePath, n as noop$1, e as ensurePackageInstalled } from './index-9fdde2e8.js';
|
|
2
2
|
import { createServer, mergeConfig } from 'vite';
|
|
3
3
|
import path$a from 'path';
|
|
4
4
|
import process$1 from 'process';
|
|
@@ -7,10 +7,10 @@ import require$$0 from 'os';
|
|
|
7
7
|
import require$$0$1 from 'util';
|
|
8
8
|
import require$$0$2 from 'stream';
|
|
9
9
|
import require$$2 from 'events';
|
|
10
|
-
import { d as defaultInclude, a as defaultExclude, b as defaultPort, c as distDir, e as configFiles } from './constants-
|
|
10
|
+
import { d as defaultInclude, a as defaultExclude, b as defaultPort, c as distDir, e as configFiles } from './constants-8b3a9b31.js';
|
|
11
11
|
import MagicString from './magic-string.es-94000aea.js';
|
|
12
12
|
import { performance } from 'perf_hooks';
|
|
13
|
-
import { F as F_POINTER, a as F_DOWN, s as stripAnsi, b as F_LONG_DASH, c as F_DOWN_RIGHT, d as F_DOT, e as F_CHECK, f as F_CROSS, g as F_RIGHT, p as printError, h as stringWidth, i as ansiStyles, j as sliceAnsi, k as cliTruncate } from './diff-
|
|
13
|
+
import { F as F_POINTER, a as F_DOWN, s as stripAnsi, b as F_LONG_DASH, c as F_DOWN_RIGHT, d as F_DOT, e as F_CHECK, f as F_CROSS, g as F_RIGHT, p as printError, h as stringWidth, i as ansiStyles, j as sliceAnsi, k as cliTruncate } from './diff-aeba6bd6.js';
|
|
14
14
|
import { o as onetime, s as signalExit } from './index-648e7ab2.js';
|
|
15
15
|
import { createRequire } from 'module';
|
|
16
16
|
import { pathToFileURL } from 'url';
|
|
@@ -8365,7 +8365,7 @@ async function createVitest(options, viteOverrides = {}) {
|
|
|
8365
8365
|
await ctx.setServer(options, server2);
|
|
8366
8366
|
haveStarted = true;
|
|
8367
8367
|
if (options.api)
|
|
8368
|
-
(await import('./setup-
|
|
8368
|
+
(await import('./setup-e485f26d.js')).setup(ctx);
|
|
8369
8369
|
}
|
|
8370
8370
|
},
|
|
8371
8371
|
MocksPlugin(),
|
|
@@ -8378,18 +8378,13 @@ async function createVitest(options, viteOverrides = {}) {
|
|
|
8378
8378
|
},
|
|
8379
8379
|
build: {
|
|
8380
8380
|
sourcemap: true
|
|
8381
|
-
},
|
|
8382
|
-
optimizeDeps: {
|
|
8383
|
-
exclude: [
|
|
8384
|
-
"vitest"
|
|
8385
|
-
]
|
|
8386
8381
|
}
|
|
8387
8382
|
};
|
|
8388
8383
|
const server = await createServer(mergeConfig(config, viteOverrides));
|
|
8389
8384
|
await server.pluginContainer.buildStart({});
|
|
8390
8385
|
if (options.api === true)
|
|
8391
8386
|
options.api = defaultPort;
|
|
8392
|
-
if (options.open &&
|
|
8387
|
+
if (options.open && typeof options.api !== "number")
|
|
8393
8388
|
options.api = defaultPort;
|
|
8394
8389
|
if (typeof options.api === "number")
|
|
8395
8390
|
await server.listen(options.api);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, b as getState, s as setState, c as suite, t as test, d as describe, i as it, v as vitest, e as vi } from './vi-
|
|
1
|
+
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, b as getState, s as setState, c as suite, t as test, d as describe, i as it, v as vitest, e as vi } from './vi-56df0b20.js';
|
|
2
2
|
import chai, { assert, should } from 'chai';
|
|
3
3
|
import { s as spies, a as spyOn, f as fn } from './jest-mock-038a01b3.js';
|
|
4
4
|
|
|
@@ -249,13 +249,6 @@ const index = {
|
|
|
249
249
|
..._path
|
|
250
250
|
};
|
|
251
251
|
|
|
252
|
-
const isWindows = process.platform === "win32";
|
|
253
|
-
function toArray(array) {
|
|
254
|
-
array = array || [];
|
|
255
|
-
if (Array.isArray(array))
|
|
256
|
-
return array;
|
|
257
|
-
return [array];
|
|
258
|
-
}
|
|
259
252
|
function notNullish(v) {
|
|
260
253
|
return v != null;
|
|
261
254
|
}
|
|
@@ -267,29 +260,20 @@ function mergeSlashes(str) {
|
|
|
267
260
|
}
|
|
268
261
|
const noop = () => {
|
|
269
262
|
};
|
|
270
|
-
function
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
tasksGroup.push(c2);
|
|
276
|
-
} else {
|
|
277
|
-
tasksGroups.push(tasksGroup);
|
|
278
|
-
tasksGroup = [c2];
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
if (tasksGroup.length > 0)
|
|
282
|
-
tasksGroups.push(tasksGroup);
|
|
283
|
-
return tasksGroups;
|
|
263
|
+
function toArray(array) {
|
|
264
|
+
array = array || [];
|
|
265
|
+
if (Array.isArray(array))
|
|
266
|
+
return array;
|
|
267
|
+
return [array];
|
|
284
268
|
}
|
|
285
269
|
function getTests(suite) {
|
|
286
|
-
return toArray(suite).flatMap((s) => s.type === "test" ? [s] : s.tasks.flatMap((
|
|
270
|
+
return toArray(suite).flatMap((s) => s.type === "test" ? [s] : s.tasks.flatMap((c) => c.type === "test" ? [c] : getTests(c)));
|
|
287
271
|
}
|
|
288
272
|
function getSuites(suite) {
|
|
289
273
|
return toArray(suite).flatMap((s) => s.type === "suite" ? [s, ...getSuites(s.tasks)] : []);
|
|
290
274
|
}
|
|
291
275
|
function hasTests(suite) {
|
|
292
|
-
return toArray(suite).some((s) => s.tasks.some((
|
|
276
|
+
return toArray(suite).some((s) => s.tasks.some((c) => c.type === "test" || hasTests(c)));
|
|
293
277
|
}
|
|
294
278
|
function hasFailed(suite) {
|
|
295
279
|
return toArray(suite).some((s) => {
|
|
@@ -307,6 +291,23 @@ function getNames(task) {
|
|
|
307
291
|
}
|
|
308
292
|
return names;
|
|
309
293
|
}
|
|
294
|
+
|
|
295
|
+
const isWindows = process.platform === "win32";
|
|
296
|
+
function partitionSuiteChildren(suite) {
|
|
297
|
+
let tasksGroup = [];
|
|
298
|
+
const tasksGroups = [];
|
|
299
|
+
for (const c2 of suite.tasks) {
|
|
300
|
+
if (tasksGroup.length === 0 || c2.concurrent === tasksGroup[0].concurrent) {
|
|
301
|
+
tasksGroup.push(c2);
|
|
302
|
+
} else {
|
|
303
|
+
tasksGroups.push(tasksGroup);
|
|
304
|
+
tasksGroup = [c2];
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (tasksGroup.length > 0)
|
|
308
|
+
tasksGroups.push(tasksGroup);
|
|
309
|
+
return tasksGroups;
|
|
310
|
+
}
|
|
310
311
|
function getFullName(task) {
|
|
311
312
|
return getNames(task).join(c.dim(" > "));
|
|
312
313
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { d as describe, i as it, c as suite, t as test, e as vi, v as vitest } from './vi-
|
|
2
|
-
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, e as expect } from './index-
|
|
1
|
+
export { d as describe, i as it, c as suite, t as test, e as vi, v as vitest } from './vi-56df0b20.js';
|
|
2
|
+
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, e as expect } from './index-7f52a6d6.js';
|
|
3
3
|
export { f as fn, s as spies, a as spyOn } from './jest-mock-038a01b3.js';
|
|
4
4
|
export { assert, default as chai, should } from 'chai';
|
|
5
|
-
import './index-
|
|
5
|
+
import './index-9fdde2e8.js';
|
|
6
6
|
import 'url';
|
|
7
7
|
import 'tty';
|
|
8
8
|
import 'local-pkg';
|
package/dist/node.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { c as createVitest } from './index-
|
|
2
|
-
import './index-
|
|
1
|
+
export { c as createVitest } from './index-0963bf06.js';
|
|
2
|
+
import './index-9fdde2e8.js';
|
|
3
3
|
import 'url';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'local-pkg';
|
|
@@ -11,10 +11,10 @@ import 'os';
|
|
|
11
11
|
import 'util';
|
|
12
12
|
import 'stream';
|
|
13
13
|
import 'events';
|
|
14
|
-
import './constants-
|
|
14
|
+
import './constants-8b3a9b31.js';
|
|
15
15
|
import './magic-string.es-94000aea.js';
|
|
16
16
|
import 'perf_hooks';
|
|
17
|
-
import './diff-
|
|
17
|
+
import './diff-aeba6bd6.js';
|
|
18
18
|
import './index-648e7ab2.js';
|
|
19
19
|
import './_commonjsHelpers-c9e3b764.js';
|
|
20
20
|
import 'assert';
|
|
@@ -9,9 +9,9 @@ import require$$2 from 'events';
|
|
|
9
9
|
import require$$1 from 'https';
|
|
10
10
|
import require$$2$1 from 'http';
|
|
11
11
|
import require$$7 from 'url';
|
|
12
|
-
import { A as API_PATH } from './constants-
|
|
12
|
+
import { A as API_PATH } from './constants-8b3a9b31.js';
|
|
13
13
|
import { s as shouldExternalize } from './externalize-2f63779d.js';
|
|
14
|
-
import './index-
|
|
14
|
+
import './index-9fdde2e8.js';
|
|
15
15
|
import 'tty';
|
|
16
16
|
import 'local-pkg';
|
|
17
17
|
import 'path';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as noop, i as isObject } from './index-
|
|
1
|
+
import { n as noop, i as isObject } from './index-9fdde2e8.js';
|
|
2
2
|
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-c9e3b764.js';
|
|
3
3
|
import { a as spyOn, f as fn, s as spies } from './jest-mock-038a01b3.js';
|
|
4
4
|
|
package/dist/worker.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as dirname, b as basename, k as resolve, p as mergeSlashes, q as join, s as slash, m as toFilePath } from './index-
|
|
1
|
+
import { d as dirname, b as basename, k as resolve, p as mergeSlashes, q as join, s as slash, m as toFilePath } from './index-9fdde2e8.js';
|
|
2
2
|
import { c as createBirpc } from './index-e909c175.js';
|
|
3
|
-
import { c as distDir } from './constants-
|
|
3
|
+
import { c as distDir } from './constants-8b3a9b31.js';
|
|
4
4
|
import { builtinModules, createRequire } from 'module';
|
|
5
5
|
import { pathToFileURL, fileURLToPath } from 'url';
|
|
6
6
|
import vm from 'vm';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.124",
|
|
4
4
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"strip-ansi": "^7.0.1",
|
|
92
92
|
"typescript": "^4.5.4",
|
|
93
93
|
"ws": "^8.4.0",
|
|
94
|
-
"@vitest/ui": "0.0.
|
|
94
|
+
"@vitest/ui": "0.0.124"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"c8": "*",
|