vitest 1.0.0-beta.5 → 1.0.0-beta.6
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.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/child.js +2 -2
- package/dist/chunks/{integrations-globals.-pds_Gug.js → integrations-globals.eip0xL77.js} +3 -3
- package/dist/chunks/{runtime-console.iCAG0Yz3.js → runtime-console.hf2msWA9.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/config.d.ts +1 -1
- package/dist/coverage.d.ts +1 -1
- package/dist/entry-vm.js +3 -3
- package/dist/entry.js +4 -4
- package/dist/environments.d.ts +1 -1
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +4 -4
- package/dist/node.d.ts +2 -2
- package/dist/node.js +5 -5
- package/dist/{reporters-ANEBTnOh.d.ts → reporters-vMlHjCdM.d.ts} +11 -4
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +3 -3
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +2 -2
- package/dist/{suite-C1OmA61l.d.ts → suite-vfxzpeqE.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/vendor/{date.W90-E5kF.js → date.Ns1pGd_X.js} +1 -0
- package/dist/vendor/{environments.hpEVJZPC.js → environments.ewIbzajW.js} +2 -1
- package/dist/vendor/{index.Npc-eff0.js → index.VL3WbvjT.js} +1 -1
- package/dist/vendor/{loader.CU0NY2Is.js → loader.-JDdZ5RJ.js} +1 -1
- package/dist/vendor/{node.c-kzGvOB.js → node.1xm0UoNi.js} +41 -8
- package/dist/vendor/{reporters.1xKxm8im.js → reporters.pr8MinP9.js} +7 -5
- package/dist/vendor/{vi.voNYQWB_.js → vi.JXuS6emb.js} +1 -1
- package/dist/vm.js +4 -4
- package/dist/worker.js +2 -2
- package/import-meta.d.ts +5 -0
- package/package.json +12 -9
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { processError, startTests } from '@vitest/runner';
|
|
2
|
-
import { R as ResolvedConfig, b as CoverageOptions, c as CoverageProvider, d as CoverageProviderModule } from './reporters-
|
|
2
|
+
import { R as ResolvedConfig, b as CoverageOptions, c as CoverageProvider, d as CoverageProviderModule } from './reporters-vMlHjCdM.js';
|
|
3
3
|
import { VitestExecutor } from './execute.js';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import 'vite-node';
|
package/dist/browser.js
CHANGED
|
@@ -13,7 +13,7 @@ async function setupCommonEnv(config) {
|
|
|
13
13
|
globalSetup = true;
|
|
14
14
|
setSafeTimers();
|
|
15
15
|
if (config.globals)
|
|
16
|
-
(await import('./chunks/integrations-globals
|
|
16
|
+
(await import('./chunks/integrations-globals.eip0xL77.js')).registerApiGlobally();
|
|
17
17
|
}
|
|
18
18
|
function setupDefines(defines) {
|
|
19
19
|
for (const key in defines)
|
package/dist/child.js
CHANGED
|
@@ -3,13 +3,13 @@ import v8 from 'node:v8';
|
|
|
3
3
|
import { c as createBirpc } from './vendor/index.cAUulNDf.js';
|
|
4
4
|
import { parseRegexp } from '@vitest/utils';
|
|
5
5
|
import { workerId } from 'tinypool';
|
|
6
|
-
import { l as loadEnvironment } from './vendor/loader.
|
|
6
|
+
import { l as loadEnvironment } from './vendor/loader.-JDdZ5RJ.js';
|
|
7
7
|
import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor/execute.aMjV5C9u.js';
|
|
8
8
|
import { r as rpcDone, c as createSafeRpc } from './vendor/rpc.Bl-ysZIr.js';
|
|
9
9
|
import { s as setupInspect } from './vendor/inspector.lFAeuaAt.js';
|
|
10
10
|
import 'pathe';
|
|
11
11
|
import 'vite-node/client';
|
|
12
|
-
import './vendor/environments.
|
|
12
|
+
import './vendor/environments.ewIbzajW.js';
|
|
13
13
|
import 'node:console';
|
|
14
14
|
import 'local-pkg';
|
|
15
15
|
import 'node:url';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as globalApis } from '../vendor/constants.WSvnD_fn.js';
|
|
2
|
-
import { i as index } from '../vendor/index.
|
|
2
|
+
import { i as index } from '../vendor/index.VL3WbvjT.js';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import '../vendor/benchmark.WVm6DARl.js';
|
|
5
5
|
import '@vitest/runner/utils';
|
|
@@ -9,7 +9,7 @@ import 'pathe';
|
|
|
9
9
|
import 'std-env';
|
|
10
10
|
import '../vendor/global.L7JRz1qU.js';
|
|
11
11
|
import '../vendor/run-once.X3E7xx3F.js';
|
|
12
|
-
import '../vendor/vi.
|
|
12
|
+
import '../vendor/vi.JXuS6emb.js';
|
|
13
13
|
import 'chai';
|
|
14
14
|
import '../vendor/_commonjsHelpers.jjO7Zipk.js';
|
|
15
15
|
import '@vitest/expect';
|
|
@@ -17,7 +17,7 @@ import '@vitest/snapshot';
|
|
|
17
17
|
import '@vitest/utils/error';
|
|
18
18
|
import '../vendor/tasks.IknbGB2n.js';
|
|
19
19
|
import '@vitest/utils/source-map';
|
|
20
|
-
import '../vendor/date.
|
|
20
|
+
import '../vendor/date.Ns1pGd_X.js';
|
|
21
21
|
import '@vitest/spy';
|
|
22
22
|
|
|
23
23
|
function registerApiGlobally() {
|
|
@@ -2,7 +2,7 @@ import { Writable } from 'node:stream';
|
|
|
2
2
|
import { Console } from 'node:console';
|
|
3
3
|
import { relative } from 'node:path';
|
|
4
4
|
import { getSafeTimers } from '@vitest/utils';
|
|
5
|
-
import { R as RealDate } from '../vendor/date.
|
|
5
|
+
import { R as RealDate } from '../vendor/date.Ns1pGd_X.js';
|
|
6
6
|
|
|
7
7
|
const UNKNOWN_TEST_ID = "__vitest__unknown_test__";
|
|
8
8
|
function getTaskIdByStack(root) {
|
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { normalize } from 'pathe';
|
|
2
2
|
import cac from 'cac';
|
|
3
3
|
import c from 'picocolors';
|
|
4
|
-
import { v as version, s as startVitest } from './vendor/node.
|
|
4
|
+
import { v as version, s as startVitest } from './vendor/node.1xm0UoNi.js';
|
|
5
5
|
import './vendor/index.XU72Rmy8.js';
|
|
6
|
-
import { d as divider } from './vendor/reporters.
|
|
6
|
+
import { d as divider } from './vendor/reporters.pr8MinP9.js';
|
|
7
7
|
import { t as toArray } from './vendor/base._79unx2z.js';
|
|
8
8
|
import 'vite';
|
|
9
9
|
import 'node:path';
|
|
@@ -45,19 +45,19 @@ import 'node:crypto';
|
|
|
45
45
|
import 'assert';
|
|
46
46
|
import 'magic-string';
|
|
47
47
|
import 'strip-literal';
|
|
48
|
-
import './vendor/environments.
|
|
48
|
+
import './vendor/environments.ewIbzajW.js';
|
|
49
49
|
import 'node:console';
|
|
50
50
|
import 'node:readline';
|
|
51
51
|
import 'readline';
|
|
52
52
|
import './vendor/global.L7JRz1qU.js';
|
|
53
|
-
import './chunks/runtime-console.
|
|
53
|
+
import './chunks/runtime-console.hf2msWA9.js';
|
|
54
54
|
import 'node:stream';
|
|
55
|
-
import './vendor/date.
|
|
55
|
+
import './vendor/date.Ns1pGd_X.js';
|
|
56
56
|
import './vendor/tasks.IknbGB2n.js';
|
|
57
57
|
import 'node:module';
|
|
58
58
|
|
|
59
59
|
const cli = cac("vitest");
|
|
60
|
-
cli.version(version).option("-r, --root <path>", "Root path").option("-c, --config <path>", "Path to config file").option("-u, --update", "Update snapshot").option("-w, --watch", "Enable watch mode").option("-t, --testNamePattern <pattern>", "Run tests with full names matching the specified regexp pattern").option("--dir <path>", "Base directory to scan for the test files").option("--ui", "Enable UI").option("--open", "Open UI automatically (default: !process.env.CI))").option("--api [api]", "Serve API, available options: --api.port <port>, --api.host [host] and --api.strictPort").option("--silent", "Silent console output from tests").option("--hideSkippedTests", "Hide logs for skipped tests").option("--reporter <name>", "Specify reporters").option("--outputFile <filename/-s>", "Write test results to a file when supporter reporter is also specified, use cac's dot notation for individual outputs of multiple reporters").option("--coverage", "Enable coverage report").option("--run", "Disable watch mode").option("--mode <name>", "Override Vite mode (default: test)").option("--globals", "Inject apis globally").option("--dom", "Mock browser
|
|
60
|
+
cli.version(version).option("-r, --root <path>", "Root path").option("-c, --config <path>", "Path to config file").option("-u, --update", "Update snapshot").option("-w, --watch", "Enable watch mode").option("-t, --testNamePattern <pattern>", "Run tests with full names matching the specified regexp pattern").option("--dir <path>", "Base directory to scan for the test files").option("--ui", "Enable UI").option("--open", "Open UI automatically (default: !process.env.CI))").option("--api [api]", "Serve API, available options: --api.port <port>, --api.host [host] and --api.strictPort").option("--silent", "Silent console output from tests").option("--hideSkippedTests", "Hide logs for skipped tests").option("--reporter <name>", "Specify reporters").option("--outputFile <filename/-s>", "Write test results to a file when supporter reporter is also specified, use cac's dot notation for individual outputs of multiple reporters").option("--coverage", "Enable coverage report").option("--run", "Disable watch mode").option("--mode <name>", "Override Vite mode (default: test)").option("--globals", "Inject apis globally").option("--dom", "Mock browser API with happy-dom").option("--browser [options]", "Run tests in the browser (default: false)").option("--pool <pool>", "Specify pool, if not running in the browser (default: threads)").option("--poolOptions <options>", "Specify pool options").option("--poolOptions.threads.isolate", "Isolate tests in threads pool (default: true)").option("--poolOptions.forks.isolate", "Isolate tests in forks pool (default: true)").option("--environment <env>", "Specify runner environment, if not running in the browser (default: node)").option("--passWithNoTests", "Pass when no tests found").option("--logHeapUsage", "Show the size of heap for each test").option("--allowOnly", "Allow tests and suites that are marked as only (default: !process.env.CI)").option("--dangerouslyIgnoreUnhandledErrors", "Ignore any unhandled errors that occur").option("--shard <shard>", "Test suite shard to execute in a format of <index>/<count>").option("--changed [since]", "Run tests that are affected by the changed files (default: false)").option("--sequence <options>", "Define in what order to run tests (use --sequence.shuffle to run tests in random order, use --sequence.concurrent to run tests in parallel)").option("--segfaultRetry <times>", "Return tests on segment fault (default: 0)", { default: 0 }).option("--no-color", "Removes colors from the console output").option("--inspect", "Enable Node.js inspector").option("--inspect-brk", "Enable Node.js inspector with break").option("--test-timeout <time>", "Default timeout of a test in milliseconds (default: 5000)").option("--bail <number>", "Stop test execution when given number of tests have failed (default: 0)").option("--retry <times>", "Retry the test specific number of times if it fails (default: 0)").option("--diff <path>", "Path to a diff config that will be used to generate diff interface").option("--expand-snapshot-diff", "Show full diff when snapshot fails").option("--typecheck [options]", "Custom options for typecheck pool").option("--typecheck.enabled", "Enable typechecking alongside tests (default: false)").option("--typecheck.only", "Run only typecheck tests. This automatically enables typecheck (default: false)").option("--project <name>", "The name of the project to run if you are using Vitest workspace feature. This can be repeated for multiple projects: --project=1 --project=2").help();
|
|
61
61
|
cli.command("run [...filters]").action(run);
|
|
62
62
|
cli.command("related [...filters]").action(runRelated);
|
|
63
63
|
cli.command("watch [...filters]").action(watch);
|
|
@@ -98,7 +98,7 @@ async function run(cliFilters, options) {
|
|
|
98
98
|
await start("test", cliFilters, options);
|
|
99
99
|
}
|
|
100
100
|
async function benchmark(cliFilters, options) {
|
|
101
|
-
console.warn(c.yellow("Benchmarking is an experimental feature.\nBreaking changes might not follow
|
|
101
|
+
console.warn(c.yellow("Benchmarking is an experimental feature.\nBreaking changes might not follow SemVer, please pin Vitest's version when using it."));
|
|
102
102
|
await start("benchmark", cliFilters, options);
|
|
103
103
|
}
|
|
104
104
|
function normalizeCliOptions(argv) {
|
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv, UserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { a as ResolvedCoverageOptions, U as UserConfig, C as CoverageV8Options, P as ProjectConfig } from './reporters-
|
|
3
|
+
import { a as ResolvedCoverageOptions, U as UserConfig, C as CoverageV8Options, P as ProjectConfig } from './reporters-vMlHjCdM.js';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import 'vite-node';
|
|
6
6
|
import '@vitest/snapshot';
|
package/dist/coverage.d.ts
CHANGED
package/dist/entry-vm.js
CHANGED
|
@@ -8,7 +8,7 @@ import { setupColors, createColors } from '@vitest/utils';
|
|
|
8
8
|
import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './vendor/index.h0j9y5vy.js';
|
|
9
9
|
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './vendor/coverage.v6aD8iAh.js';
|
|
10
10
|
import { g as getWorkerState } from './vendor/global.L7JRz1qU.js';
|
|
11
|
-
import { i as index } from './vendor/index.
|
|
11
|
+
import { i as index } from './vendor/index.VL3WbvjT.js';
|
|
12
12
|
import { setupCommonEnv } from './browser.js';
|
|
13
13
|
import 'chai';
|
|
14
14
|
import '@vitest/snapshot/environment';
|
|
@@ -21,14 +21,14 @@ import '@vitest/runner/utils';
|
|
|
21
21
|
import './vendor/index.XU72Rmy8.js';
|
|
22
22
|
import 'std-env';
|
|
23
23
|
import './vendor/run-once.X3E7xx3F.js';
|
|
24
|
-
import './vendor/vi.
|
|
24
|
+
import './vendor/vi.JXuS6emb.js';
|
|
25
25
|
import './vendor/_commonjsHelpers.jjO7Zipk.js';
|
|
26
26
|
import '@vitest/expect';
|
|
27
27
|
import '@vitest/snapshot';
|
|
28
28
|
import '@vitest/utils/error';
|
|
29
29
|
import './vendor/tasks.IknbGB2n.js';
|
|
30
30
|
import '@vitest/utils/source-map';
|
|
31
|
-
import './vendor/date.
|
|
31
|
+
import './vendor/date.Ns1pGd_X.js';
|
|
32
32
|
import '@vitest/spy';
|
|
33
33
|
|
|
34
34
|
async function run(files, config, executor) {
|
package/dist/entry.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
2
|
import { startTests } from '@vitest/runner';
|
|
3
3
|
import './vendor/index.XU72Rmy8.js';
|
|
4
|
-
import { a as globalExpect, r as resetModules, v as vi } from './vendor/vi.
|
|
4
|
+
import { a as globalExpect, r as resetModules, v as vi } from './vendor/vi.JXuS6emb.js';
|
|
5
5
|
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './vendor/coverage.v6aD8iAh.js';
|
|
6
6
|
import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './vendor/index.h0j9y5vy.js';
|
|
7
7
|
import { createRequire } from 'node:module';
|
|
@@ -10,7 +10,7 @@ import timers from 'node:timers';
|
|
|
10
10
|
import { isatty } from 'node:tty';
|
|
11
11
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
12
12
|
import { setupColors, createColors, getSafeTimers } from '@vitest/utils';
|
|
13
|
-
import { i as index } from './vendor/index.
|
|
13
|
+
import { i as index } from './vendor/index.VL3WbvjT.js';
|
|
14
14
|
import { setupCommonEnv } from './browser.js';
|
|
15
15
|
import { g as getWorkerState } from './vendor/global.L7JRz1qU.js';
|
|
16
16
|
import 'pathe';
|
|
@@ -23,7 +23,7 @@ import '@vitest/snapshot';
|
|
|
23
23
|
import '@vitest/utils/error';
|
|
24
24
|
import './vendor/tasks.IknbGB2n.js';
|
|
25
25
|
import '@vitest/utils/source-map';
|
|
26
|
-
import './vendor/date.
|
|
26
|
+
import './vendor/date.Ns1pGd_X.js';
|
|
27
27
|
import '@vitest/spy';
|
|
28
28
|
import '@vitest/snapshot/environment';
|
|
29
29
|
import './paths.js';
|
|
@@ -66,7 +66,7 @@ async function setupGlobalEnv(config, { environment }) {
|
|
|
66
66
|
await setupConsoleLogSpy(state);
|
|
67
67
|
}
|
|
68
68
|
async function setupConsoleLogSpy(state) {
|
|
69
|
-
const { createCustomConsole } = await import('./chunks/runtime-console.
|
|
69
|
+
const { createCustomConsole } = await import('./chunks/runtime-console.hf2msWA9.js');
|
|
70
70
|
globalThis.console = createCustomConsole(state);
|
|
71
71
|
}
|
|
72
72
|
async function withEnv({ environment }, options, fn) {
|
package/dist/environments.d.ts
CHANGED
package/dist/environments.js
CHANGED
package/dist/execute.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import vm from 'node:vm';
|
|
2
2
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
3
3
|
import { ViteNodeRunnerOptions } from 'vite-node';
|
|
4
|
-
import { am as PendingSuiteMock, an as MockFactory, ao as MockMap, a2 as WorkerGlobalState, g as RuntimeRPC } from './reporters-
|
|
4
|
+
import { am as PendingSuiteMock, an as MockFactory, ao as MockMap, a2 as WorkerGlobalState, g as RuntimeRPC } from './reporters-vMlHjCdM.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import '@vitest/runner';
|
|
7
7
|
import '@vitest/snapshot';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TaskPopulated, File, TaskResultPack, CancelReason } from '@vitest/runner';
|
|
2
2
|
export { Custom, DoneCallback, ExtendedContext, File, HookCleanupCallback, HookListener, OnTestFailedHandler, RunMode, RuntimeContext, SequenceHooks, SequenceSetupFiles, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task, TaskBase, TaskContext, TaskCustomOptions, TaskMeta, TaskResult, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
|
|
3
|
-
export { b as bench } from './suite-
|
|
3
|
+
export { b as bench } from './suite-vfxzpeqE.js';
|
|
4
4
|
import { ExpectStatic } from '@vitest/expect';
|
|
5
5
|
export { Assertion, AsymmetricMatchersContaining, ExpectStatic, JestAssertion } from '@vitest/expect';
|
|
6
|
-
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, n as RuntimeConfig, f as ProvidedContext, A as AfterSuiteRunMeta, o as UserConsoleLog, R as ResolvedConfig, p as ModuleGraphData, q as Reporter } from './reporters-
|
|
7
|
-
export { K as ApiConfig, a6 as ArgumentsType, a5 as Arrayable, a3 as Awaitable, B as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, D as BuiltinEnvironment, I as CSSModuleScopeStrategy, u as CollectLineNumbers, v as CollectLines, a8 as Constructable, x as Context, _ as ContextRPC, Y as ContextTestEnvironment, af as CoverageIstanbulOptions, b as CoverageOptions, c as CoverageProvider, d as CoverageProviderModule, ae as CoverageReporter, C as CoverageV8Options, ag as CustomProviderOptions, N as DepsOptimizationOptions, E as Environment, L as EnvironmentOptions, aa as EnvironmentReturn, H as HappyDOMOptions, Q as InlineConfig, J as JSDOMOptions, a9 as ModuleCache, a7 as MutableArray, a4 as Nullable, ac as OnServerRestartHandler, y as Pool, z as PoolOptions, P as ProjectConfig, r as RawErrsMap, ad as ReportContext, a0 as ResolveIdFunction, a as ResolvedCoverageOptions, Z as ResolvedTestEnvironment, w as RootAndTarget, X as RunnerRPC, g as RuntimeRPC, O as TransformModePatterns, t as TscErrorInfo, S as TypecheckConfig, U as UserConfig, e as Vitest, G as VitestEnvironment, V as VitestRunMode, ab as VmEnvironmentReturn, $ as WorkerContext, a2 as WorkerGlobalState, a1 as WorkerRPC } from './reporters-
|
|
6
|
+
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, n as RuntimeConfig, f as ProvidedContext, A as AfterSuiteRunMeta, o as UserConsoleLog, R as ResolvedConfig, p as ModuleGraphData, q as Reporter } from './reporters-vMlHjCdM.js';
|
|
7
|
+
export { K as ApiConfig, a6 as ArgumentsType, a5 as Arrayable, a3 as Awaitable, B as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, D as BuiltinEnvironment, I as CSSModuleScopeStrategy, u as CollectLineNumbers, v as CollectLines, a8 as Constructable, x as Context, _ as ContextRPC, Y as ContextTestEnvironment, af as CoverageIstanbulOptions, b as CoverageOptions, c as CoverageProvider, d as CoverageProviderModule, ae as CoverageReporter, C as CoverageV8Options, ag as CustomProviderOptions, N as DepsOptimizationOptions, E as Environment, L as EnvironmentOptions, aa as EnvironmentReturn, H as HappyDOMOptions, Q as InlineConfig, J as JSDOMOptions, a9 as ModuleCache, a7 as MutableArray, a4 as Nullable, ac as OnServerRestartHandler, y as Pool, z as PoolOptions, P as ProjectConfig, r as RawErrsMap, ad as ReportContext, a0 as ResolveIdFunction, a as ResolvedCoverageOptions, Z as ResolvedTestEnvironment, w as RootAndTarget, X as RunnerRPC, g as RuntimeRPC, O as TransformModePatterns, t as TscErrorInfo, S as TypecheckConfig, U as UserConfig, e as Vitest, G as VitestEnvironment, V as VitestRunMode, ab as VmEnvironmentReturn, $ as WorkerContext, a2 as WorkerGlobalState, a1 as WorkerRPC } from './reporters-vMlHjCdM.js';
|
|
8
8
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
9
9
|
export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject, SpyInstance } from '@vitest/spy';
|
|
10
10
|
export { SnapshotEnvironment } from '@vitest/snapshot/environment';
|
|
@@ -351,7 +351,8 @@ declare function waitFor<T>(callback: WaitForCallback<T>, options?: number | Wai
|
|
|
351
351
|
type WaitUntilCallback<T> = () => T | Promise<T>;
|
|
352
352
|
interface WaitUntilOptions extends Pick<WaitForOptions, 'interval' | 'timeout'> {
|
|
353
353
|
}
|
|
354
|
-
|
|
354
|
+
type Truthy<T> = T extends false | '' | 0 | null | undefined ? never : T;
|
|
355
|
+
declare function waitUntil<T>(callback: WaitUntilCallback<T>, options?: number | WaitUntilOptions): Promise<Truthy<T>>;
|
|
355
356
|
|
|
356
357
|
type ESModuleExports = Record<string, unknown>;
|
|
357
358
|
interface VitestUtils {
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
|
|
2
2
|
export { b as bench } from './vendor/benchmark.WVm6DARl.js';
|
|
3
3
|
export { i as isFirstRun, r as runOnce } from './vendor/run-once.X3E7xx3F.js';
|
|
4
|
-
export { c as createExpect, a as expect, v as vi, b as vitest } from './vendor/vi.
|
|
5
|
-
import { d as dist } from './vendor/index.
|
|
6
|
-
export { c as assertType, g as getRunningMode, a as inject, b as isWatchMode } from './vendor/index.
|
|
4
|
+
export { c as createExpect, a as expect, v as vi, b as vitest } from './vendor/vi.JXuS6emb.js';
|
|
5
|
+
import { d as dist } from './vendor/index.VL3WbvjT.js';
|
|
6
|
+
export { c as assertType, g as getRunningMode, a as inject, b as isWatchMode } from './vendor/index.VL3WbvjT.js';
|
|
7
7
|
import * as chai from 'chai';
|
|
8
8
|
export { chai };
|
|
9
9
|
export { assert, should } from 'chai';
|
|
@@ -19,7 +19,7 @@ import '@vitest/snapshot';
|
|
|
19
19
|
import '@vitest/utils/error';
|
|
20
20
|
import './vendor/tasks.IknbGB2n.js';
|
|
21
21
|
import '@vitest/utils/source-map';
|
|
22
|
-
import './vendor/date.
|
|
22
|
+
import './vendor/date.Ns1pGd_X.js';
|
|
23
23
|
import '@vitest/spy';
|
|
24
24
|
|
|
25
25
|
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as VitestRunMode, U as UserConfig, e as Vitest, R as ResolvedConfig, f as ProvidedContext, W as WorkspaceProject, g as RuntimeRPC, T as TestSequencer, h as WorkspaceSpec } from './reporters-
|
|
2
|
-
export { l as BrowserProvider, k as BrowserProviderInitializationOptions, m as BrowserProviderOptions, i as ProcessPool, j as TestSequencerConstructor, s as startVitest } from './reporters-
|
|
1
|
+
import { V as VitestRunMode, U as UserConfig, e as Vitest, R as ResolvedConfig, f as ProvidedContext, W as WorkspaceProject, g as RuntimeRPC, T as TestSequencer, h as WorkspaceSpec } from './reporters-vMlHjCdM.js';
|
|
2
|
+
export { l as BrowserProvider, k as BrowserProviderInitializationOptions, m as BrowserProviderOptions, i as ProcessPool, j as TestSequencerConstructor, s as startVitest } from './reporters-vMlHjCdM.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, Plugin } from 'vite';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import 'vite-node';
|
package/dist/node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BaseSequencer, V as VitestPlugin, a as createMethodsRPC, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor/node.
|
|
1
|
+
export { B as BaseSequencer, V as VitestPlugin, a as createMethodsRPC, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor/node.1xm0UoNi.js';
|
|
2
2
|
import 'pathe';
|
|
3
3
|
import 'vite';
|
|
4
4
|
import 'node:path';
|
|
@@ -40,17 +40,17 @@ import '@vitest/utils/source-map';
|
|
|
40
40
|
import 'local-pkg';
|
|
41
41
|
import 'module';
|
|
42
42
|
import 'acorn-walk';
|
|
43
|
-
import './vendor/reporters.
|
|
44
|
-
import './chunks/runtime-console.
|
|
43
|
+
import './vendor/reporters.pr8MinP9.js';
|
|
44
|
+
import './chunks/runtime-console.hf2msWA9.js';
|
|
45
45
|
import 'node:stream';
|
|
46
46
|
import 'node:console';
|
|
47
|
-
import './vendor/date.
|
|
47
|
+
import './vendor/date.Ns1pGd_X.js';
|
|
48
48
|
import './vendor/tasks.IknbGB2n.js';
|
|
49
49
|
import 'node:module';
|
|
50
50
|
import 'node:crypto';
|
|
51
51
|
import 'assert';
|
|
52
52
|
import 'magic-string';
|
|
53
53
|
import 'strip-literal';
|
|
54
|
-
import './vendor/environments.
|
|
54
|
+
import './vendor/environments.ewIbzajW.js';
|
|
55
55
|
import 'node:readline';
|
|
56
56
|
import 'readline';
|
|
@@ -848,6 +848,7 @@ declare class Vitest {
|
|
|
848
848
|
restartsCount: number;
|
|
849
849
|
runner: ViteNodeRunner;
|
|
850
850
|
private coreWorkspaceProject;
|
|
851
|
+
private resolvedProjects;
|
|
851
852
|
projects: WorkspaceProject[];
|
|
852
853
|
private projectsTestFiles;
|
|
853
854
|
projectFiles: {
|
|
@@ -875,6 +876,7 @@ declare class Vitest {
|
|
|
875
876
|
runFiles(paths: WorkspaceSpec[]): Promise<void>;
|
|
876
877
|
cancelCurrentRun(reason: CancelReason): Promise<void>;
|
|
877
878
|
rerunFiles(files?: string[], trigger?: string): Promise<void>;
|
|
879
|
+
changeProjectName(pattern: string): Promise<void>;
|
|
878
880
|
changeNamePattern(pattern: string, files?: string[], trigger?: string): Promise<void>;
|
|
879
881
|
changeFilenamePattern(pattern: string): Promise<void>;
|
|
880
882
|
rerunFailed(): Promise<void>;
|
|
@@ -1628,13 +1630,14 @@ interface BenchmarkResult extends TaskResult {
|
|
|
1628
1630
|
rank: number;
|
|
1629
1631
|
}
|
|
1630
1632
|
type BenchFunction = (this: Bench) => Promise<void> | void;
|
|
1631
|
-
type
|
|
1633
|
+
type ChainableBenchmarkAPI = ChainableFunction<'skip' | 'only' | 'todo', [
|
|
1632
1634
|
name: string | Function,
|
|
1633
1635
|
fn?: BenchFunction,
|
|
1634
1636
|
options?: Options
|
|
1635
|
-
], void
|
|
1636
|
-
|
|
1637
|
-
|
|
1637
|
+
], void>;
|
|
1638
|
+
type BenchmarkAPI = ChainableBenchmarkAPI & {
|
|
1639
|
+
skipIf(condition: any): ChainableBenchmarkAPI;
|
|
1640
|
+
runIf(condition: any): ChainableBenchmarkAPI;
|
|
1638
1641
|
};
|
|
1639
1642
|
|
|
1640
1643
|
type BuiltinEnvironment = 'node' | 'jsdom' | 'happy-dom' | 'edge-runtime';
|
|
@@ -2250,6 +2253,10 @@ interface UserConfig extends InlineConfig {
|
|
|
2250
2253
|
* @example --shard=2/3
|
|
2251
2254
|
*/
|
|
2252
2255
|
shard?: string;
|
|
2256
|
+
/**
|
|
2257
|
+
* Name of the project or projects to run.
|
|
2258
|
+
*/
|
|
2259
|
+
project?: string | string[];
|
|
2253
2260
|
}
|
|
2254
2261
|
interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters' | 'browser' | 'coverage' | 'testNamePattern' | 'related' | 'api' | 'reporters' | 'resolveSnapshotPath' | 'benchmark' | 'shard' | 'cache' | 'sequence' | 'typecheck' | 'runner' | 'poolOptions' | 'pool'> {
|
|
2255
2262
|
mode: VitestRunMode;
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ay as BaseReporter, aq as BasicReporter, aC as BenchmarkBuiltinReporters, aB as BenchmarkReportsMap, aA as BuiltinReporters, ap as DefaultReporter, ar as DotReporter, ax as HangingProcessReporter, av as JUnitReporter, as as JsonReporter, q as Reporter, az as ReportersMap, aw as TapFlatReporter, au as TapReporter, at as VerboseReporter } from './reporters-
|
|
1
|
+
export { ay as BaseReporter, aq as BasicReporter, aC as BenchmarkBuiltinReporters, aB as BenchmarkReportsMap, aA as BuiltinReporters, ap as DefaultReporter, ar as DotReporter, ax as HangingProcessReporter, av as JUnitReporter, as as JsonReporter, q as Reporter, az as ReportersMap, aw as TapFlatReporter, au as TapReporter, at as VerboseReporter } from './reporters-vMlHjCdM.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
package/dist/reporters.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { f as BasicReporter, B as BenchmarkReportsMap, D as DefaultReporter, g as DotReporter, H as HangingProcessReporter, h as JUnitReporter, J as JsonReporter, R as ReportersMap, i as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/reporters.
|
|
1
|
+
export { f as BasicReporter, B as BenchmarkReportsMap, D as DefaultReporter, g as DotReporter, H as HangingProcessReporter, h as JUnitReporter, J as JsonReporter, R as ReportersMap, i as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/reporters.pr8MinP9.js';
|
|
2
2
|
import 'node:perf_hooks';
|
|
3
3
|
import 'picocolors';
|
|
4
4
|
import './vendor/index.XU72Rmy8.js';
|
|
@@ -7,11 +7,11 @@ import 'std-env';
|
|
|
7
7
|
import '@vitest/runner/utils';
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import './vendor/global.L7JRz1qU.js';
|
|
10
|
-
import './chunks/runtime-console.
|
|
10
|
+
import './chunks/runtime-console.hf2msWA9.js';
|
|
11
11
|
import 'node:stream';
|
|
12
12
|
import 'node:console';
|
|
13
13
|
import 'node:path';
|
|
14
|
-
import './vendor/date.
|
|
14
|
+
import './vendor/date.Ns1pGd_X.js';
|
|
15
15
|
import './vendor/base._79unx2z.js';
|
|
16
16
|
import './vendor/tasks.IknbGB2n.js';
|
|
17
17
|
import 'node:fs';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VitestRunner, VitestRunnerImportSource, Suite, Test, CancelReason, Custom, TaskContext, ExtendedContext } from '@vitest/runner';
|
|
2
|
-
import { R as ResolvedConfig } from './reporters-
|
|
2
|
+
import { R as ResolvedConfig } from './reporters-vMlHjCdM.js';
|
|
3
3
|
import * as tinybench from 'tinybench';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import 'vite-node';
|
package/dist/runners.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
|
|
2
|
-
import { g as getSnapshotClient, c as createExpect, v as vi } from './vendor/vi.
|
|
2
|
+
import { g as getSnapshotClient, c as createExpect, v as vi } from './vendor/vi.JXuS6emb.js';
|
|
3
3
|
import './vendor/index.XU72Rmy8.js';
|
|
4
4
|
import { a as rpc } from './vendor/rpc.Bl-ysZIr.js';
|
|
5
5
|
import { g as getFullName } from './vendor/tasks.IknbGB2n.js';
|
|
@@ -13,7 +13,7 @@ import './vendor/_commonjsHelpers.jjO7Zipk.js';
|
|
|
13
13
|
import '@vitest/snapshot';
|
|
14
14
|
import '@vitest/utils/error';
|
|
15
15
|
import '@vitest/utils/source-map';
|
|
16
|
-
import './vendor/date.
|
|
16
|
+
import './vendor/date.Ns1pGd_X.js';
|
|
17
17
|
import '@vitest/spy';
|
|
18
18
|
import 'pathe';
|
|
19
19
|
import 'std-env';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Custom } from '@vitest/runner';
|
|
2
2
|
import '@vitest/runner/utils';
|
|
3
|
-
import { ak as BenchFunction, al as BenchmarkAPI } from './reporters-
|
|
3
|
+
import { ak as BenchFunction, al as BenchmarkAPI } from './reporters-vMlHjCdM.js';
|
|
4
4
|
import { Options } from 'tinybench';
|
|
5
5
|
|
|
6
6
|
declare function getBenchOptions(key: Custom): Options;
|
package/dist/suite.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createTaskCollector, getCurrentSuite, getFn, setFn } from '@vitest/runner';
|
|
2
2
|
export { createChainable } from '@vitest/runner/utils';
|
|
3
|
-
export { g as getBenchFn, a as getBenchOptions } from './suite-
|
|
4
|
-
import './reporters-
|
|
3
|
+
export { g as getBenchFn, a as getBenchOptions } from './suite-vfxzpeqE.js';
|
|
4
|
+
import './reporters-vMlHjCdM.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import 'vite-node';
|
|
7
7
|
import '@vitest/snapshot';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
|
|
2
2
|
import { b as bench } from './benchmark.WVm6DARl.js';
|
|
3
3
|
import { i as isFirstRun, r as runOnce } from './run-once.X3E7xx3F.js';
|
|
4
|
-
import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.
|
|
4
|
+
import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.JXuS6emb.js';
|
|
5
5
|
import { g as getWorkerState } from './global.L7JRz1qU.js';
|
|
6
6
|
import * as chai from 'chai';
|
|
7
7
|
import { assert, should } from 'chai';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolve, normalize } from 'pathe';
|
|
2
2
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
3
|
-
import { e as environments } from './environments.
|
|
3
|
+
import { e as environments } from './environments.ewIbzajW.js';
|
|
4
4
|
|
|
5
5
|
function isBuiltinEnvironment(env) {
|
|
6
6
|
return env in environments;
|
|
@@ -38,12 +38,12 @@ import { isCI, provider as provider$1 } from 'std-env';
|
|
|
38
38
|
import ge from 'module';
|
|
39
39
|
import { ancestor, simple, findNodeAround } from 'acorn-walk';
|
|
40
40
|
import { generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, getTasks, hasFailed } from '@vitest/runner/utils';
|
|
41
|
-
import { R as ReportersMap, B as BenchmarkReportsMap, s as stringWidth, a as ansiStyles, b as stripAnsi, e as eastAsianWidth, d as divider, F as F_POINTER, c as cliTruncate } from './reporters.
|
|
41
|
+
import { R as ReportersMap, B as BenchmarkReportsMap, s as stringWidth, a as ansiStyles, b as stripAnsi, e as eastAsianWidth, d as divider, F as F_POINTER, c as cliTruncate } from './reporters.pr8MinP9.js';
|
|
42
42
|
import crypto, { createHash } from 'node:crypto';
|
|
43
43
|
import require$$0$3 from 'assert';
|
|
44
44
|
import MagicString from 'magic-string';
|
|
45
45
|
import { stripLiteral } from 'strip-literal';
|
|
46
|
-
import { g as getEnvPackageName } from './environments.
|
|
46
|
+
import { g as getEnvPackageName } from './environments.ewIbzajW.js';
|
|
47
47
|
import readline from 'node:readline';
|
|
48
48
|
import require$$0$4 from 'readline';
|
|
49
49
|
|
|
@@ -62,7 +62,7 @@ function _mergeNamespaces(n, m) {
|
|
|
62
62
|
return Object.freeze(n);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
var version$1 = "1.0.0-beta.
|
|
65
|
+
var version$1 = "1.0.0-beta.6";
|
|
66
66
|
|
|
67
67
|
const __dirname$1 = url.fileURLToPath(new URL(".", import.meta.url));
|
|
68
68
|
async function ensurePackageInstalled(dependency, root) {
|
|
@@ -5253,7 +5253,7 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
5253
5253
|
resolved.typecheck ?? (resolved.typecheck = {});
|
|
5254
5254
|
(_D = resolved.typecheck).enabled ?? (_D.enabled = false);
|
|
5255
5255
|
if (resolved.typecheck.enabled)
|
|
5256
|
-
console.warn(c.yellow("Testing types with tsc and vue-tsc is an experimental feature.\nBreaking changes might not follow
|
|
5256
|
+
console.warn(c.yellow("Testing types with tsc and vue-tsc is an experimental feature.\nBreaking changes might not follow SemVer, please pin Vitest's version when using it."));
|
|
5257
5257
|
resolved.browser ?? (resolved.browser = {});
|
|
5258
5258
|
(_E = resolved.browser).enabled ?? (_E.enabled = false);
|
|
5259
5259
|
(_F = resolved.browser).headless ?? (_F.headless = isCI);
|
|
@@ -6287,7 +6287,7 @@ createLogUpdate(process$2.stdout);
|
|
|
6287
6287
|
|
|
6288
6288
|
createLogUpdate(process$2.stderr);
|
|
6289
6289
|
|
|
6290
|
-
var version = "1.0.0-beta.
|
|
6290
|
+
var version = "1.0.0-beta.6";
|
|
6291
6291
|
|
|
6292
6292
|
async function printError(error, project, options) {
|
|
6293
6293
|
const { showCodeFrame = true, fullStack = false, type } = options;
|
|
@@ -6571,6 +6571,9 @@ class Logger {
|
|
|
6571
6571
|
const comma = c.dim(", ");
|
|
6572
6572
|
if (filters == null ? void 0 : filters.length)
|
|
6573
6573
|
this.console.error(c.dim("filter: ") + c.yellow(filters.join(comma)));
|
|
6574
|
+
const projectsFilter = toArray(config.project);
|
|
6575
|
+
if (projectsFilter.length)
|
|
6576
|
+
this.console.error(c.dim("projects: ") + c.yellow(projectsFilter.join(comma)));
|
|
6574
6577
|
this.ctx.projects.forEach((project) => {
|
|
6575
6578
|
const config2 = project.config;
|
|
6576
6579
|
const name = project.getName();
|
|
@@ -7449,7 +7452,8 @@ ${c.red(divider(c.bold(c.inverse(" Error during global setup "))))}`);
|
|
|
7449
7452
|
return testFiles.filter((t) => {
|
|
7450
7453
|
const testFile = relative(dir, t);
|
|
7451
7454
|
return filters.some((f) => {
|
|
7452
|
-
|
|
7455
|
+
const relativePath = f.endsWith("/") ? join(relative(dir, f), "/") : relative(dir, f);
|
|
7456
|
+
return testFile.includes(f) || testFile.includes(relativePath);
|
|
7453
7457
|
});
|
|
7454
7458
|
});
|
|
7455
7459
|
}
|
|
@@ -7478,7 +7482,7 @@ ${c.red(divider(c.bold(c.inverse(" Error during global setup "))))}`);
|
|
|
7478
7482
|
async setServer(options, server) {
|
|
7479
7483
|
this.config = resolveConfig(this.ctx.mode, options, server.config);
|
|
7480
7484
|
this.server = server;
|
|
7481
|
-
this.vitenode = new ViteNodeServer(server, this.config);
|
|
7485
|
+
this.vitenode = new ViteNodeServer(server, this.config.server);
|
|
7482
7486
|
const node = this.vitenode;
|
|
7483
7487
|
this.runner = new ViteNodeRunner({
|
|
7484
7488
|
root: server.config.root,
|
|
@@ -7595,6 +7599,7 @@ class Vitest {
|
|
|
7595
7599
|
restartsCount = 0;
|
|
7596
7600
|
runner = void 0;
|
|
7597
7601
|
coreWorkspaceProject;
|
|
7602
|
+
resolvedProjects = [];
|
|
7598
7603
|
projects = [];
|
|
7599
7604
|
projectsTestFiles = /* @__PURE__ */ new Map();
|
|
7600
7605
|
projectFiles;
|
|
@@ -7661,7 +7666,12 @@ class Vitest {
|
|
|
7661
7666
|
} catch {
|
|
7662
7667
|
}
|
|
7663
7668
|
await Promise.all(this._onSetServer.map((fn) => fn()));
|
|
7664
|
-
|
|
7669
|
+
const projects = await this.resolveWorkspace(cliOptions);
|
|
7670
|
+
this.projects = projects;
|
|
7671
|
+
this.resolvedProjects = projects;
|
|
7672
|
+
const filteredProjects = toArray(resolved.project);
|
|
7673
|
+
if (filteredProjects.length)
|
|
7674
|
+
this.projects = this.projects.filter((p) => filteredProjects.includes(p.getName()));
|
|
7665
7675
|
if (!this.coreWorkspaceProject)
|
|
7666
7676
|
this.coreWorkspaceProject = WorkspaceProject.createBasicProject(this);
|
|
7667
7677
|
if (this.config.testNamePattern)
|
|
@@ -7934,6 +7944,15 @@ class Vitest {
|
|
|
7934
7944
|
await this.reportCoverage(!trigger);
|
|
7935
7945
|
await this.report("onWatcherStart", this.state.getFiles(files));
|
|
7936
7946
|
}
|
|
7947
|
+
async changeProjectName(pattern) {
|
|
7948
|
+
if (pattern === "")
|
|
7949
|
+
delete this.configOverride.project;
|
|
7950
|
+
else
|
|
7951
|
+
this.configOverride.project = pattern;
|
|
7952
|
+
this.projects = this.resolvedProjects.filter((p) => p.getName() === pattern);
|
|
7953
|
+
const files = (await this.globTestFiles()).map(([, file]) => file);
|
|
7954
|
+
await this.rerunFiles(files, "change project filter");
|
|
7955
|
+
}
|
|
7937
7956
|
async changeNamePattern(pattern, files = this.state.getFilepaths(), trigger) {
|
|
7938
7957
|
if (pattern === "")
|
|
7939
7958
|
this.filenamePattern = void 0;
|
|
@@ -14634,6 +14653,7 @@ const keys = [
|
|
|
14634
14653
|
["u", "update snapshot"],
|
|
14635
14654
|
["p", "filter by a filename"],
|
|
14636
14655
|
["t", "filter by a test name regex pattern"],
|
|
14656
|
+
["w", "filter by a project name"],
|
|
14637
14657
|
["q", "quit"]
|
|
14638
14658
|
];
|
|
14639
14659
|
const cancelKeys = ["space", "c", "h", ...keys.map((key) => key[0]).flat()];
|
|
@@ -14681,6 +14701,8 @@ function registerConsoleShortcuts(ctx) {
|
|
|
14681
14701
|
return ctx.rerunFiles();
|
|
14682
14702
|
if (name === "f")
|
|
14683
14703
|
return ctx.rerunFailed();
|
|
14704
|
+
if (name === "w")
|
|
14705
|
+
return inputProjectName();
|
|
14684
14706
|
if (name === "t")
|
|
14685
14707
|
return inputNamePattern();
|
|
14686
14708
|
if (name === "p")
|
|
@@ -14701,6 +14723,17 @@ function registerConsoleShortcuts(ctx) {
|
|
|
14701
14723
|
on();
|
|
14702
14724
|
await ctx.changeNamePattern(filter.trim(), void 0, "change pattern");
|
|
14703
14725
|
}
|
|
14726
|
+
async function inputProjectName() {
|
|
14727
|
+
off();
|
|
14728
|
+
const { filter = "" } = await prompt([{
|
|
14729
|
+
name: "filter",
|
|
14730
|
+
type: "text",
|
|
14731
|
+
message: "Input a single project name",
|
|
14732
|
+
initial: toArray(ctx.configOverride.project)[0] || ""
|
|
14733
|
+
}]);
|
|
14734
|
+
on();
|
|
14735
|
+
await ctx.changeProjectName(filter.trim());
|
|
14736
|
+
}
|
|
14704
14737
|
async function inputFilePattern() {
|
|
14705
14738
|
off();
|
|
14706
14739
|
const { filter = "" } = await prompt([{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
2
|
import c from 'picocolors';
|
|
3
3
|
import { b as isNode, c as relativePath } from './index.XU72Rmy8.js';
|
|
4
|
-
import { UNKNOWN_TEST_ID } from '../chunks/runtime-console.
|
|
4
|
+
import { UNKNOWN_TEST_ID } from '../chunks/runtime-console.hf2msWA9.js';
|
|
5
5
|
import { isAbsolute, relative, dirname, basename, resolve } from 'pathe';
|
|
6
|
-
import { s as slash } from './base._79unx2z.js';
|
|
6
|
+
import { s as slash, t as toArray } from './base._79unx2z.js';
|
|
7
7
|
import { g as getFullName, h as hasFailedSnapshot } from './tasks.IknbGB2n.js';
|
|
8
8
|
import { getSafeTimers, notNullish } from '@vitest/utils';
|
|
9
9
|
import { isCI } from 'std-env';
|
|
@@ -354,17 +354,19 @@ class BaseReporter {
|
|
|
354
354
|
` : "";
|
|
355
355
|
const TESTNAME_PATTERN = this.ctx.configOverride.testNamePattern ? `${BADGE_PADDING} ${c.dim("Test name pattern: ")}${c.blue(String(this.ctx.configOverride.testNamePattern))}
|
|
356
356
|
` : "";
|
|
357
|
-
|
|
357
|
+
const PROJECT_FILTER = this.ctx.configOverride.project ? `${BADGE_PADDING} ${c.dim("Project name: ")}${c.blue(toArray(this.ctx.configOverride.project).join(", "))}
|
|
358
|
+
` : "";
|
|
359
|
+
if (files.length > 1 || !files.length) {
|
|
358
360
|
this.ctx.logger.clearFullScreen(`
|
|
359
361
|
${BADGE}${TRIGGER}
|
|
360
|
-
${FILENAME_PATTERN}${TESTNAME_PATTERN}`);
|
|
362
|
+
${PROJECT_FILTER}${FILENAME_PATTERN}${TESTNAME_PATTERN}`);
|
|
361
363
|
this._lastRunCount = 0;
|
|
362
364
|
} else if (files.length === 1) {
|
|
363
365
|
const rerun = this._filesInWatchMode.get(files[0]) ?? 1;
|
|
364
366
|
this._lastRunCount = rerun;
|
|
365
367
|
this.ctx.logger.clearFullScreen(`
|
|
366
368
|
${BADGE}${TRIGGER} ${c.blue(`x${rerun}`)}
|
|
367
|
-
${FILENAME_PATTERN}${TESTNAME_PATTERN}`);
|
|
369
|
+
${PROJECT_FILTER}${FILENAME_PATTERN}${TESTNAME_PATTERN}`);
|
|
368
370
|
}
|
|
369
371
|
this._timeStart = /* @__PURE__ */ new Date();
|
|
370
372
|
this.start = performance.now();
|
|
@@ -9,7 +9,7 @@ import { g as getFullName } from './tasks.IknbGB2n.js';
|
|
|
9
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 './date.
|
|
12
|
+
import { R as RealDate, r as resetDate, m as mockDate } from './date.Ns1pGd_X.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
|
@@ -7,11 +7,11 @@ 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
9
|
import { distDir } from './paths.js';
|
|
10
|
-
import { l as loadEnvironment } from './vendor/loader.
|
|
10
|
+
import { l as loadEnvironment } from './vendor/loader.-JDdZ5RJ.js';
|
|
11
11
|
import { b as startVitestExecutor } from './vendor/execute.aMjV5C9u.js';
|
|
12
|
-
import { createCustomConsole } from './chunks/runtime-console.
|
|
12
|
+
import { createCustomConsole } from './chunks/runtime-console.hf2msWA9.js';
|
|
13
13
|
import { c as createSafeRpc } from './vendor/rpc.Bl-ysZIr.js';
|
|
14
|
-
import './vendor/environments.
|
|
14
|
+
import './vendor/environments.ewIbzajW.js';
|
|
15
15
|
import 'node:console';
|
|
16
16
|
import 'local-pkg';
|
|
17
17
|
import 'vite-node/utils';
|
|
@@ -23,7 +23,7 @@ import 'node:path';
|
|
|
23
23
|
import 'node:module';
|
|
24
24
|
import 'vite-node/constants';
|
|
25
25
|
import 'node:stream';
|
|
26
|
-
import './vendor/date.
|
|
26
|
+
import './vendor/date.Ns1pGd_X.js';
|
|
27
27
|
import './vendor/global.L7JRz1qU.js';
|
|
28
28
|
|
|
29
29
|
const entryFile = pathToFileURL(resolve(distDir, "entry-vm.js")).href;
|
package/dist/worker.js
CHANGED
|
@@ -2,13 +2,13 @@ import { performance } from 'node:perf_hooks';
|
|
|
2
2
|
import { c as createBirpc } from './vendor/index.cAUulNDf.js';
|
|
3
3
|
import { workerId } from 'tinypool';
|
|
4
4
|
import { g as getWorkerState } from './vendor/global.L7JRz1qU.js';
|
|
5
|
-
import { l as loadEnvironment } from './vendor/loader.
|
|
5
|
+
import { l as loadEnvironment } from './vendor/loader.-JDdZ5RJ.js';
|
|
6
6
|
import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor/execute.aMjV5C9u.js';
|
|
7
7
|
import { s as setupInspect } from './vendor/inspector.lFAeuaAt.js';
|
|
8
8
|
import { r as rpcDone, c as createSafeRpc } from './vendor/rpc.Bl-ysZIr.js';
|
|
9
9
|
import 'pathe';
|
|
10
10
|
import 'vite-node/client';
|
|
11
|
-
import './vendor/environments.
|
|
11
|
+
import './vendor/environments.ewIbzajW.js';
|
|
12
12
|
import 'node:console';
|
|
13
13
|
import 'local-pkg';
|
|
14
14
|
import 'node:url';
|
package/import-meta.d.ts
ADDED
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.6",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,6 +41,9 @@
|
|
|
41
41
|
"./importMeta": {
|
|
42
42
|
"types": "./importMeta.d.ts"
|
|
43
43
|
},
|
|
44
|
+
"./import-meta": {
|
|
45
|
+
"types": "./import-meta.d.ts"
|
|
46
|
+
},
|
|
44
47
|
"./node": {
|
|
45
48
|
"types": "./dist/node.d.ts",
|
|
46
49
|
"default": "./dist/node.js"
|
|
@@ -138,18 +141,18 @@
|
|
|
138
141
|
"magic-string": "^0.30.5",
|
|
139
142
|
"pathe": "^1.1.1",
|
|
140
143
|
"picocolors": "^1.0.0",
|
|
141
|
-
"std-env": "^3.
|
|
144
|
+
"std-env": "^3.5.0",
|
|
142
145
|
"strip-literal": "^1.3.0",
|
|
143
146
|
"tinybench": "^2.5.1",
|
|
144
147
|
"tinypool": "^0.8.1",
|
|
145
148
|
"vite": "^5.0.0-beta.19 || ^5.0.0",
|
|
146
149
|
"why-is-node-running": "^2.2.2",
|
|
147
|
-
"@vitest/expect": "1.0.0-beta.
|
|
148
|
-
"@vitest/
|
|
149
|
-
"@vitest/
|
|
150
|
-
"@vitest/
|
|
151
|
-
"
|
|
152
|
-
"
|
|
150
|
+
"@vitest/expect": "1.0.0-beta.6",
|
|
151
|
+
"@vitest/runner": "1.0.0-beta.6",
|
|
152
|
+
"@vitest/spy": "1.0.0-beta.6",
|
|
153
|
+
"@vitest/snapshot": "1.0.0-beta.6",
|
|
154
|
+
"vite-node": "1.0.0-beta.6",
|
|
155
|
+
"@vitest/utils": "1.0.0-beta.6"
|
|
153
156
|
},
|
|
154
157
|
"devDependencies": {
|
|
155
158
|
"@ampproject/remapping": "^2.2.1",
|
|
@@ -159,7 +162,7 @@
|
|
|
159
162
|
"@types/estree": "^1.0.5",
|
|
160
163
|
"@types/istanbul-lib-coverage": "^2.0.6",
|
|
161
164
|
"@types/istanbul-reports": "^3.0.4",
|
|
162
|
-
"@types/jsdom": "^21.1.
|
|
165
|
+
"@types/jsdom": "^21.1.6",
|
|
163
166
|
"@types/micromatch": "^4.0.5",
|
|
164
167
|
"@types/prompts": "^2.4.8",
|
|
165
168
|
"@types/sinonjs__fake-timers": "^8.1.5",
|