Comparing version 0.29.2 to 0.32.2
export { startTests } from '@vitest/runner'; | ||
import { a as ResolvedConfig } from './types-7cd96283.js'; | ||
export { s as setupSnapshotEnvironment } from './env-afee91f0.js'; | ||
import { a as ResolvedConfig, a0 as CoverageOptions, Y as CoverageProvider, _ as CoverageProviderModule } from './types-2b1c412e.js'; | ||
import '@vitest/snapshot'; | ||
import '@vitest/expect'; | ||
import 'vite'; | ||
import '@vitest/runner/types'; | ||
import '@vitest/runner/utils'; | ||
@@ -11,10 +10,21 @@ import '@vitest/utils'; | ||
import 'vite-node/client'; | ||
import '@vitest/snapshot/manager'; | ||
import 'vite-node/server'; | ||
import 'node:worker_threads'; | ||
import 'vite-node'; | ||
import 'source-map'; | ||
import 'node:fs'; | ||
import 'chai'; | ||
declare function setupCommonEnv(config: ResolvedConfig): Promise<void>; | ||
export { setupCommonEnv }; | ||
interface Loader { | ||
executeId: (id: string) => Promise<{ | ||
default: CoverageProviderModule; | ||
}>; | ||
} | ||
declare function getCoverageProvider(options: CoverageOptions | undefined, loader: Loader): Promise<CoverageProvider | null>; | ||
declare function startCoverageInsideWorker(options: CoverageOptions | undefined, loader: Loader): Promise<unknown>; | ||
declare function takeCoverageInsideWorker(options: CoverageOptions | undefined, loader: Loader): Promise<unknown>; | ||
declare function stopCoverageInsideWorker(options: CoverageOptions | undefined, loader: Loader): Promise<unknown>; | ||
export { getCoverageProvider, setupCommonEnv, startCoverageInsideWorker, stopCoverageInsideWorker, takeCoverageInsideWorker }; |
export { startTests } from '@vitest/runner'; | ||
export { s as setupCommonEnv } from './chunk-runtime-setup.992bb661.js'; | ||
export { s as setupSnapshotEnvironment } from './chunk-snapshot-env.a347d647.js'; | ||
export { s as setupCommonEnv } from './vendor-setup.common.f1cf2231.js'; | ||
export { g as getCoverageProvider, a as startCoverageInsideWorker, s as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './vendor-coverage.de2180ed.js'; | ||
import '@vitest/utils'; | ||
import './chunk-integrations-run-once.9012f759.js'; | ||
import './chunk-utils-global.727b6d25.js'; | ||
import './vendor-run-once.69ce7172.js'; | ||
import './vendor-index.fad2598b.js'; | ||
import 'pathe'; | ||
import './chunk-utils-env.860d90c2.js'; | ||
import 'std-env'; | ||
import '@vitest/runner/utils'; | ||
import './vendor-global.6795f91f.js'; |
@@ -0,6 +1,8 @@ | ||
import { performance } from 'node:perf_hooks'; | ||
import v8 from 'node:v8'; | ||
import { c as createBirpc } from './vendor-index.783e7f3e.js'; | ||
import { c as createBirpc } from './vendor-index.87ab04c3.js'; | ||
import { parseRegexp } from '@vitest/utils'; | ||
import { s as startViteNode, m as moduleCache, a as mockMap } from './chunk-runtime-mocker.a048e92d.js'; | ||
import { a as rpcDone } from './chunk-runtime-rpc.971b3848.js'; | ||
import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.001ae440.js'; | ||
import { a as rpcDone } from './vendor-rpc.4d3d7a54.js'; | ||
import { s as setupInspect } from './vendor-inspector.47fc8cbb.js'; | ||
import 'node:url'; | ||
@@ -10,17 +12,8 @@ import 'vite-node/client'; | ||
import 'pathe'; | ||
import './vendor-index.bdee400f.js'; | ||
import 'acorn'; | ||
import 'node:module'; | ||
import '@vitest/utils/error'; | ||
import './vendor-global.6795f91f.js'; | ||
import './vendor-paths.84fc7a99.js'; | ||
import 'node:fs'; | ||
import 'node:assert'; | ||
import 'node:process'; | ||
import 'node:path'; | ||
import 'node:util'; | ||
import '@vitest/runner/utils'; | ||
import './chunk-utils-global.727b6d25.js'; | ||
import './chunk-utils-env.860d90c2.js'; | ||
import 'std-env'; | ||
import './chunk-constants.797d3ebf.js'; | ||
import './chunk-utils-base.81f83dbd.js'; | ||
import '@vitest/spy'; | ||
import 'node:module'; | ||
@@ -31,2 +24,7 @@ function init(ctx) { | ||
process.env.VITEST_POOL_ID = "1"; | ||
let setCancel = (_reason) => { | ||
}; | ||
const onCancel = new Promise((resolve) => { | ||
setCancel = resolve; | ||
}); | ||
globalThis.__vitest_environment__ = config.environment; | ||
@@ -38,6 +36,13 @@ globalThis.__vitest_worker__ = { | ||
mockMap, | ||
onCancel, | ||
durations: { | ||
environment: 0, | ||
prepare: performance.now() | ||
}, | ||
rpc: createBirpc( | ||
{}, | ||
{ | ||
eventNames: ["onUserConsoleLog", "onFinished", "onCollected", "onWorkerExit"], | ||
onCancel: setCancel | ||
}, | ||
{ | ||
eventNames: ["onUserConsoleLog", "onFinished", "onCollected", "onWorkerExit", "onCancel"], | ||
serialize: v8.serialize, | ||
@@ -75,6 +80,11 @@ deserialize: (v) => v8.deserialize(Buffer.from(v)), | ||
async function run(ctx) { | ||
init(ctx); | ||
const { run: run2, executor } = await startViteNode(ctx); | ||
await run2(ctx.files, ctx.config, ctx.environment, executor); | ||
await rpcDone(); | ||
const inspectorCleanup = setupInspect(ctx.config); | ||
try { | ||
init(ctx); | ||
const { run: run2, executor } = await startViteNode(ctx); | ||
await run2(ctx.files, ctx.config, ctx.environment, executor); | ||
await rpcDone(); | ||
} finally { | ||
inspectorCleanup(); | ||
} | ||
} | ||
@@ -81,0 +91,0 @@ const procesExit = process.exit; |
@@ -1,5 +0,5 @@ | ||
import { fileURLToPath } from 'url'; | ||
import { fileURLToPath } from 'node:url'; | ||
import c from 'picocolors'; | ||
import { e as execa } from './vendor-index.2cbcdd1e.js'; | ||
import { E as EXIT_CODE_RESTART } from './chunk-constants.797d3ebf.js'; | ||
import { e as execa } from './vendor-index.c1e09929.js'; | ||
import { E as EXIT_CODE_RESTART } from './vendor-constants.538d9b49.js'; | ||
import 'node:buffer'; | ||
@@ -11,19 +11,15 @@ import 'node:path'; | ||
import 'path'; | ||
import './vendor-_commonjsHelpers.addc3445.js'; | ||
import './vendor-_commonjsHelpers.76cdd49e.js'; | ||
import 'fs'; | ||
import 'node:url'; | ||
import 'node:os'; | ||
import 'assert'; | ||
import 'events'; | ||
import 'node:fs'; | ||
import 'buffer'; | ||
import 'stream'; | ||
import 'util'; | ||
import 'pathe'; | ||
import './chunk-utils-env.860d90c2.js'; | ||
import 'std-env'; | ||
import 'node:util'; | ||
const ENTRY = new URL("./cli.js", import.meta.url); | ||
const NODE_ARGS = [ | ||
"--inspect", | ||
"--inspect-brk", | ||
"--trace-deprecation", | ||
@@ -30,0 +26,0 @@ "--experimental-wasm-threads", |
import { normalize } from 'pathe'; | ||
import cac from 'cac'; | ||
import c from 'picocolors'; | ||
import { v as version, s as startVitest, d as divider } from './chunk-node-pkg.208acffb.js'; | ||
import './chunk-constants.797d3ebf.js'; | ||
import { v as version, s as startVitest, d as divider } from './vendor-cli-api.f9adf98c.js'; | ||
import './vendor-index.fad2598b.js'; | ||
import { t as toArray } from './vendor-index.87ab04c3.js'; | ||
import './vendor-constants.538d9b49.js'; | ||
import './vendor-coverage.de2180ed.js'; | ||
import './vendor-index.75f2b63d.js'; | ||
import 'node:console'; | ||
import 'local-pkg'; | ||
import 'node:url'; | ||
import './chunk-utils-env.860d90c2.js'; | ||
import 'std-env'; | ||
import './chunk-integrations-coverage.e0a6acd2.js'; | ||
import 'local-pkg'; | ||
import './chunk-env-node.affdd278.js'; | ||
import 'node:console'; | ||
import 'vite'; | ||
@@ -23,38 +24,37 @@ import 'node:path'; | ||
import 'fs'; | ||
import './vendor-_commonjsHelpers.addc3445.js'; | ||
import './vendor-_commonjsHelpers.76cdd49e.js'; | ||
import 'vite-node/utils'; | ||
import 'vite-node/client'; | ||
import '@vitest/snapshot/manager'; | ||
import 'vite-node/server'; | ||
import './chunk-utils-global.727b6d25.js'; | ||
import './vendor-paths.84fc7a99.js'; | ||
import 'node:v8'; | ||
import 'node:child_process'; | ||
import 'node:worker_threads'; | ||
import 'node:os'; | ||
import 'tinypool'; | ||
import '@vitest/utils'; | ||
import 'node:perf_hooks'; | ||
import './vendor-tasks.f9d75aed.js'; | ||
import '@vitest/runner/utils'; | ||
import '@vitest/utils'; | ||
import 'node:fs/promises'; | ||
import './vendor-index.2cbcdd1e.js'; | ||
import 'node:module'; | ||
import 'node:crypto'; | ||
import './vendor-index.c1e09929.js'; | ||
import 'node:buffer'; | ||
import 'node:child_process'; | ||
import 'child_process'; | ||
import 'node:os'; | ||
import 'assert'; | ||
import 'buffer'; | ||
import 'source-map'; | ||
import 'node:util'; | ||
import 'node:fs/promises'; | ||
import 'module'; | ||
import 'acorn'; | ||
import 'acorn-walk'; | ||
import 'node:v8'; | ||
import './vendor-index.783e7f3e.js'; | ||
import './chunk-utils-base.81f83dbd.js'; | ||
import 'node:worker_threads'; | ||
import 'tinypool'; | ||
import 'perf_hooks'; | ||
import './chunk-utils-tasks.b41c8284.js'; | ||
import 'crypto'; | ||
import 'vite-node/utils'; | ||
import '@vitest/utils/diff'; | ||
import 'node:module'; | ||
import 'node:crypto'; | ||
import './chunk-magic-string.3a794426.js'; | ||
import 'magic-string'; | ||
import 'strip-literal'; | ||
import 'node:readline'; | ||
import 'readline'; | ||
import './vendor-global.6795f91f.js'; | ||
const cli = cac("vitest"); | ||
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("--threads", "Enabled threads (default: true)").option("--single-thread", "Run tests inside a single thread, requires --threads (default: false)").option("--silent", "Silent console output from tests").option("--isolate", "Isolate environment for each test file (default: true)").option("--reporter <name>", "Specify reporters").option("--outputDiffMaxSize <length>", "Object diff output max size (default: 10000)").option("--outputDiffMaxLines <length>", "Max lines in diff output window (default: 50)").option("--outputTruncateLength <length>", "Diff output line length (default: 80)").option("--outputDiffLines <lines>", "Number of lines in single diff (default: 15)").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", "Run tests in browser").option("--environment <env>", "Specify runner environment (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)").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").help(); | ||
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("--threads", "Enabled threads (default: true)").option("--single-thread", "Run tests inside a single thread, requires --threads (default: false)").option("--silent", "Silent console output from tests").option("--hideSkippedTests", "Hide logs for skipped tests").option("--isolate", "Isolate environment for each test file (default: true)").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("--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)").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 }).help(); | ||
cli.command("run [...filters]").action(run); | ||
@@ -67,3 +67,19 @@ cli.command("related [...filters]").action(runRelated); | ||
cli.command("[...filters]").action((filters, options) => start("test", filters, options)); | ||
cli.parse(); | ||
try { | ||
cli.parse(); | ||
} catch (originalError) { | ||
const fullArguments = cli.rawArgs.join(" "); | ||
const conflictingArgs = []; | ||
for (const arg of cli.rawArgs) { | ||
if (arg.startsWith("--") && !arg.includes(".") && fullArguments.includes(`${arg}.`)) { | ||
const dotArgs = cli.rawArgs.filter((rawArg) => rawArg.startsWith(arg) && rawArg.includes(".")); | ||
conflictingArgs.push({ arg, dotArgs }); | ||
} | ||
} | ||
if (conflictingArgs.length === 0) | ||
throw originalError; | ||
const error = conflictingArgs.map(({ arg, dotArgs }) => `A boolean argument "${arg}" was used with dot notation arguments "${dotArgs.join(" ")}". | ||
Please specify the "${arg}" argument with dot notation as well: "${arg}.enabled"`).join("\n"); | ||
throw new Error(error); | ||
} | ||
async function runRelated(relatedFiles, argv) { | ||
@@ -103,2 +119,13 @@ argv.related = relatedFiles; | ||
delete argv.dir; | ||
if (argv.coverage) { | ||
const coverage = argv.coverage; | ||
if (coverage.exclude) | ||
coverage.exclude = toArray(coverage.exclude); | ||
if (coverage.include) | ||
coverage.include = toArray(coverage.include); | ||
if (coverage.ignoreClassMethods) | ||
coverage.ignoreClassMethods = toArray(coverage.ignoreClassMethods); | ||
if (coverage.src) | ||
coverage.src = toArray(coverage.src); | ||
} | ||
return argv; | ||
@@ -109,3 +136,3 @@ } | ||
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options)); | ||
if (!(ctx == null ? void 0 : ctx.config.watch)) | ||
if (!(ctx == null ? void 0 : ctx.shouldKeepServer())) | ||
await (ctx == null ? void 0 : ctx.exit()); | ||
@@ -112,0 +139,0 @@ return ctx; |
@@ -1,6 +0,6 @@ | ||
import { UserConfig as UserConfig$2, ConfigEnv } from 'vite'; | ||
export { ConfigEnv } from 'vite'; | ||
import { a3 as ResolvedCoverageOptions, U as UserConfig$1, a6 as CoverageC8Options, a7 as CustomProviderOptions, a5 as CoverageIstanbulOptions, ah as HtmlOptions, ai as FileOptions, aj as CloverOptions, ak as CoberturaOptions, al as HtmlSpaOptions, am as LcovOptions, an as LcovOnlyOptions, ao as TeamcityOptions, ap as TextOptions, aq as ProjectOptions, F as FakeTimerInstallOpts } from './types-7cd96283.js'; | ||
import { UserConfig as UserConfig$1, ConfigEnv } from 'vite'; | ||
export { ConfigEnv, UserConfig, mergeConfig } from 'vite'; | ||
import { a1 as ResolvedCoverageOptions, q as UserConfig, a5 as CoverageV8Options, a4 as CoverageC8Options, a6 as CustomProviderOptions, a3 as CoverageIstanbulOptions, aj as HtmlOptions, ak as FileOptions, al as CloverOptions, am as CoberturaOptions, an as HtmlSpaOptions, ao as LcovOptions, ap as LcovOnlyOptions, aq as TeamcityOptions, ar as TextOptions, as as ProjectOptions, F as FakeTimerInstallOpts, P as ProjectConfig } from './types-2b1c412e.js'; | ||
import '@vitest/snapshot'; | ||
import '@vitest/expect'; | ||
import '@vitest/runner/types'; | ||
import '@vitest/runner'; | ||
@@ -11,7 +11,8 @@ import '@vitest/runner/utils'; | ||
import 'vite-node/client'; | ||
import '@vitest/snapshot/manager'; | ||
import 'vite-node/server'; | ||
import 'node:worker_threads'; | ||
import 'vite-node'; | ||
import 'source-map'; | ||
import 'node:fs'; | ||
import 'chai'; | ||
@@ -41,2 +42,3 @@ declare const defaultInclude: string[]; | ||
silent: boolean; | ||
hideSkippedTests: boolean; | ||
api: boolean; | ||
@@ -50,4 +52,4 @@ ui: boolean; | ||
coverage: { | ||
provider: "c8"; | ||
} & CoverageC8Options & Required<Pick<({ | ||
provider: "v8"; | ||
} & CoverageV8Options & Required<Pick<({ | ||
provider?: undefined; | ||
@@ -59,5 +61,7 @@ } & CoverageC8Options) | ({ | ||
} & CoverageC8Options) | ({ | ||
provider: "v8"; | ||
} & CoverageV8Options) | ({ | ||
provider: "istanbul"; | ||
} & CoverageIstanbulOptions), "exclude" | "enabled" | "clean" | "cleanOnRerun" | "reportsDirectory" | "extension">> & { | ||
reporter: (["html", Partial<HtmlOptions>] | ["json", Partial<FileOptions>] | ["none", {}] | ["clover", Partial<CloverOptions>] | ["cobertura", Partial<CoberturaOptions>] | ["html-spa", Partial<HtmlSpaOptions>] | ["json-summary", Partial<FileOptions>] | ["lcov", Partial<LcovOptions>] | ["lcovonly", Partial<LcovOnlyOptions>] | ["teamcity", Partial<TeamcityOptions>] | ["text", Partial<TextOptions>] | ["text-lcov", Partial<ProjectOptions>] | ["text-summary", Partial<FileOptions>])[]; | ||
} & CoverageIstanbulOptions), "exclude" | "enabled" | "clean" | "cleanOnRerun" | "reportsDirectory" | "extension" | "reportOnFailure">> & { | ||
reporter: (["html", Partial<HtmlOptions>] | ["none", {}] | ["json", Partial<FileOptions>] | ["clover", Partial<CloverOptions>] | ["cobertura", Partial<CoberturaOptions>] | ["html-spa", Partial<HtmlSpaOptions>] | ["json-summary", Partial<FileOptions>] | ["lcov", Partial<LcovOptions>] | ["lcovonly", Partial<LcovOnlyOptions>] | ["teamcity", Partial<TeamcityOptions>] | ["text", Partial<TextOptions>] | ["text-lcov", Partial<ProjectOptions>] | ["text-summary", Partial<FileOptions>])[]; | ||
}; | ||
@@ -74,12 +78,20 @@ fakeTimers: FakeTimerInstallOpts; | ||
}; | ||
declare const configDefaults: Required<Pick<UserConfig$1, keyof typeof config>>; | ||
declare const configDefaults: Required<Pick<UserConfig, keyof typeof config>>; | ||
interface UserConfig extends UserConfig$2 { | ||
test?: UserConfig$2['test']; | ||
interface UserWorkspaceConfig extends UserConfig$1 { | ||
test?: ProjectConfig; | ||
} | ||
type UserConfigFn = (env: ConfigEnv) => UserConfig | Promise<UserConfig>; | ||
type UserConfigExport = UserConfig | Promise<UserConfig> | UserConfigFn; | ||
type UserConfigFn = (env: ConfigEnv) => UserConfig$1 | Promise<UserConfig$1>; | ||
type UserConfigExport = UserConfig$1 | Promise<UserConfig$1> | UserConfigFn; | ||
type UserProjectConfigFn = (env: ConfigEnv) => UserWorkspaceConfig | Promise<UserWorkspaceConfig>; | ||
type UserProjectConfigExport = UserWorkspaceConfig | Promise<UserWorkspaceConfig> | UserProjectConfigFn; | ||
declare function defineConfig(config: UserConfigExport): UserConfigExport; | ||
declare function defineProject(config: UserProjectConfigExport): UserProjectConfigExport; | ||
declare function defineWorkspace(config: (string | (UserProjectConfigExport & { | ||
extends?: string; | ||
}))[]): (string | (UserProjectConfigExport & { | ||
extends?: string | undefined; | ||
}))[]; | ||
export { UserConfig, UserConfigExport, UserConfigFn, configDefaults, coverageConfigDefaults, defaultExclude, defaultInclude, defineConfig }; | ||
export { UserConfigExport, UserConfigFn, UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, configDefaults, coverageConfigDefaults, defaultExclude, defaultInclude, defineConfig, defineProject, defineWorkspace }; |
import { isCI } from 'std-env'; | ||
export { mergeConfig } from 'vite'; | ||
@@ -6,3 +7,3 @@ var _a; | ||
const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"]; | ||
const defaultInclude = ["**/__tests__/**/*.?(c|m)[jt]s?(x)", "**/?(*.){test,spec}.?(c|m)[jt]s?(x)"]; | ||
const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**", "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*"]; | ||
@@ -12,15 +13,14 @@ const defaultCoverageExcludes = [ | ||
"dist/**", | ||
"packages/*/test{,s}/**", | ||
"packages/*/test?(s)/**", | ||
"**/*.d.ts", | ||
"cypress/**", | ||
"test{,s}/**", | ||
"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}", | ||
"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}", | ||
"**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}", | ||
"test?(s)/**", | ||
"test?(-*).?(c|m)[jt]s?(x)", | ||
"**/*{.,-}{test,spec}.?(c|m)[jt]s?(x)", | ||
"**/__tests__/**", | ||
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*", | ||
"**/.{eslint,mocha,prettier}rc.{js,cjs,yml}" | ||
"**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}" | ||
]; | ||
const coverageConfigDefaults = { | ||
provider: "c8", | ||
provider: "v8", | ||
enabled: false, | ||
@@ -31,3 +31,6 @@ clean: true, | ||
exclude: defaultCoverageExcludes, | ||
reportOnFailure: true, | ||
reporter: [["text", {}], ["html", {}], ["clover", {}], ["json", {}]], | ||
// default extensions used by c8, plus '.vue' and '.svelte' | ||
// see https://github.com/istanbuljs/schema/blob/master/default-extension.js | ||
extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte"] | ||
@@ -71,2 +74,3 @@ }; | ||
silent: false, | ||
hideSkippedTests: false, | ||
api: false, | ||
@@ -85,3 +89,3 @@ ui: false, | ||
checker: "tsc", | ||
include: ["**/*.{test,spec}-d.{ts,js}"], | ||
include: ["**/?(*.){test,spec}-d.?(c|m)[jt]s?(x)"], | ||
exclude: defaultExclude | ||
@@ -96,3 +100,9 @@ }, | ||
} | ||
function defineProject(config) { | ||
return config; | ||
} | ||
function defineWorkspace(config) { | ||
return config; | ||
} | ||
export { configDefaults, coverageConfigDefaults, defaultExclude, defaultInclude, defineConfig }; | ||
export { configDefaults, coverageConfigDefaults, defaultExclude, defaultInclude, defineConfig, defineProject, defineWorkspace }; |
@@ -1,5 +0,5 @@ | ||
import { a4 as BaseCoverageOptions, a3 as ResolvedCoverageOptions } from './types-7cd96283.js'; | ||
import { a2 as BaseCoverageOptions, a1 as ResolvedCoverageOptions } from './types-2b1c412e.js'; | ||
import '@vitest/snapshot'; | ||
import '@vitest/expect'; | ||
import 'vite'; | ||
import '@vitest/runner/types'; | ||
import '@vitest/runner'; | ||
@@ -10,7 +10,8 @@ import '@vitest/runner/utils'; | ||
import 'vite-node/client'; | ||
import '@vitest/snapshot/manager'; | ||
import 'vite-node/server'; | ||
import 'node:worker_threads'; | ||
import 'vite-node'; | ||
import 'source-map'; | ||
import 'node:fs'; | ||
import 'chai'; | ||
@@ -132,8 +133,17 @@ // Type definitions for istanbul-lib-coverage 2.0 | ||
*/ | ||
updateThresholds({ configurationFile, coverageMap, thresholds }: { | ||
updateThresholds({ configurationFile, coverageMap, thresholds, perFile }: { | ||
coverageMap: CoverageMap; | ||
thresholds: Record<Threshold, number | undefined>; | ||
perFile?: boolean; | ||
configurationFile?: string; | ||
}): void; | ||
/** | ||
* Checked collected coverage against configured thresholds. Sets exit code to 1 when thresholds not reached. | ||
*/ | ||
checkThresholds({ coverageMap, thresholds, perFile }: { | ||
coverageMap: CoverageMap; | ||
thresholds: Record<Threshold, number | undefined>; | ||
perFile?: boolean; | ||
}): void; | ||
/** | ||
* Resolve reporters from various configuration options | ||
@@ -140,0 +150,0 @@ */ |
import { readFileSync, writeFileSync } from 'node:fs'; | ||
import { relative } from 'pathe'; | ||
const THRESHOLD_KEYS = ["lines", "functions", "statements", "branches"]; | ||
class BaseCoverageProvider { | ||
updateThresholds({ configurationFile, coverageMap, thresholds }) { | ||
/** | ||
* Check if current coverage is above configured thresholds and bump the thresholds if needed | ||
*/ | ||
updateThresholds({ configurationFile, coverageMap, thresholds, perFile }) { | ||
if (!configurationFile) | ||
throw new Error('Missing configurationFile. The "coverage.thresholdAutoUpdate" can only be enabled when configuration file is used.'); | ||
const summary = coverageMap.getCoverageSummary(); | ||
const summaries = perFile ? coverageMap.files().map((file) => coverageMap.fileCoverageFor(file).toSummary()) : [coverageMap.getCoverageSummary()]; | ||
const thresholdsToUpdate = []; | ||
for (const key of THRESHOLD_KEYS) { | ||
const threshold = thresholds[key] || 100; | ||
const actual = summary[key].pct; | ||
const actual = Math.min(...summaries.map((summary) => summary[key].pct)); | ||
if (actual > threshold) | ||
thresholdsToUpdate.push(key); | ||
thresholdsToUpdate.push([key, actual]); | ||
} | ||
@@ -20,3 +24,3 @@ if (thresholdsToUpdate.length === 0) | ||
let updatedConfig = originalConfig; | ||
for (const threshold of thresholdsToUpdate) { | ||
for (const [threshold, newValue] of thresholdsToUpdate) { | ||
const previousThreshold = (thresholds[threshold] || 100).toString(); | ||
@@ -26,3 +30,3 @@ const pattern = new RegExp(`(${threshold}\\s*:\\s*)${previousThreshold.replace(".", "\\.")}`); | ||
if (matches) | ||
updatedConfig = updatedConfig.replace(matches[0], matches[1] + summary[threshold].pct); | ||
updatedConfig = updatedConfig.replace(matches[0], matches[1] + newValue); | ||
else | ||
@@ -36,2 +40,35 @@ console.error(`Unable to update coverage threshold ${threshold}. No threshold found using pattern ${pattern}`); | ||
} | ||
/** | ||
* Checked collected coverage against configured thresholds. Sets exit code to 1 when thresholds not reached. | ||
*/ | ||
checkThresholds({ coverageMap, thresholds, perFile }) { | ||
const summaries = perFile ? coverageMap.files().map((file) => ({ | ||
file, | ||
summary: coverageMap.fileCoverageFor(file).toSummary() | ||
})) : [{ | ||
file: null, | ||
summary: coverageMap.getCoverageSummary() | ||
}]; | ||
for (const { summary, file } of summaries) { | ||
for (const thresholdKey of ["lines", "functions", "statements", "branches"]) { | ||
const threshold = thresholds[thresholdKey]; | ||
if (threshold !== void 0) { | ||
const coverage = summary.data[thresholdKey].pct; | ||
if (coverage < threshold) { | ||
process.exitCode = 1; | ||
let errorMessage = `ERROR: Coverage for ${thresholdKey} (${coverage}%) does not meet`; | ||
if (!perFile) | ||
errorMessage += " global"; | ||
errorMessage += ` threshold (${threshold}%)`; | ||
if (perFile && file) | ||
errorMessage += ` for ${relative("./", file).replace(/\\/g, "/")}`; | ||
console.error(errorMessage); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
/** | ||
* Resolve reporters from various configuration options | ||
*/ | ||
resolveReporters(configReporters) { | ||
@@ -38,0 +75,0 @@ if (!Array.isArray(configReporters)) |
@@ -0,51 +1,40 @@ | ||
import { performance } from 'node:perf_hooks'; | ||
import { startTests } from '@vitest/runner'; | ||
import { resolve } from 'pathe'; | ||
import { g as getWorkerState, r as resetModules } from './chunk-utils-global.727b6d25.js'; | ||
import { R as RealDate, g as globalExpect, a as vi } from './chunk-utils-import.ec15dcad.js'; | ||
import { d as distDir } from './chunk-constants.797d3ebf.js'; | ||
import { s as startCoverageInsideWorker, t as takeCoverageInsideWorker, a as stopCoverageInsideWorker } from './chunk-integrations-coverage.e0a6acd2.js'; | ||
import { c as resetModules } from './vendor-index.fad2598b.js'; | ||
import { R as RealDate, d as globalExpect, s as setupChaiConfig, v as vi } from './vendor-vi.74cf3ef7.js'; | ||
import { d as distDir } from './vendor-paths.84fc7a99.js'; | ||
import { a as startCoverageInsideWorker, t as takeCoverageInsideWorker, s as stopCoverageInsideWorker } from './vendor-coverage.de2180ed.js'; | ||
import { createRequire } from 'node:module'; | ||
import c from 'picocolors'; | ||
import { isatty } from 'node:tty'; | ||
import { installSourcemapsSupport } from 'vite-node/source-map'; | ||
import { setColors, getSafeTimers } from '@vitest/utils'; | ||
import { e as environments } from './chunk-env-node.affdd278.js'; | ||
import { i as index } from './chunk-integrations-utils.233d6a3b.js'; | ||
import { s as setupSnapshotEnvironment } from './chunk-snapshot-env.a347d647.js'; | ||
import { promises, existsSync } from 'node:fs'; | ||
import { r as rpc } from './chunk-runtime-rpc.971b3848.js'; | ||
import { s as setupCommonEnv } from './chunk-runtime-setup.992bb661.js'; | ||
import './chunk-utils-env.860d90c2.js'; | ||
import { setupColors, createColors, getSafeTimers } from '@vitest/utils'; | ||
import { e as environments } from './vendor-index.75f2b63d.js'; | ||
import { NodeSnapshotEnvironment } from '@vitest/snapshot/environment'; | ||
import { r as rpc } from './vendor-rpc.4d3d7a54.js'; | ||
import { i as index } from './vendor-index.0f133dbe.js'; | ||
import { s as setupCommonEnv } from './vendor-setup.common.f1cf2231.js'; | ||
import { g as getWorkerState } from './vendor-global.6795f91f.js'; | ||
import 'std-env'; | ||
import '@vitest/runner/utils'; | ||
import 'chai'; | ||
import './vendor-_commonjsHelpers.addc3445.js'; | ||
import './vendor-_commonjsHelpers.76cdd49e.js'; | ||
import '@vitest/expect'; | ||
import './chunk-utils-base.81f83dbd.js'; | ||
import './chunk-utils-tasks.b41c8284.js'; | ||
import '@vitest/snapshot'; | ||
import '@vitest/utils/error'; | ||
import './vendor-tasks.f9d75aed.js'; | ||
import 'util'; | ||
import '@vitest/spy'; | ||
import 'node:url'; | ||
import 'node:console'; | ||
import 'local-pkg'; | ||
import 'node:console'; | ||
import './chunk-integrations-run-once.9012f759.js'; | ||
import './vendor-run-once.69ce7172.js'; | ||
class NodeSnapshotEnvironment { | ||
class VitestSnapshotEnvironment extends NodeSnapshotEnvironment { | ||
getHeader() { | ||
return `// Vitest Snapshot v${this.getVersion()}, https://vitest.dev/guide/snapshot.html`; | ||
} | ||
resolvePath(filepath) { | ||
return rpc().resolveSnapshotPath(filepath); | ||
} | ||
async prepareDirectory(filepath) { | ||
await promises.mkdir(filepath, { recursive: true }); | ||
} | ||
async saveSnapshotFile(filepath, snapshot) { | ||
await promises.writeFile(filepath, snapshot, "utf-8"); | ||
} | ||
async readSnapshotFile(filepath) { | ||
if (!existsSync(filepath)) | ||
return null; | ||
return promises.readFile(filepath, "utf-8"); | ||
} | ||
async removeSnapshotFile(filepath) { | ||
if (existsSync(filepath)) | ||
await promises.unlink(filepath); | ||
} | ||
} | ||
@@ -60,12 +49,14 @@ | ||
}); | ||
const state = getWorkerState(); | ||
if (!state.config.snapshotOptions.snapshotEnvironment) | ||
state.config.snapshotOptions.snapshotEnvironment = new VitestSnapshotEnvironment(); | ||
if (globalSetup) | ||
return; | ||
globalSetup = true; | ||
setupSnapshotEnvironment(new NodeSnapshotEnvironment()); | ||
setColors(c); | ||
const require = createRequire(import.meta.url); | ||
require.extensions[".css"] = () => ({}); | ||
require.extensions[".scss"] = () => ({}); | ||
require.extensions[".sass"] = () => ({}); | ||
const state = getWorkerState(); | ||
setupColors(createColors(isatty(1))); | ||
const _require = createRequire(import.meta.url); | ||
_require.extensions[".css"] = () => ({}); | ||
_require.extensions[".scss"] = () => ({}); | ||
_require.extensions[".sass"] = () => ({}); | ||
_require.extensions[".less"] = () => ({}); | ||
installSourcemapsSupport({ | ||
@@ -198,2 +189,4 @@ getSourceMap: (source) => state.moduleCache.getSourceMap(source) | ||
} finally { | ||
const { setTimeout } = getSafeTimers(); | ||
await new Promise((resolve) => setTimeout(resolve)); | ||
await env.teardown(globalThis); | ||
@@ -234,2 +227,9 @@ } | ||
testRunner.onCollected = async (files) => { | ||
const state = getWorkerState(); | ||
files.forEach((file) => { | ||
file.prepareDuration = state.durations.prepare; | ||
file.environmentLoad = state.durations.environment; | ||
state.durations.prepare = 0; | ||
state.durations.environment = 0; | ||
}); | ||
rpc().onCollected(files); | ||
@@ -244,11 +244,33 @@ await (originalOnCollected == null ? void 0 : originalOnCollected.call(testRunner, files)); | ||
}; | ||
const originalOnAfterRunTest = testRunner.onAfterRunTest; | ||
testRunner.onAfterRunTest = async (test) => { | ||
var _a, _b; | ||
if (config.bail && ((_a = test.result) == null ? void 0 : _a.state) === "fail") { | ||
const previousFailures = await rpc().getCountOfFailedTests(); | ||
const currentFailures = 1 + previousFailures; | ||
if (currentFailures >= config.bail) { | ||
rpc().onCancel("test-failure"); | ||
(_b = testRunner.onCancel) == null ? void 0 : _b.call(testRunner, "test-failure"); | ||
} | ||
} | ||
await (originalOnAfterRunTest == null ? void 0 : originalOnAfterRunTest.call(testRunner, test)); | ||
}; | ||
return testRunner; | ||
} | ||
async function run(files, config, environment, executor) { | ||
const workerState = getWorkerState(); | ||
await setupGlobalEnv(config); | ||
await startCoverageInsideWorker(config.coverage, executor); | ||
const workerState = getWorkerState(); | ||
if (config.chaiConfig) | ||
setupChaiConfig(config.chaiConfig); | ||
const runner = await getTestRunner(config, executor); | ||
workerState.onCancel.then((reason) => { | ||
var _a; | ||
return (_a = runner.onCancel) == null ? void 0 : _a.call(runner, reason); | ||
}); | ||
workerState.durations.prepare = performance.now() - workerState.durations.prepare; | ||
globalThis.__vitest_environment__ = environment; | ||
workerState.durations.environment = performance.now(); | ||
await withEnv(environment.name, environment.options || config.environmentOptions || {}, executor, async () => { | ||
workerState.durations.environment = performance.now() - workerState.durations.environment; | ||
for (const file of files) { | ||
@@ -261,3 +283,2 @@ if (config.isolate) { | ||
await startTests([file], runner); | ||
workerState.filepath = void 0; | ||
vi.resetConfig(); | ||
@@ -268,4 +289,5 @@ vi.restoreAllMocks(); | ||
}); | ||
workerState.environmentTeardownRun = true; | ||
} | ||
export { run }; |
@@ -1,5 +0,5 @@ | ||
import { X as Environment } from './types-7cd96283.js'; | ||
import { S as Environment } from './types-2b1c412e.js'; | ||
import '@vitest/snapshot'; | ||
import '@vitest/expect'; | ||
import 'vite'; | ||
import '@vitest/runner/types'; | ||
import '@vitest/runner'; | ||
@@ -10,7 +10,8 @@ import '@vitest/runner/utils'; | ||
import 'vite-node/client'; | ||
import '@vitest/snapshot/manager'; | ||
import 'vite-node/server'; | ||
import 'node:worker_threads'; | ||
import 'vite-node'; | ||
import 'source-map'; | ||
import 'node:fs'; | ||
import 'chai'; | ||
@@ -17,0 +18,0 @@ declare const environments: { |
@@ -1,3 +0,3 @@ | ||
export { e as builtinEnvironments, p as populateGlobal } from './chunk-env-node.affdd278.js'; | ||
export { e as builtinEnvironments, p as populateGlobal } from './vendor-index.75f2b63d.js'; | ||
import 'node:console'; | ||
import 'local-pkg'; |
@@ -1,10 +0,11 @@ | ||
import { Test } from '@vitest/runner'; | ||
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner'; | ||
import { B as BenchmarkAPI, F as FakeTimerInstallOpts, M as MockFactoryWithHelper, R as RuntimeConfig, a as ResolvedConfig, b as ModuleGraphData, S as SnapshotResult, c as Reporter } from './types-7cd96283.js'; | ||
export { x as AfterSuiteRunMeta, A as ApiConfig, G as ArgumentsType, D as Arrayable, z as Awaitable, a4 as BaseCoverageOptions, ab as BenchFunction, a9 as Benchmark, B as BenchmarkAPI, aa as BenchmarkResult, a8 as BenchmarkUserOptions, h as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, e as CollectLines, O as Constructable, g as Context, o as ContextRPC, n as ContextTestEnvironment, a6 as CoverageC8Options, a5 as CoverageIstanbulOptions, a2 as CoverageOptions, _ as CoverageProvider, a0 as CoverageProviderModule, a1 as CoverageReporter, a7 as CustomProviderOptions, K as DeepMerge, X as Environment, E as EnvironmentOptions, Q as EnvironmentReturn, I as InlineConfig, J as JSDOMOptions, H as MergeInsertions, P as ModuleCache, b as ModuleGraphData, L as MutableArray, N as Nullable, Z as OnServerRestartHandler, d as RawErrsMap, $ as ReportContext, c as Reporter, w as ResolveIdFunction, a as ResolvedConfig, a3 as ResolvedCoverageOptions, f as RootAndTarget, R as RuntimeConfig, m as RuntimeRPC, j as SequenceHooks, q as SnapshotData, t as SnapshotMatchOptions, S as SnapshotResult, s as SnapshotStateOptions, v as SnapshotSummary, r as SnapshotUpdateState, T as TscErrorInfo, l as TypecheckConfig, u as UncheckedSnapshot, U as UserConfig, Y as UserConsoleLog, p as Vitest, V as VitestEnvironment, k as VitestRunMode, W as WorkerContext, y as WorkerGlobalState } from './types-7cd96283.js'; | ||
import { File, TaskResultPack, CancelReason } from '@vitest/runner'; | ||
export { DoneCallback, File, HookCleanupCallback, HookListener, OnTestFailedHandler, RunMode, RuntimeContext, SequenceHooks, SequenceSetupFiles, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task, TaskBase, TaskMeta, TaskResult, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner'; | ||
import { B as BenchmarkAPI, F as FakeTimerInstallOpts, M as MockFactoryWithHelper, R as RuntimeConfig, A as AfterSuiteRunMeta, U as UserConsoleLog, a as ResolvedConfig, b as ModuleGraphData, c as Reporter } from './types-2b1c412e.js'; | ||
export { n as ApiConfig, H as ArgumentsType, G as Arrayable, z as Awaitable, a2 as BaseCoverageOptions, aa as BenchFunction, a8 as Benchmark, a9 as BenchmarkResult, a7 as BenchmarkUserOptions, k as BuiltinEnvironment, m as CSSModuleScopeStrategy, C as ChaiConfig, f as CollectLineNumbers, h as CollectLines, L as Constructable, j as Context, v as ContextRPC, u as ContextTestEnvironment, a4 as CoverageC8Options, a3 as CoverageIstanbulOptions, a0 as CoverageOptions, Y as CoverageProvider, _ as CoverageProviderModule, $ as CoverageReporter, a5 as CoverageV8Options, a6 as CustomProviderOptions, D as DepsOptimizationOptions, S as Environment, E as EnvironmentOptions, Q as EnvironmentReturn, I as InlineConfig, J as JSDOMOptions, O as ModuleCache, K as MutableArray, N as Nullable, X as OnServerRestartHandler, P as ProjectConfig, e as RawErrsMap, Z as ReportContext, x as ResolveIdFunction, a1 as ResolvedCoverageOptions, i as RootAndTarget, t as RunnerRPC, r as RuntimeRPC, T as TscErrorInfo, p as TypecheckConfig, q as UserConfig, w as Vitest, V as VitestEnvironment, l as VitestPool, o as VitestRunMode, W as WorkerContext, y as WorkerGlobalState, d as createExpect, g as expect, s as setupChaiConfig } from './types-2b1c412e.js'; | ||
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, EnhancedSpy } from '@vitest/spy'; | ||
export { EnhancedSpy, Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject, SpyInstance } from '@vitest/spy'; | ||
export { S as SnapshotEnvironment } from './env-afee91f0.js'; | ||
import { File, TaskResultPack } from '@vitest/runner/types'; | ||
export { DoneCallback, File, HookCleanupCallback, HookListener, OnTestFailedHandler, RunMode, RuntimeContext, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TestOptions } from '@vitest/runner/types'; | ||
export { SnapshotEnvironment } from '@vitest/snapshot/environment'; | ||
import { SnapshotResult } from '@vitest/snapshot'; | ||
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot'; | ||
export { Assertion, AsymmetricMatchersContaining, ExpectStatic, JestAssertion } from '@vitest/expect'; | ||
import { TransformResult } from 'vite'; | ||
@@ -14,11 +15,11 @@ import * as chai from 'chai'; | ||
export { assert, should } from 'chai'; | ||
export { ErrorWithDiff, ParsedStack } from '@vitest/runner/utils'; | ||
export { UserWorkspaceConfig } from './config.js'; | ||
export { ErrorWithDiff, ParsedStack } from '@vitest/utils'; | ||
export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench'; | ||
import '@vitest/expect'; | ||
import '@vitest/utils'; | ||
import '@vitest/runner/utils'; | ||
import 'vite-node/client'; | ||
import '@vitest/snapshot/manager'; | ||
import 'vite-node/server'; | ||
import 'node:worker_threads'; | ||
import 'vite-node'; | ||
import 'source-map'; | ||
import 'node:fs'; | ||
@@ -185,10 +186,3 @@ | ||
declare function createExpect(test?: Test): Vi.ExpectStatic; | ||
declare const globalExpect: Vi.ExpectStatic; | ||
declare class VitestUtils { | ||
private _timers; | ||
private _mockedDate; | ||
private _mocker; | ||
constructor(); | ||
interface VitestUtils { | ||
useFakeTimers(config?: FakeTimerInstallOpts): this; | ||
@@ -207,3 +201,3 @@ useRealTimers(): this; | ||
setSystemTime(time: number | string | Date): this; | ||
getMockedSystemTime(): string | number | Date | null; | ||
getMockedSystemTime(): Date | null; | ||
getRealSystemTime(): number; | ||
@@ -213,4 +207,8 @@ clearAllTimers(): this; | ||
fn: typeof fn; | ||
private getImporter; | ||
/** | ||
* Run the factory before imports are evaluated. You can return a value from the factory | ||
* to reuse it inside your `vi.mock` factory and tests. | ||
*/ | ||
hoisted<T>(factory: () => T): T; | ||
/** | ||
* Makes all `imports` to passed module to be mocked. | ||
@@ -292,2 +290,3 @@ * - If there is a factory, will return it's result. The call to `vi.mock` is hoisted to the top of the file, | ||
}): MaybePartiallyMockedDeep<T>; | ||
mocked<T>(item: T): MaybeMocked<T>; | ||
isMockFunction(fn: any): fn is EnhancedSpy; | ||
@@ -297,4 +296,2 @@ clearAllMocks(): this; | ||
restoreAllMocks(): this; | ||
private _stubsGlobal; | ||
private _stubsEnv; | ||
/** | ||
@@ -305,3 +302,3 @@ * Makes value available on global namespace. | ||
*/ | ||
stubGlobal(name: string | symbol | number, value: any): this; | ||
stubGlobal(name: string | symbol | number, value: unknown): this; | ||
/** | ||
@@ -327,3 +324,2 @@ * Changes the value of `import.meta.env` and `process.env`. | ||
dynamicImportSettled(): Promise<void>; | ||
private _config; | ||
/** | ||
@@ -348,6 +344,9 @@ * Updates runtime config. You can only change values that are used when executing tests. | ||
interface WebSocketHandlers { | ||
onWatcherStart: () => Promise<void>; | ||
onFinished(files?: File[]): Promise<void>; | ||
onCollected(files?: File[]): Promise<void>; | ||
onTaskUpdate(packs: TaskResultPack[]): void; | ||
onAfterSuiteRun(meta: AfterSuiteRunMeta): void; | ||
onDone(name: string): void; | ||
onCancel(reason: CancelReason): void; | ||
getCountOfFailedTests(): number; | ||
sendLog(log: UserConsoleLog): void; | ||
getFiles(): File[]; | ||
@@ -357,6 +356,7 @@ getPaths(): string[]; | ||
resolveSnapshotPath(testPath: string): string; | ||
resolveSnapshotRawPath(testPath: string, rawPath: string): string; | ||
getModuleGraph(id: string): Promise<ModuleGraphData>; | ||
getTransformResult(id: string): Promise<TransformResultWithSource | undefined>; | ||
readFile(id: string): Promise<string | null>; | ||
writeFile(id: string, content: string): Promise<void>; | ||
writeFile(id: string, content: string, ensureDir?: boolean): Promise<void>; | ||
removeFile(id: string): Promise<void>; | ||
@@ -369,4 +369,5 @@ createDirectory(id: string): Promise<string | undefined>; | ||
interface WebSocketEvents extends Pick<Reporter, 'onCollected' | 'onFinished' | 'onTaskUpdate' | 'onUserConsoleLog' | 'onPathsCollected'> { | ||
onCancel(reason: CancelReason): void; | ||
} | ||
export { AssertType, ExpectTypeOf, TransformResultWithSource, WebSocketEvents, WebSocketHandlers, assertType, bench, createExpect, globalExpect as expect, expectTypeOf, getRunningMode, isFirstRun, isWatchMode, runOnce, vi, vitest }; | ||
export { AfterSuiteRunMeta, AssertType, BenchmarkAPI, ExpectTypeOf, ModuleGraphData, Reporter, ResolvedConfig, RuntimeConfig, TransformResultWithSource, UserConsoleLog, WebSocketEvents, WebSocketHandlers, assertType, bench, expectTypeOf, getRunningMode, isFirstRun, isWatchMode, runOnce, vi, vitest }; |
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner'; | ||
export { b as bench, c as createExpect, g as expect, a as vi, v as vitest } from './chunk-utils-import.ec15dcad.js'; | ||
export { i as isFirstRun, r as runOnce } from './chunk-integrations-run-once.9012f759.js'; | ||
import { d as dist } from './chunk-integrations-utils.233d6a3b.js'; | ||
export { b as assertType, g as getRunningMode, a as isWatchMode } from './chunk-integrations-utils.233d6a3b.js'; | ||
export { e as bench, c as createExpect, d as expect, s as setupChaiConfig, v as vi, f as vitest } from './vendor-vi.74cf3ef7.js'; | ||
export { i as isFirstRun, a as runOnce } from './vendor-run-once.69ce7172.js'; | ||
import { d as dist } from './vendor-index.0f133dbe.js'; | ||
export { b as assertType, g as getRunningMode, a as isWatchMode } from './vendor-index.0f133dbe.js'; | ||
import * as chai from 'chai'; | ||
@@ -11,12 +11,11 @@ export { chai }; | ||
import '@vitest/utils'; | ||
import './chunk-utils-global.727b6d25.js'; | ||
import './vendor-index.fad2598b.js'; | ||
import 'pathe'; | ||
import './chunk-utils-env.860d90c2.js'; | ||
import 'std-env'; | ||
import './vendor-_commonjsHelpers.addc3445.js'; | ||
import './vendor-global.6795f91f.js'; | ||
import './vendor-_commonjsHelpers.76cdd49e.js'; | ||
import '@vitest/expect'; | ||
import './chunk-runtime-rpc.971b3848.js'; | ||
import './chunk-snapshot-env.a347d647.js'; | ||
import './chunk-utils-base.81f83dbd.js'; | ||
import './chunk-utils-tasks.b41c8284.js'; | ||
import '@vitest/snapshot'; | ||
import '@vitest/utils/error'; | ||
import './vendor-tasks.f9d75aed.js'; | ||
import 'util'; | ||
@@ -23,0 +22,0 @@ import '@vitest/spy'; |
import { pathToFileURL, fileURLToPath } from 'node:url'; | ||
import { readFile } from 'node:fs/promises'; | ||
import { i as isNodeBuiltin, h as hasCJSSyntax } from './vendor-index.bdee400f.js'; | ||
import { normalizeModuleId } from 'vite-node/utils'; | ||
import { g as getWorkerState } from './chunk-utils-global.727b6d25.js'; | ||
import 'acorn'; | ||
import 'node:module'; | ||
import { builtinModules } from 'node:module'; | ||
import 'node:fs'; | ||
import 'pathe'; | ||
import 'node:assert'; | ||
import 'node:process'; | ||
import assert from 'node:assert'; | ||
import process$1 from 'node:process'; | ||
import 'node:path'; | ||
import 'node:v8'; | ||
import 'node:util'; | ||
import './chunk-utils-env.860d90c2.js'; | ||
import v8 from 'node:v8'; | ||
import { format, inspect } from 'node:util'; | ||
import { normalizeModuleId } from 'vite-node/utils'; | ||
import './vendor-index.fad2598b.js'; | ||
import { g as getWorkerState } from './vendor-global.6795f91f.js'; | ||
import 'std-env'; | ||
@@ -20,2 +19,386 @@ import '@vitest/runner/utils'; | ||
const BUILTIN_MODULES = new Set(builtinModules); | ||
/** | ||
* @typedef ErrnoExceptionFields | ||
* @property {number | undefined} [errnode] | ||
* @property {string | undefined} [code] | ||
* @property {string | undefined} [path] | ||
* @property {string | undefined} [syscall] | ||
* @property {string | undefined} [url] | ||
* | ||
* @typedef {Error & ErrnoExceptionFields} ErrnoException | ||
*/ | ||
const isWindows = process$1.platform === 'win32'; | ||
const own$1 = {}.hasOwnProperty; | ||
/** | ||
* Create a list string in the form like 'A and B' or 'A, B, ..., and Z'. | ||
* We cannot use Intl.ListFormat because it's not available in | ||
* --without-intl builds. | ||
* | ||
* @param {Array<string>} array | ||
* An array of strings. | ||
* @param {string} [type] | ||
* The list type to be inserted before the last element. | ||
* @returns {string} | ||
*/ | ||
function formatList(array, type = 'and') { | ||
return array.length < 3 | ||
? array.join(` ${type} `) | ||
: `${array.slice(0, -1).join(', ')}, ${type} ${array[array.length - 1]}` | ||
} | ||
/** @type {Map<string, MessageFunction|string>} */ | ||
const messages = new Map(); | ||
const nodeInternalPrefix = '__node_internal_'; | ||
/** @type {number} */ | ||
let userStackTraceLimit; | ||
createError( | ||
'ERR_INVALID_MODULE_SPECIFIER', | ||
/** | ||
* @param {string} request | ||
* @param {string} reason | ||
* @param {string} [base] | ||
*/ | ||
(request, reason, base = undefined) => { | ||
return `Invalid module "${request}" ${reason}${ | ||
base ? ` imported from ${base}` : '' | ||
}` | ||
}, | ||
TypeError | ||
); | ||
createError( | ||
'ERR_INVALID_PACKAGE_CONFIG', | ||
/** | ||
* @param {string} path | ||
* @param {string} [base] | ||
* @param {string} [message] | ||
*/ | ||
(path, base, message) => { | ||
return `Invalid package config ${path}${ | ||
base ? ` while importing ${base}` : '' | ||
}${message ? `. ${message}` : ''}` | ||
}, | ||
Error | ||
); | ||
createError( | ||
'ERR_INVALID_PACKAGE_TARGET', | ||
/** | ||
* @param {string} pkgPath | ||
* @param {string} key | ||
* @param {unknown} target | ||
* @param {boolean} [isImport=false] | ||
* @param {string} [base] | ||
*/ | ||
(pkgPath, key, target, isImport = false, base = undefined) => { | ||
const relError = | ||
typeof target === 'string' && | ||
!isImport && | ||
target.length > 0 && | ||
!target.startsWith('./'); | ||
if (key === '.') { | ||
assert(isImport === false); | ||
return ( | ||
`Invalid "exports" main target ${JSON.stringify(target)} defined ` + | ||
`in the package config ${pkgPath}package.json${ | ||
base ? ` imported from ${base}` : '' | ||
}${relError ? '; targets must start with "./"' : ''}` | ||
) | ||
} | ||
return `Invalid "${ | ||
isImport ? 'imports' : 'exports' | ||
}" target ${JSON.stringify( | ||
target | ||
)} defined for '${key}' in the package config ${pkgPath}package.json${ | ||
base ? ` imported from ${base}` : '' | ||
}${relError ? '; targets must start with "./"' : ''}` | ||
}, | ||
Error | ||
); | ||
createError( | ||
'ERR_MODULE_NOT_FOUND', | ||
/** | ||
* @param {string} path | ||
* @param {string} base | ||
* @param {string} [type] | ||
*/ | ||
(path, base, type = 'package') => { | ||
return `Cannot find ${type} '${path}' imported from ${base}` | ||
}, | ||
Error | ||
); | ||
createError( | ||
'ERR_NETWORK_IMPORT_DISALLOWED', | ||
"import of '%s' by %s is not supported: %s", | ||
Error | ||
); | ||
createError( | ||
'ERR_PACKAGE_IMPORT_NOT_DEFINED', | ||
/** | ||
* @param {string} specifier | ||
* @param {string} packagePath | ||
* @param {string} base | ||
*/ | ||
(specifier, packagePath, base) => { | ||
return `Package import specifier "${specifier}" is not defined${ | ||
packagePath ? ` in package ${packagePath}package.json` : '' | ||
} imported from ${base}` | ||
}, | ||
TypeError | ||
); | ||
createError( | ||
'ERR_PACKAGE_PATH_NOT_EXPORTED', | ||
/** | ||
* @param {string} pkgPath | ||
* @param {string} subpath | ||
* @param {string} [base] | ||
*/ | ||
(pkgPath, subpath, base = undefined) => { | ||
if (subpath === '.') | ||
return `No "exports" main defined in ${pkgPath}package.json${ | ||
base ? ` imported from ${base}` : '' | ||
}` | ||
return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${ | ||
base ? ` imported from ${base}` : '' | ||
}` | ||
}, | ||
Error | ||
); | ||
createError( | ||
'ERR_UNSUPPORTED_DIR_IMPORT', | ||
"Directory import '%s' is not supported " + | ||
'resolving ES modules imported from %s', | ||
Error | ||
); | ||
createError( | ||
'ERR_UNKNOWN_FILE_EXTENSION', | ||
/** | ||
* @param {string} ext | ||
* @param {string} path | ||
*/ | ||
(ext, path) => { | ||
return `Unknown file extension "${ext}" for ${path}` | ||
}, | ||
TypeError | ||
); | ||
createError( | ||
'ERR_INVALID_ARG_VALUE', | ||
/** | ||
* @param {string} name | ||
* @param {unknown} value | ||
* @param {string} [reason='is invalid'] | ||
*/ | ||
(name, value, reason = 'is invalid') => { | ||
let inspected = inspect(value); | ||
if (inspected.length > 128) { | ||
inspected = `${inspected.slice(0, 128)}...`; | ||
} | ||
const type = name.includes('.') ? 'property' : 'argument'; | ||
return `The ${type} '${name}' ${reason}. Received ${inspected}` | ||
}, | ||
TypeError | ||
// Note: extra classes have been shaken out. | ||
// , RangeError | ||
); | ||
createError( | ||
'ERR_UNSUPPORTED_ESM_URL_SCHEME', | ||
/** | ||
* @param {URL} url | ||
* @param {Array<string>} supported | ||
*/ | ||
(url, supported) => { | ||
let message = `Only URLs with a scheme in: ${formatList( | ||
supported | ||
)} are supported by the default ESM loader`; | ||
if (isWindows && url.protocol.length === 2) { | ||
message += '. On Windows, absolute paths must be valid file:// URLs'; | ||
} | ||
message += `. Received protocol '${url.protocol}'`; | ||
return message | ||
}, | ||
Error | ||
); | ||
/** | ||
* Utility function for registering the error codes. Only used here. Exported | ||
* *only* to allow for testing. | ||
* @param {string} sym | ||
* @param {MessageFunction|string} value | ||
* @param {ErrorConstructor} def | ||
* @returns {new (...args: Array<any>) => Error} | ||
*/ | ||
function createError(sym, value, def) { | ||
// Special case for SystemError that formats the error message differently | ||
// The SystemErrors only have SystemError as their base classes. | ||
messages.set(sym, value); | ||
return makeNodeErrorWithCode(def, sym) | ||
} | ||
/** | ||
* @param {ErrorConstructor} Base | ||
* @param {string} key | ||
* @returns {ErrorConstructor} | ||
*/ | ||
function makeNodeErrorWithCode(Base, key) { | ||
// @ts-expect-error It’s a Node error. | ||
return NodeError | ||
/** | ||
* @param {Array<unknown>} args | ||
*/ | ||
function NodeError(...args) { | ||
const limit = Error.stackTraceLimit; | ||
if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0; | ||
const error = new Base(); | ||
// Reset the limit and setting the name property. | ||
if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit; | ||
const message = getMessage(key, args, error); | ||
Object.defineProperties(error, { | ||
// Note: no need to implement `kIsNodeError` symbol, would be hard, | ||
// probably. | ||
message: { | ||
value: message, | ||
enumerable: false, | ||
writable: true, | ||
configurable: true | ||
}, | ||
toString: { | ||
/** @this {Error} */ | ||
value() { | ||
return `${this.name} [${key}]: ${this.message}` | ||
}, | ||
enumerable: false, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
captureLargerStackTrace(error); | ||
// @ts-expect-error It’s a Node error. | ||
error.code = key; | ||
return error | ||
} | ||
} | ||
/** | ||
* @returns {boolean} | ||
*/ | ||
function isErrorStackTraceLimitWritable() { | ||
// Do no touch Error.stackTraceLimit as V8 would attempt to install | ||
// it again during deserialization. | ||
try { | ||
// @ts-expect-error: not in types? | ||
if (v8.startupSnapshot.isBuildingSnapshot()) { | ||
return false | ||
} | ||
} catch {} | ||
const desc = Object.getOwnPropertyDescriptor(Error, 'stackTraceLimit'); | ||
if (desc === undefined) { | ||
return Object.isExtensible(Error) | ||
} | ||
return own$1.call(desc, 'writable') && desc.writable !== undefined | ||
? desc.writable | ||
: desc.set !== undefined | ||
} | ||
/** | ||
* This function removes unnecessary frames from Node.js core errors. | ||
* @template {(...args: unknown[]) => unknown} T | ||
* @param {T} fn | ||
* @returns {T} | ||
*/ | ||
function hideStackFrames(fn) { | ||
// We rename the functions that will be hidden to cut off the stacktrace | ||
// at the outermost one | ||
const hidden = nodeInternalPrefix + fn.name; | ||
Object.defineProperty(fn, 'name', {value: hidden}); | ||
return fn | ||
} | ||
const captureLargerStackTrace = hideStackFrames( | ||
/** | ||
* @param {Error} error | ||
* @returns {Error} | ||
*/ | ||
// @ts-expect-error: fine | ||
function (error) { | ||
const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable(); | ||
if (stackTraceLimitIsWritable) { | ||
userStackTraceLimit = Error.stackTraceLimit; | ||
Error.stackTraceLimit = Number.POSITIVE_INFINITY; | ||
} | ||
Error.captureStackTrace(error); | ||
// Reset the limit | ||
if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit; | ||
return error | ||
} | ||
); | ||
/** | ||
* @param {string} key | ||
* @param {Array<unknown>} args | ||
* @param {Error} self | ||
* @returns {string} | ||
*/ | ||
function getMessage(key, args, self) { | ||
const message = messages.get(key); | ||
assert(typeof message !== 'undefined', 'expected `message` to be found'); | ||
if (typeof message === 'function') { | ||
assert( | ||
message.length <= args.length, // Default options do not count. | ||
`Code: ${key}; The provided arguments length (${args.length}) does not ` + | ||
`match the required ones (${message.length}).` | ||
); | ||
return Reflect.apply(message, self, args) | ||
} | ||
const regex = /%[dfijoOs]/g; | ||
let expectedLength = 0; | ||
while (regex.exec(message) !== null) expectedLength++; | ||
assert( | ||
expectedLength === args.length, | ||
`Code: ${key}; The provided arguments length (${args.length}) does not ` + | ||
`match the required ones (${expectedLength}).` | ||
); | ||
if (args.length === 0) return message | ||
args.unshift(message); | ||
return Reflect.apply(format, null, args) | ||
} | ||
function isNodeBuiltin(id = "") { | ||
id = id.replace(/^node:/, "").split("/")[0]; | ||
return BUILTIN_MODULES.has(id); | ||
} | ||
pathToFileURL(process.cwd()); | ||
const CJS_RE = /([\s;]|^)(module.exports\b|exports\.\w|require\s*\(|global\.\w)/m; | ||
function hasCJSSyntax(code) { | ||
return CJS_RE.test(code); | ||
} | ||
var ModuleFormat = /* @__PURE__ */ ((ModuleFormat2) => { | ||
@@ -35,3 +418,3 @@ ModuleFormat2["Builtin"] = "builtin"; | ||
const cache = /* @__PURE__ */ new Map(); | ||
const getPotentialSource = async (filepath, result) => { | ||
async function getPotentialSource(filepath, result) { | ||
var _a; | ||
@@ -44,4 +427,4 @@ if (!result.url.startsWith("file://") || result.format === "module") | ||
return source; | ||
}; | ||
const detectESM = (url, source) => { | ||
} | ||
function detectESM(url, source) { | ||
const cached = cache.get(url); | ||
@@ -53,3 +436,3 @@ if (cached) | ||
return hasESMSyntax(source) && !hasCJSSyntax(source); | ||
}; | ||
} | ||
const resolve = async (url, context, next) => { | ||
@@ -56,0 +439,0 @@ const { parentURL } = context; |
@@ -1,8 +0,8 @@ | ||
import { k as VitestRunMode, U as UserConfig, p as Vitest, ac as MockFactory, ad as MockMap, ae as TestSequencer } from './types-7cd96283.js'; | ||
export { ae as TestSequencer, ag as TestSequencerConstructor, p as Vitest, af as startVitest } from './types-7cd96283.js'; | ||
import { o as VitestRunMode, q as UserConfig, w as Vitest, ab as PendingSuiteMock, ac as MockFactory, ad as MockMap, ae as TestSequencer, af as WorkspaceSpec } from './types-2b1c412e.js'; | ||
export { ai as TestSequencerConstructor, ag as VitestWorkspace, ah as startVitest } from './types-2b1c412e.js'; | ||
import { UserConfig as UserConfig$1, Plugin } from 'vite'; | ||
import { ViteNodeRunner } from 'vite-node/client'; | ||
import { ViteNodeRunnerOptions } from 'vite-node'; | ||
import '@vitest/snapshot'; | ||
import '@vitest/expect'; | ||
import '@vitest/runner/types'; | ||
import '@vitest/runner'; | ||
@@ -12,6 +12,7 @@ import '@vitest/runner/utils'; | ||
import 'tinybench'; | ||
import '@vitest/snapshot/manager'; | ||
import 'vite-node/server'; | ||
import 'node:worker_threads'; | ||
import 'source-map'; | ||
import 'node:fs'; | ||
import 'chai'; | ||
@@ -22,13 +23,16 @@ declare function createVitest(mode: VitestRunMode, options: UserConfig, viteOverrides?: UserConfig$1): Promise<Vitest>; | ||
declare function registerConsoleShortcuts(ctx: Vitest): void; | ||
type Key = string | symbol; | ||
declare class VitestMocker { | ||
executor: VitestExecutor; | ||
private static pendingIds; | ||
static pendingIds: PendingSuiteMock[]; | ||
private resolveCache; | ||
constructor(executor: VitestExecutor); | ||
private get root(); | ||
private get base(); | ||
private get mockMap(); | ||
private get moduleCache(); | ||
private get moduleDirectories(); | ||
private deleteCachedItem; | ||
private isAModuleDirectory; | ||
getSuiteFilepath(): string; | ||
@@ -39,3 +43,3 @@ getMocks(): { | ||
private resolvePath; | ||
private resolveMocks; | ||
resolveMocks(): Promise<void>; | ||
private callFunctionMock; | ||
@@ -58,2 +62,3 @@ getMockPath(dep: string): string; | ||
mockMap: MockMap; | ||
moduleDirectories?: string[]; | ||
} | ||
@@ -65,3 +70,4 @@ declare class VitestExecutor extends ViteNodeRunner { | ||
shouldResolveId(id: string, _importee?: string | undefined): boolean; | ||
resolveUrl(id: string, importer?: string): Promise<[url: string, fsPath: string]>; | ||
originalResolveUrl(id: string, importer?: string): Promise<[url: string, fsPath: string]>; | ||
resolveUrl(id: string, importer?: string): Promise<[string, string]>; | ||
dependencyRequest(id: string, fsPath: string, callstack: string[]): Promise<any>; | ||
@@ -74,6 +80,6 @@ prepareContext(context: Record<string, any>): Record<string, any>; | ||
constructor(ctx: Vitest); | ||
shard(files: string[]): Promise<string[]>; | ||
sort(files: string[]): Promise<string[]>; | ||
shard(files: WorkspaceSpec[]): Promise<WorkspaceSpec[]>; | ||
sort(files: WorkspaceSpec[]): Promise<WorkspaceSpec[]>; | ||
} | ||
export { BaseSequencer, ExecuteOptions, VitestExecutor, VitestPlugin, createVitest }; | ||
export { BaseSequencer, ExecuteOptions, TestSequencer, Vitest, VitestExecutor, VitestPlugin, WorkspaceSpec, createVitest, registerConsoleShortcuts }; |
@@ -1,13 +0,16 @@ | ||
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-node-pkg.208acffb.js'; | ||
export { V as VitestExecutor } from './chunk-runtime-mocker.a048e92d.js'; | ||
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor-cli-api.f9adf98c.js'; | ||
export { V as VitestExecutor } from './vendor-execute.001ae440.js'; | ||
import 'pathe'; | ||
import './chunk-constants.797d3ebf.js'; | ||
import './vendor-constants.538d9b49.js'; | ||
import './vendor-coverage.de2180ed.js'; | ||
import './vendor-index.75f2b63d.js'; | ||
import 'node:console'; | ||
import 'local-pkg'; | ||
import 'node:url'; | ||
import './chunk-utils-env.860d90c2.js'; | ||
import 'picocolors'; | ||
import './vendor-index.fad2598b.js'; | ||
import 'std-env'; | ||
import './chunk-integrations-coverage.e0a6acd2.js'; | ||
import 'local-pkg'; | ||
import './chunk-env-node.affdd278.js'; | ||
import 'node:console'; | ||
import 'picocolors'; | ||
import '@vitest/runner/utils'; | ||
import '@vitest/utils'; | ||
import './vendor-global.6795f91f.js'; | ||
import 'vite'; | ||
@@ -23,39 +26,34 @@ import 'node:path'; | ||
import 'fs'; | ||
import './vendor-_commonjsHelpers.addc3445.js'; | ||
import './vendor-_commonjsHelpers.76cdd49e.js'; | ||
import 'vite-node/utils'; | ||
import 'vite-node/client'; | ||
import '@vitest/snapshot/manager'; | ||
import 'vite-node/server'; | ||
import './chunk-utils-global.727b6d25.js'; | ||
import '@vitest/runner/utils'; | ||
import '@vitest/utils'; | ||
import 'node:fs/promises'; | ||
import './vendor-index.2cbcdd1e.js'; | ||
import './vendor-paths.84fc7a99.js'; | ||
import 'node:v8'; | ||
import 'node:child_process'; | ||
import './vendor-index.87ab04c3.js'; | ||
import 'node:worker_threads'; | ||
import 'node:os'; | ||
import 'tinypool'; | ||
import 'node:perf_hooks'; | ||
import './vendor-tasks.f9d75aed.js'; | ||
import 'node:module'; | ||
import 'node:crypto'; | ||
import './vendor-index.c1e09929.js'; | ||
import 'node:buffer'; | ||
import 'node:child_process'; | ||
import 'child_process'; | ||
import 'node:os'; | ||
import 'assert'; | ||
import 'buffer'; | ||
import 'source-map'; | ||
import 'node:util'; | ||
import 'node:fs/promises'; | ||
import 'module'; | ||
import 'acorn'; | ||
import 'acorn-walk'; | ||
import 'node:v8'; | ||
import './vendor-index.783e7f3e.js'; | ||
import './chunk-utils-base.81f83dbd.js'; | ||
import 'node:worker_threads'; | ||
import 'tinypool'; | ||
import 'perf_hooks'; | ||
import './chunk-utils-tasks.b41c8284.js'; | ||
import 'crypto'; | ||
import 'vite-node/utils'; | ||
import '@vitest/utils/diff'; | ||
import 'node:module'; | ||
import 'node:crypto'; | ||
import './chunk-magic-string.3a794426.js'; | ||
import 'magic-string'; | ||
import 'strip-literal'; | ||
import 'node:readline'; | ||
import 'readline'; | ||
import './vendor-index.bdee400f.js'; | ||
import 'node:assert'; | ||
import 'node:util'; | ||
import '@vitest/utils/error'; | ||
import '@vitest/spy'; | ||
import './chunk-runtime-rpc.971b3848.js'; | ||
import './vendor-rpc.4d3d7a54.js'; |
@@ -1,6 +0,6 @@ | ||
import { VitestRunner, VitestRunnerImportSource, Suite, Test, TestContext } from '@vitest/runner'; | ||
import { a as ResolvedConfig } from './types-7cd96283.js'; | ||
import { VitestRunner, VitestRunnerImportSource, Suite, Test, CancelReason, TestContext } from '@vitest/runner'; | ||
import { a as ResolvedConfig } from './types-2b1c412e.js'; | ||
import '@vitest/snapshot'; | ||
import '@vitest/expect'; | ||
import 'vite'; | ||
import '@vitest/runner/types'; | ||
import '@vitest/runner/utils'; | ||
@@ -10,7 +10,8 @@ import '@vitest/utils'; | ||
import 'vite-node/client'; | ||
import '@vitest/snapshot/manager'; | ||
import 'vite-node/server'; | ||
import 'node:worker_threads'; | ||
import 'vite-node'; | ||
import 'source-map'; | ||
import 'node:fs'; | ||
import 'chai'; | ||
@@ -22,2 +23,3 @@ declare class VitestTestRunner implements VitestRunner { | ||
private __vitest_executor; | ||
private cancelRun; | ||
constructor(config: ResolvedConfig); | ||
@@ -29,3 +31,5 @@ importFile(filepath: string, source: VitestRunnerImportSource): unknown; | ||
onAfterRunTest(test: Test): void; | ||
onCancel(_reason: CancelReason): void; | ||
onBeforeRunTest(test: Test): Promise<void>; | ||
onBeforeRunSuite(suite: Suite): void; | ||
onBeforeTryTest(test: Test): void; | ||
@@ -32,0 +36,0 @@ onAfterTryTest(test: Test): void; |
import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect'; | ||
import { d as getSnapshotClient, c as createExpect, a as vi, e as getBenchOptions, f as getBenchFn } from './chunk-utils-import.ec15dcad.js'; | ||
import { g as getWorkerState } from './chunk-utils-global.727b6d25.js'; | ||
import { g as getFullName } from './chunk-utils-tasks.b41c8284.js'; | ||
import { g as getSnapshotClient, c as createExpect, v as vi, a as getBenchOptions, b as getBenchFn } from './vendor-vi.74cf3ef7.js'; | ||
import './vendor-index.fad2598b.js'; | ||
import { r as rpc } from './vendor-rpc.4d3d7a54.js'; | ||
import { g as getFullName } from './vendor-tasks.f9d75aed.js'; | ||
import { g as getWorkerState } from './vendor-global.6795f91f.js'; | ||
import { getNames } from '@vitest/runner/utils'; | ||
import { performance } from 'node:perf_hooks'; | ||
import { updateTask } from '@vitest/runner'; | ||
import { createDefer, getSafeTimers } from '@vitest/utils'; | ||
import '@vitest/runner/utils'; | ||
import 'chai'; | ||
import './vendor-_commonjsHelpers.addc3445.js'; | ||
import './chunk-runtime-rpc.971b3848.js'; | ||
import 'pathe'; | ||
import './chunk-snapshot-env.a347d647.js'; | ||
import './chunk-utils-base.81f83dbd.js'; | ||
import './vendor-_commonjsHelpers.76cdd49e.js'; | ||
import '@vitest/snapshot'; | ||
import '@vitest/utils/error'; | ||
import 'util'; | ||
import '@vitest/spy'; | ||
import './chunk-utils-env.860d90c2.js'; | ||
import 'pathe'; | ||
import 'std-env'; | ||
@@ -24,2 +25,3 @@ | ||
this.workerState = getWorkerState(); | ||
this.cancelRun = false; | ||
} | ||
@@ -35,3 +37,5 @@ importFile(filepath, source) { | ||
async onAfterRun() { | ||
await this.snapshotClient.saveCurrent(); | ||
const result = await this.snapshotClient.resetCurrent(); | ||
if (result) | ||
await rpc().snapshotSaved(result); | ||
} | ||
@@ -48,11 +52,21 @@ onAfterRunSuite(suite) { | ||
} | ||
onCancel(_reason) { | ||
this.cancelRun = true; | ||
} | ||
async onBeforeRunTest(test) { | ||
const name = getNames(test).slice(1).join(" > "); | ||
if (this.cancelRun) | ||
test.mode = "skip"; | ||
if (test.mode !== "run") { | ||
this.snapshotClient.skipTestSnapshots(test); | ||
this.snapshotClient.skipTestSnapshots(name); | ||
return; | ||
} | ||
clearModuleMocks(this.config); | ||
await this.snapshotClient.setTest(test); | ||
await this.snapshotClient.setTest(test.file.filepath, name, this.workerState.config.snapshotOptions); | ||
this.workerState.current = test; | ||
} | ||
onBeforeRunSuite(suite) { | ||
if (this.cancelRun) | ||
suite.mode = "skip"; | ||
} | ||
onBeforeTryTest(test) { | ||
@@ -78,2 +92,3 @@ var _a; | ||
isExpectingAssertionsError | ||
// @ts-expect-error local is untyped | ||
} = test.context._local ? test.context.expect.getState() : getState(globalThis[GLOBAL_EXPECT]); | ||
@@ -118,3 +133,3 @@ if (expectedAssertionsNumber !== null && assertionCalls !== expectedAssertionsNumber) | ||
if (!globalThis.EventTarget) | ||
await import('./vendor-index.534e612c.js').then(function (n) { return n.i; }); | ||
await import('./vendor-index.fc98d30f.js').then(function (n) { return n.i; }); | ||
return await import('tinybench'); | ||
@@ -187,23 +202,23 @@ } | ||
}); | ||
Promise.all(benchmarkGroup.map(async (benchmark) => { | ||
const tasks = []; | ||
for (const benchmark of benchmarkGroup) { | ||
await benchmark.meta.task.warmup(); | ||
const { setTimeout } = getSafeTimers(); | ||
return await new Promise((resolve) => setTimeout(async () => { | ||
tasks.push(await new Promise((resolve) => setTimeout(async () => { | ||
resolve(await benchmark.meta.task.run()); | ||
})); | ||
})).then((tasks) => { | ||
suite.result.duration = performance.now() - start; | ||
suite.result.state = "pass"; | ||
tasks.sort((a, b) => a.result.mean - b.result.mean).forEach((cycle, idx) => { | ||
const benchmark = benchmarkMap[cycle.name || ""]; | ||
benchmark.result.state = "pass"; | ||
if (benchmark) { | ||
const result = benchmark.result.benchmark; | ||
result.rank = Number(idx) + 1; | ||
updateTask$1(benchmark); | ||
} | ||
}); | ||
updateTask$1(suite); | ||
defer.resolve(null); | ||
}))); | ||
} | ||
suite.result.duration = performance.now() - start; | ||
suite.result.state = "pass"; | ||
tasks.sort((a, b) => a.result.mean - b.result.mean).forEach((cycle, idx) => { | ||
const benchmark = benchmarkMap[cycle.name || ""]; | ||
benchmark.result.state = "pass"; | ||
if (benchmark) { | ||
const result = benchmark.result.benchmark; | ||
result.rank = Number(idx) + 1; | ||
updateTask$1(benchmark); | ||
} | ||
}); | ||
updateTask$1(suite); | ||
defer.resolve(null); | ||
await defer; | ||
@@ -210,0 +225,0 @@ } |
@@ -1,10 +0,8 @@ | ||
import { c as createBirpc } from './vendor-index.783e7f3e.js'; | ||
import { performance } from 'node:perf_hooks'; | ||
import { c as createBirpc } from './vendor-index.87ab04c3.js'; | ||
import { workerId } from 'tinypool'; | ||
import { g as getWorkerState } from './chunk-utils-global.727b6d25.js'; | ||
import { s as startViteNode, m as moduleCache, a as mockMap } from './chunk-runtime-mocker.a048e92d.js'; | ||
import { a as rpcDone } from './chunk-runtime-rpc.971b3848.js'; | ||
import 'pathe'; | ||
import './chunk-utils-env.860d90c2.js'; | ||
import 'std-env'; | ||
import '@vitest/runner/utils'; | ||
import { g as getWorkerState } from './vendor-global.6795f91f.js'; | ||
import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.001ae440.js'; | ||
import { s as setupInspect } from './vendor-inspector.47fc8cbb.js'; | ||
import { a as rpcDone } from './vendor-rpc.4d3d7a54.js'; | ||
import '@vitest/utils'; | ||
@@ -14,14 +12,8 @@ import 'node:url'; | ||
import 'vite-node/utils'; | ||
import './vendor-index.bdee400f.js'; | ||
import 'acorn'; | ||
import 'node:module'; | ||
import 'pathe'; | ||
import '@vitest/utils/error'; | ||
import './vendor-paths.84fc7a99.js'; | ||
import 'node:fs'; | ||
import 'node:assert'; | ||
import 'node:process'; | ||
import 'node:path'; | ||
import 'node:v8'; | ||
import 'node:util'; | ||
import './chunk-constants.797d3ebf.js'; | ||
import './chunk-utils-base.81f83dbd.js'; | ||
import '@vitest/spy'; | ||
import 'node:module'; | ||
@@ -34,2 +26,7 @@ function init(ctx) { | ||
process.env.VITEST_POOL_ID = String(workerId); | ||
let setCancel = (_reason) => { | ||
}; | ||
const onCancel = new Promise((resolve) => { | ||
setCancel = resolve; | ||
}); | ||
globalThis.__vitest_environment__ = config.environment; | ||
@@ -41,6 +38,13 @@ globalThis.__vitest_worker__ = { | ||
mockMap, | ||
onCancel, | ||
durations: { | ||
environment: 0, | ||
prepare: performance.now() | ||
}, | ||
rpc: createBirpc( | ||
{}, | ||
{ | ||
eventNames: ["onUserConsoleLog", "onFinished", "onCollected", "onWorkerExit"], | ||
onCancel: setCancel | ||
}, | ||
{ | ||
eventNames: ["onUserConsoleLog", "onFinished", "onCollected", "onWorkerExit", "onCancel"], | ||
post(v) { | ||
@@ -64,8 +68,13 @@ port.postMessage(v); | ||
async function run(ctx) { | ||
init(ctx); | ||
const { run: run2, executor } = await startViteNode(ctx); | ||
await run2(ctx.files, ctx.config, ctx.environment, executor); | ||
await rpcDone(); | ||
const inspectorCleanup = setupInspect(ctx.config); | ||
try { | ||
init(ctx); | ||
const { run: run2, executor } = await startViteNode(ctx); | ||
await run2(ctx.files, ctx.config, ctx.environment, executor); | ||
await rpcDone(); | ||
} finally { | ||
inspectorCleanup(); | ||
} | ||
} | ||
export { run }; |
{ | ||
"name": "vitest", | ||
"type": "module", | ||
"version": "0.29.2", | ||
"version": "0.32.2", | ||
"description": "A blazing fast unit test framework powered by Vite", | ||
"author": "Anthony Fu <anthonyfu117@hotmail.com>", | ||
"license": "MIT", | ||
"funding": "https://github.com/sponsors/antfu", | ||
"funding": "https://opencollective.com/vitest", | ||
"homepage": "https://github.com/vitest-dev/vitest#readme", | ||
@@ -64,2 +64,6 @@ "repository": { | ||
}, | ||
"./utils": { | ||
"types": "./dist/utils.d.ts", | ||
"import": "./dist/utils.js" | ||
}, | ||
"./config": { | ||
@@ -90,3 +94,3 @@ "types": "./config.d.ts", | ||
"engines": { | ||
"node": ">=v14.16.0" | ||
"node": ">=v14.18.0" | ||
}, | ||
@@ -98,3 +102,6 @@ "peerDependencies": { | ||
"happy-dom": "*", | ||
"jsdom": "*" | ||
"jsdom": "*", | ||
"playwright": "*", | ||
"safaridriver": "*", | ||
"webdriverio": "*" | ||
}, | ||
@@ -114,2 +121,11 @@ "peerDependenciesMeta": { | ||
}, | ||
"webdriverio": { | ||
"optional": true | ||
}, | ||
"safaridriver": { | ||
"optional": true | ||
}, | ||
"playwright": { | ||
"optional": true | ||
}, | ||
"@edge-runtime/vm": { | ||
@@ -120,45 +136,47 @@ "optional": true | ||
"dependencies": { | ||
"@types/chai": "^4.3.4", | ||
"@types/chai": "^4.3.5", | ||
"@types/chai-subset": "^1.3.3", | ||
"@types/node": "*", | ||
"acorn": "^8.8.1", | ||
"acorn": "^8.8.2", | ||
"acorn-walk": "^8.2.0", | ||
"cac": "^6.7.14", | ||
"chai": "^4.3.7", | ||
"concordance": "^5.0.4", | ||
"debug": "^4.3.4", | ||
"local-pkg": "^0.4.2", | ||
"local-pkg": "^0.4.3", | ||
"magic-string": "^0.30.0", | ||
"pathe": "^1.1.0", | ||
"picocolors": "^1.0.0", | ||
"source-map": "^0.6.1", | ||
"std-env": "^3.3.1", | ||
"strip-literal": "^1.0.0", | ||
"tinybench": "^2.3.1", | ||
"tinypool": "^0.3.1", | ||
"tinyspy": "^1.0.2", | ||
"std-env": "^3.3.2", | ||
"strip-literal": "^1.0.1", | ||
"tinybench": "^2.5.0", | ||
"tinypool": "^0.5.0", | ||
"vite": "^3.0.0 || ^4.0.0", | ||
"why-is-node-running": "^2.2.2", | ||
"@vitest/utils": "0.29.2", | ||
"vite-node": "0.29.2", | ||
"@vitest/spy": "0.29.2", | ||
"@vitest/runner": "0.29.2", | ||
"@vitest/expect": "0.29.2" | ||
"@vitest/expect": "0.32.2", | ||
"@vitest/runner": "0.32.2", | ||
"vite-node": "0.32.2", | ||
"@vitest/snapshot": "0.32.2", | ||
"@vitest/spy": "0.32.2", | ||
"@vitest/utils": "0.32.2" | ||
}, | ||
"devDependencies": { | ||
"@ampproject/remapping": "^2.2.1", | ||
"@antfu/install-pkg": "^0.1.1", | ||
"@edge-runtime/vm": "2.0.2", | ||
"@edge-runtime/vm": "3.0.1", | ||
"@jridgewell/trace-mapping": "^0.3.18", | ||
"@sinonjs/fake-timers": "^10.0.2", | ||
"@types/diff": "^5.0.2", | ||
"@types/diff": "^5.0.3", | ||
"@types/estree": "^1.0.1", | ||
"@types/istanbul-lib-coverage": "^2.0.4", | ||
"@types/istanbul-reports": "^3.0.1", | ||
"@types/jsdom": "^21.1.0", | ||
"@types/jsdom": "^21.1.1", | ||
"@types/micromatch": "^4.0.2", | ||
"@types/natural-compare": "^1.4.1", | ||
"@types/prompts": "^2.4.2", | ||
"@types/prompts": "^2.4.4", | ||
"@types/sinonjs__fake-timers": "^8.1.2", | ||
"birpc": "^0.2.3", | ||
"birpc": "0.2.12", | ||
"chai-subset": "^1.6.0", | ||
"cli-truncate": "^3.1.0", | ||
"diff": "^5.1.0", | ||
"event-target-polyfill": "^0.0.3", | ||
"execa": "^7.0.0", | ||
"execa": "^7.1.1", | ||
"expect-type": "^0.15.0", | ||
@@ -168,18 +186,17 @@ "fast-glob": "^3.2.12", | ||
"flatted": "^3.2.7", | ||
"get-tsconfig": "^4.3.0", | ||
"happy-dom": "^8.3.2", | ||
"jsdom": "^21.1.0", | ||
"get-tsconfig": "^4.5.0", | ||
"happy-dom": "^9.10.7", | ||
"jsdom": "^22.1.0", | ||
"log-update": "^5.0.1", | ||
"magic-string": "^0.27.0", | ||
"micromatch": "^4.0.5", | ||
"mlly": "^1.1.0", | ||
"natural-compare": "^1.4.0", | ||
"mlly": "^1.2.0", | ||
"p-limit": "^4.0.0", | ||
"pkg-types": "^1.0.1", | ||
"pkg-types": "^1.0.3", | ||
"playwright": "^1.33.0", | ||
"pretty-format": "^27.5.1", | ||
"prompts": "^2.4.2", | ||
"rollup": "^2.79.1", | ||
"safaridriver": "^0.0.4", | ||
"strip-ansi": "^7.0.1", | ||
"typescript": "^4.9.4", | ||
"ws": "^8.12.0" | ||
"webdriverio": "^8.9.0", | ||
"ws": "^8.13.0" | ||
}, | ||
@@ -186,0 +203,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
68
59
12
1303571
33
34964
+ Added@vitest/snapshot@0.32.2
+ Addedconcordance@^5.0.4
+ Addedmagic-string@^0.30.0
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Added@promptbook/utils@0.70.0-1(transitive)
+ Added@puppeteer/browsers@2.4.0(transitive)
+ Added@tootallnate/quickjs-emscripten@0.23.0(transitive)
+ Added@types/node@20.16.5(transitive)
+ Added@types/sinonjs__fake-timers@8.1.5(transitive)
+ Added@types/which@2.0.2(transitive)
+ Added@types/ws@8.5.12(transitive)
+ Added@types/yauzl@2.10.3(transitive)
+ Added@vitest/expect@0.32.2(transitive)
+ Added@vitest/runner@0.32.2(transitive)
+ Added@vitest/snapshot@0.32.2(transitive)
+ Added@vitest/spy@0.32.2(transitive)
+ Added@vitest/utils@0.32.2(transitive)
+ Added@wdio/config@9.0.8(transitive)
+ Added@wdio/logger@8.38.09.0.8(transitive)
+ Added@wdio/protocols@9.0.8(transitive)
+ Added@wdio/repl@9.0.8(transitive)
+ Added@wdio/types@9.0.8(transitive)
+ Added@wdio/utils@9.0.8(transitive)
+ Added@zip.js/zip.js@2.7.52(transitive)
+ Addedabort-controller@3.0.0(transitive)
+ Addedarchiver@7.0.1(transitive)
+ Addedarchiver-utils@5.0.2(transitive)
+ Addedast-types@0.13.4(transitive)
+ Addedasync@3.2.6(transitive)
+ Addedb4a@1.6.6(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbare-events@2.4.2(transitive)
+ Addedbare-fs@2.3.5(transitive)
+ Addedbare-os@2.4.4(transitive)
+ Addedbare-path@2.1.3(transitive)
+ Addedbare-stream@2.3.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbasic-ftp@5.0.5(transitive)
+ Addedblueimp-md5@2.19.0(transitive)
+ Addedboolbase@1.0.0(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedbuffer@5.7.16.0.3(transitive)
+ Addedbuffer-crc32@0.2.131.0.0(transitive)
+ Addedchalk@5.3.0(transitive)
+ Addedcheerio@1.0.0(transitive)
+ Addedcheerio-select@2.1.0(transitive)
+ Addedcommander@9.5.0(transitive)
+ Addedcompress-commons@6.0.2(transitive)
+ Addedconcordance@5.0.4(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcrc-32@1.2.2(transitive)
+ Addedcrc32-stream@6.0.0(transitive)
+ Addedcross-spawn@7.0.3(transitive)
+ Addedcss-select@5.1.0(transitive)
+ Addedcss-shorthand-properties@1.1.1(transitive)
+ Addedcss-value@0.0.1(transitive)
+ Addedcss-what@6.1.0(transitive)
+ Addeddata-uri-to-buffer@4.0.16.0.2(transitive)
+ Addeddate-time@3.1.0(transitive)
+ Addeddecamelize@6.0.0(transitive)
+ Addeddeepmerge-ts@7.1.0(transitive)
+ Addeddegenerator@5.0.1(transitive)
+ Addeddiff-sequences@29.6.3(transitive)
+ Addeddom-serializer@2.0.0(transitive)
+ Addeddomelementtype@2.3.0(transitive)
+ Addeddomhandler@5.0.3(transitive)
+ Addeddomutils@3.1.0(transitive)
+ Addededge-paths@3.0.5(transitive)
+ Addededgedriver@5.6.1(transitive)
+ Addedencoding-sniffer@0.2.0(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedescodegen@2.1.0(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedestraverse@5.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedextract-zip@2.0.1(transitive)
+ Addedfast-deep-equal@2.0.1(transitive)
+ Addedfast-diff@1.3.0(transitive)
+ Addedfast-fifo@1.3.2(transitive)
+ Addedfast-xml-parser@4.5.0(transitive)
+ Addedfd-slicer@1.1.0(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedformdata-polyfill@4.0.10(transitive)
+ Addedfs-extra@11.2.0(transitive)
+ Addedfsevents@2.3.2(transitive)
+ Addedgeckodriver@4.4.4(transitive)
+ Addedget-port@7.1.0(transitive)
+ Addedget-stream@5.2.0(transitive)
+ Addedget-uri@6.0.3(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedgrapheme-splitter@1.0.4(transitive)
+ Addedhtmlfy@0.2.1(transitive)
+ Addedhtmlparser2@9.1.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedimmediate@3.0.6(transitive)
+ Addedimport-meta-resolve@4.1.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedip-address@9.0.5(transitive)
+ Addedis-plain-obj@4.1.0(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisexe@2.0.03.1.1(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedjs-string-escape@1.0.1(transitive)
+ Addedjsbn@1.1.0(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addedjszip@3.10.1(transitive)
+ Addedlazystream@1.0.1(transitive)
+ Addedlie@3.3.0(transitive)
+ Addedlocate-app@2.4.41(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlodash.clonedeep@4.5.0(transitive)
+ Addedlodash.zip@4.2.0(transitive)
+ Addedloglevel@1.9.2(transitive)
+ Addedloglevel-plugin-prefix@0.8.4(transitive)
+ Addedlru-cache@10.4.37.18.3(transitive)
+ Addedmd5-hex@3.0.1(transitive)
+ Addedminimatch@5.1.69.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addednetmask@2.0.2(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.3.2(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addednth-check@2.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpac-proxy-agent@7.0.2(transitive)
+ Addedpac-resolver@7.0.1(transitive)
+ Addedpackage-json-from-dist@1.0.0(transitive)
+ Addedpako@1.0.11(transitive)
+ Addedparse5-htmlparser2-tree-adapter@7.0.0(transitive)
+ Addedparse5-parser-stream@7.1.2(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedpend@1.2.0(transitive)
+ Addedplaywright@1.47.0(transitive)
+ Addedplaywright-core@1.47.0(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedprogress@2.0.3(transitive)
+ Addedproxy-agent@6.4.0(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedquery-selector-shadow-dom@1.0.1(transitive)
+ Addedqueue-tick@1.0.1(transitive)
+ Addedreadable-stream@2.3.84.5.2(transitive)
+ Addedreaddir-glob@1.1.3(transitive)
+ Addedresq@1.11.0(transitive)
+ Addedrgb2hex@0.2.5(transitive)
+ Addedsafaridriver@0.1.2(transitive)
+ Addedsafe-buffer@5.1.25.2.1(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedserialize-error@11.0.3(transitive)
+ Addedsetimmediate@1.0.5(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsmart-buffer@4.2.0(transitive)
+ Addedsocks@2.8.3(transitive)
+ Addedsocks-proxy-agent@8.0.4(transitive)
+ Addedspacetrim@0.11.39(transitive)
+ Addedsplit2@4.2.0(transitive)
+ Addedsprintf-js@1.1.3(transitive)
+ Addedstreamx@2.20.1(transitive)
+ Addedstring_decoder@1.1.11.3.0(transitive)
+ Addedstrnum@1.0.5(transitive)
+ Addedtar-fs@3.0.6(transitive)
+ Addedtar-stream@3.1.7(transitive)
+ Addedtext-decoder@1.2.0(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtime-zone@1.0.0(transitive)
+ Addedtinypool@0.5.0(transitive)
+ Addedtinyspy@2.2.1(transitive)
+ Addedtslib@2.7.0(transitive)
+ Addedtype-fest@2.13.02.19.0(transitive)
+ Addedunbzip2-stream@1.4.3(transitive)
+ Addedundici@6.19.8(transitive)
+ Addeduniversalify@2.0.1(transitive)
+ Addedurlpattern-polyfill@10.0.0(transitive)
+ Addeduserhome@1.0.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedvite-node@0.32.2(transitive)
+ Addedwait-port@1.1.0(transitive)
+ Addedweb-streams-polyfill@3.3.3(transitive)
+ Addedwebdriver@9.0.8(transitive)
+ Addedwebdriverio@9.0.9(transitive)
+ Addedwell-known-symbols@2.0.0(transitive)
+ Addedwhich@2.0.24.0.0(transitive)
+ Addedwrap-ansi@8.1.0(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyauzl@2.10.0(transitive)
+ Addedzip-stream@6.0.1(transitive)
- Removedsource-map@^0.6.1
- Removedtinyspy@^1.0.2
- Removed@vitest/expect@0.29.2(transitive)
- Removed@vitest/runner@0.29.2(transitive)
- Removed@vitest/spy@0.29.2(transitive)
- Removed@vitest/utils@0.29.2(transitive)
- Removedcli-truncate@3.1.0(transitive)
- Removeddiff@5.2.0(transitive)
- Removedis-fullwidth-code-point@4.0.0(transitive)
- Removedslice-ansi@5.0.0(transitive)
- Removedtinypool@0.3.1(transitive)
- Removedtinyspy@1.1.1(transitive)
- Removedvite-node@0.29.2(transitive)
Updated@types/chai@^4.3.5
Updated@vitest/expect@0.32.2
Updated@vitest/runner@0.32.2
Updated@vitest/spy@0.32.2
Updated@vitest/utils@0.32.2
Updatedacorn@^8.8.2
Updatedlocal-pkg@^0.4.3
Updatedstd-env@^3.3.2
Updatedstrip-literal@^1.0.1
Updatedtinybench@^2.5.0
Updatedtinypool@^0.5.0
Updatedvite-node@0.32.2