vitest 1.0.2 → 1.0.3
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/cli.js +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/coverage.d.ts +1 -1
- package/dist/environments.d.ts +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/node.d.ts +2 -2
- package/dist/node.js +1 -1
- package/dist/{reporters-3OMQDZar.d.ts → reporters-OH1c16Kq.d.ts} +0 -1
- package/dist/reporters.d.ts +1 -1
- package/dist/runners.d.ts +1 -1
- package/dist/{suite-yBB1jXl9.d.ts → suite-9ReVEt_h.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/vendor/{node.hPXN4l9e.js → node.XBEcdByD.js} +5 -9
- package/package.json +8 -8
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-OH1c16Kq.js';
|
|
3
3
|
import { VitestExecutor } from './execute.js';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import 'vite-node';
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.XBEcdByD.js';
|
|
5
5
|
import './vendor/index.XU72Rmy8.js';
|
|
6
6
|
import { d as divider } from './vendor/reporters.pr8MinP9.js';
|
|
7
7
|
import { t as toArray } from './vendor/base._79unx2z.js';
|
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-OH1c16Kq.js';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import 'vite-node';
|
|
6
6
|
import '@vitest/snapshot';
|
package/dist/coverage.d.ts
CHANGED
package/dist/environments.d.ts
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-OH1c16Kq.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-9ReVEt_h.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-OH1c16Kq.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-OH1c16Kq.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';
|
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-OH1c16Kq.js';
|
|
2
|
+
export { l as BrowserProvider, k as BrowserProviderInitializationOptions, m as BrowserProviderOptions, i as ProcessPool, j as TestSequencerConstructor, s as startVitest } from './reporters-OH1c16Kq.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.XBEcdByD.js';
|
|
2
2
|
import 'pathe';
|
|
3
3
|
import 'vite';
|
|
4
4
|
import 'node:path';
|
|
@@ -861,7 +861,6 @@ declare class Vitest {
|
|
|
861
861
|
private _onClose;
|
|
862
862
|
private _onSetServer;
|
|
863
863
|
private _onCancelListeners;
|
|
864
|
-
private _poolClosePromise?;
|
|
865
864
|
setServer(options: UserConfig, server: ViteDevServer, cliOptions: UserConfig): Promise<void>;
|
|
866
865
|
private createCoreProject;
|
|
867
866
|
getCoreWorkspaceProject(): WorkspaceProject;
|
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-OH1c16Kq.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
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-OH1c16Kq.js';
|
|
3
3
|
import * as tinybench from 'tinybench';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import 'vite-node';
|
|
@@ -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-OH1c16Kq.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-9ReVEt_h.js';
|
|
4
|
+
import './reporters-OH1c16Kq.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import 'vite-node';
|
|
7
7
|
import '@vitest/snapshot';
|
|
@@ -63,7 +63,7 @@ function _mergeNamespaces(n, m) {
|
|
|
63
63
|
return Object.freeze(n);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
var version$1 = "1.0.
|
|
66
|
+
var version$1 = "1.0.3";
|
|
67
67
|
|
|
68
68
|
const __dirname$1 = url.fileURLToPath(new URL(".", import.meta.url));
|
|
69
69
|
async function ensurePackageInstalled(dependency, root) {
|
|
@@ -6292,7 +6292,7 @@ createLogUpdate(process$2.stdout);
|
|
|
6292
6292
|
|
|
6293
6293
|
createLogUpdate(process$2.stderr);
|
|
6294
6294
|
|
|
6295
|
-
var version = "1.0.
|
|
6295
|
+
var version = "1.0.3";
|
|
6296
6296
|
|
|
6297
6297
|
async function printError(error, project, options) {
|
|
6298
6298
|
const { showCodeFrame = true, fullStack = false, type } = options;
|
|
@@ -7615,7 +7615,6 @@ class Vitest {
|
|
|
7615
7615
|
_onClose = [];
|
|
7616
7616
|
_onSetServer = [];
|
|
7617
7617
|
_onCancelListeners = [];
|
|
7618
|
-
_poolClosePromise;
|
|
7619
7618
|
async setServer(options, server, cliOptions) {
|
|
7620
7619
|
var _a, _b, _c, _d;
|
|
7621
7620
|
(_a = this.unregisterWatcher) == null ? void 0 : _a.call(this);
|
|
@@ -7806,7 +7805,7 @@ class Vitest {
|
|
|
7806
7805
|
return Promise.all(this.projects.map((w) => w.initBrowserProvider()));
|
|
7807
7806
|
}
|
|
7808
7807
|
async start(filters) {
|
|
7809
|
-
var _a, _b
|
|
7808
|
+
var _a, _b;
|
|
7810
7809
|
this._onClose = [];
|
|
7811
7810
|
try {
|
|
7812
7811
|
await this.initCoverageProvider();
|
|
@@ -7832,8 +7831,6 @@ class Vitest {
|
|
|
7832
7831
|
await this.cache.stats.populateStats(this.config.root, files);
|
|
7833
7832
|
await this.runFiles(files);
|
|
7834
7833
|
}
|
|
7835
|
-
if (!this.config.watch && ((_c = this.pool) == null ? void 0 : _c.close))
|
|
7836
|
-
this._poolClosePromise = this.pool.close();
|
|
7837
7834
|
await this.reportCoverage(true);
|
|
7838
7835
|
if (this.config.watch)
|
|
7839
7836
|
await this.report("onWatcherStart");
|
|
@@ -7848,7 +7845,7 @@ class Vitest {
|
|
|
7848
7845
|
return;
|
|
7849
7846
|
const dependencies = [...transformed.deps || [], ...transformed.dynamicDeps || []];
|
|
7850
7847
|
await Promise.all(dependencies.map(async (dep) => {
|
|
7851
|
-
const path = await
|
|
7848
|
+
const path = await project.server.pluginContainer.resolveId(dep, filepath2, { ssr: true });
|
|
7852
7849
|
const fsPath = path && !path.external && path.id.split("?")[0];
|
|
7853
7850
|
if (fsPath && !fsPath.includes("node_modules") && !deps.has(fsPath) && existsSync(fsPath)) {
|
|
7854
7851
|
deps.add(fsPath);
|
|
@@ -8154,8 +8151,7 @@ class Vitest {
|
|
|
8154
8151
|
if (this.pool) {
|
|
8155
8152
|
closePromises.push((async () => {
|
|
8156
8153
|
var _a, _b;
|
|
8157
|
-
await (
|
|
8158
|
-
this._poolClosePromise = void 0;
|
|
8154
|
+
await ((_b = (_a = this.pool) == null ? void 0 : _a.close) == null ? void 0 : _b.call(_a));
|
|
8159
8155
|
this.pool = void 0;
|
|
8160
8156
|
})());
|
|
8161
8157
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -147,12 +147,12 @@
|
|
|
147
147
|
"tinypool": "^0.8.1",
|
|
148
148
|
"vite": "^5.0.0",
|
|
149
149
|
"why-is-node-running": "^2.2.2",
|
|
150
|
-
"
|
|
151
|
-
"@vitest/
|
|
152
|
-
"@vitest/
|
|
153
|
-
"@vitest/
|
|
154
|
-
"
|
|
155
|
-
"@vitest/
|
|
150
|
+
"@vitest/expect": "1.0.3",
|
|
151
|
+
"@vitest/utils": "1.0.3",
|
|
152
|
+
"@vitest/spy": "1.0.3",
|
|
153
|
+
"@vitest/snapshot": "1.0.3",
|
|
154
|
+
"vite-node": "1.0.3",
|
|
155
|
+
"@vitest/runner": "1.0.3"
|
|
156
156
|
},
|
|
157
157
|
"devDependencies": {
|
|
158
158
|
"@ampproject/remapping": "^2.2.1",
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
"get-tsconfig": "^4.7.2",
|
|
177
177
|
"happy-dom": "^12.10.3",
|
|
178
178
|
"jsdom": "^23.0.1",
|
|
179
|
-
"log-update": "^
|
|
179
|
+
"log-update": "^5.0.1",
|
|
180
180
|
"micromatch": "^4.0.5",
|
|
181
181
|
"p-limit": "^5.0.0",
|
|
182
182
|
"pretty-format": "^29.7.0",
|