vitest 1.1.2 → 1.1.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 +2 -2
- 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 +2 -2
- package/dist/{reporters-xH8_lESK.d.ts → reporters-qc5Smpt5.d.ts} +2 -0
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +1 -1
- package/dist/runners.d.ts +1 -1
- package/dist/{suite-GoqTeX8s.d.ts → suite-WwpgKT7k.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/vendor/{node.UBNKMR9Y.js → node.wTZytysZ.js} +14 -18
- package/dist/vendor/{reporters.oUR9etwS.js → reporters.7Y4WN6gc.js} +4 -4
- package/package.json +7 -7
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-qc5Smpt5.js';
|
|
3
3
|
import { VitestExecutor } from './execute.js';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import 'vite-node';
|
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { normalize } from 'pathe';
|
|
2
2
|
import cac from 'cac';
|
|
3
3
|
import c from 'picocolors';
|
|
4
|
-
import { v as version, s as startVitest } from './vendor/node.
|
|
4
|
+
import { v as version, s as startVitest } from './vendor/node.wTZytysZ.js';
|
|
5
5
|
import './vendor/index.XU72Rmy8.js';
|
|
6
|
-
import { d as divider } from './vendor/reporters.
|
|
6
|
+
import { d as divider } from './vendor/reporters.7Y4WN6gc.js';
|
|
7
7
|
import { t as toArray } from './vendor/base._79unx2z.js';
|
|
8
8
|
import 'vite';
|
|
9
9
|
import 'node:path';
|
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UserConfig, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv, UserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { a as ResolvedCoverageOptions, C as CoverageV8Options, P as ProjectConfig } from './reporters-
|
|
3
|
+
import { a as ResolvedCoverageOptions, C as CoverageV8Options, P as ProjectConfig } from './reporters-qc5Smpt5.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-qc5Smpt5.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-WwpgKT7k.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-qc5Smpt5.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-qc5Smpt5.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-qc5Smpt5.js';
|
|
2
|
+
export { l as BrowserProvider, k as BrowserProviderInitializationOptions, m as BrowserProviderOptions, i as ProcessPool, j as TestSequencerConstructor, s as startVitest } from './reporters-qc5Smpt5.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.wTZytysZ.js';
|
|
2
2
|
import 'pathe';
|
|
3
3
|
import 'vite';
|
|
4
4
|
import 'node:path';
|
|
@@ -41,7 +41,7 @@ import 'node:module';
|
|
|
41
41
|
import 'local-pkg';
|
|
42
42
|
import 'module';
|
|
43
43
|
import 'acorn-walk';
|
|
44
|
-
import './vendor/reporters.
|
|
44
|
+
import './vendor/reporters.7Y4WN6gc.js';
|
|
45
45
|
import './chunks/runtime-console.hf2msWA9.js';
|
|
46
46
|
import 'node:stream';
|
|
47
47
|
import 'node:console';
|
|
@@ -959,6 +959,7 @@ interface ListRendererOptions$1 {
|
|
|
959
959
|
renderSucceed?: boolean;
|
|
960
960
|
logger: Logger;
|
|
961
961
|
showHeap: boolean;
|
|
962
|
+
slowTestThreshold: number;
|
|
962
963
|
mode: VitestRunMode;
|
|
963
964
|
}
|
|
964
965
|
declare function createListRenderer(_tasks: Task[], options: ListRendererOptions$1): {
|
|
@@ -1084,6 +1085,7 @@ interface ListRendererOptions {
|
|
|
1084
1085
|
renderSucceed?: boolean;
|
|
1085
1086
|
logger: Logger;
|
|
1086
1087
|
showHeap: boolean;
|
|
1088
|
+
slowTestThreshold: number;
|
|
1087
1089
|
}
|
|
1088
1090
|
declare function createTableRenderer(_tasks: Task[], options: ListRendererOptions): {
|
|
1089
1091
|
start(): any;
|
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-qc5Smpt5.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
package/dist/reporters.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { e as BasicReporter, B as BenchmarkReportsMap, D as DefaultReporter, f as DotReporter, H as HangingProcessReporter, g as JUnitReporter, J as JsonReporter, R as ReportersMap, h as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/reporters.
|
|
1
|
+
export { e as BasicReporter, B as BenchmarkReportsMap, D as DefaultReporter, f as DotReporter, H as HangingProcessReporter, g as JUnitReporter, J as JsonReporter, R as ReportersMap, h as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor/reporters.7Y4WN6gc.js';
|
|
2
2
|
import 'node:perf_hooks';
|
|
3
3
|
import 'picocolors';
|
|
4
4
|
import './vendor/index.XU72Rmy8.js';
|
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-qc5Smpt5.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-qc5Smpt5.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-WwpgKT7k.js';
|
|
4
|
+
import './reporters-qc5Smpt5.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import 'vite-node';
|
|
7
7
|
import '@vitest/snapshot';
|
|
@@ -39,7 +39,7 @@ import { isCI, provider as provider$1 } from 'std-env';
|
|
|
39
39
|
import ge from 'module';
|
|
40
40
|
import { ancestor, findNodeAround } from 'acorn-walk';
|
|
41
41
|
import { generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, getTasks, hasFailed } from '@vitest/runner/utils';
|
|
42
|
-
import { R as ReportersMap, B as BenchmarkReportsMap, s as stripAnsi, a as ansiStyles, b as sliceAnsi, d as divider, F as F_POINTER, c as cliTruncate } from './reporters.
|
|
42
|
+
import { R as ReportersMap, B as BenchmarkReportsMap, s as stripAnsi, a as ansiStyles, b as sliceAnsi, d as divider, F as F_POINTER, c as cliTruncate } from './reporters.7Y4WN6gc.js';
|
|
43
43
|
import crypto, { createHash } from 'node:crypto';
|
|
44
44
|
import require$$0$3 from 'assert';
|
|
45
45
|
import MagicString from 'magic-string';
|
|
@@ -64,7 +64,7 @@ function _mergeNamespaces(n, m) {
|
|
|
64
64
|
return Object.freeze(n);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
var version$1 = "1.1.
|
|
67
|
+
var version$1 = "1.1.3";
|
|
68
68
|
|
|
69
69
|
const __dirname$1 = url.fileURLToPath(new URL(".", import.meta.url));
|
|
70
70
|
async function ensurePackageInstalled(dependency, root) {
|
|
@@ -6480,7 +6480,7 @@ createLogUpdate(process$2.stdout);
|
|
|
6480
6480
|
|
|
6481
6481
|
createLogUpdate(process$2.stderr);
|
|
6482
6482
|
|
|
6483
|
-
var version = "1.1.
|
|
6483
|
+
var version = "1.1.3";
|
|
6484
6484
|
|
|
6485
6485
|
async function printError(error, project, options) {
|
|
6486
6486
|
const { showCodeFrame = true, fullStack = false, type } = options;
|
|
@@ -6911,7 +6911,6 @@ ${err.message}`);
|
|
|
6911
6911
|
return;
|
|
6912
6912
|
}
|
|
6913
6913
|
const hoistIndex = ((_a = code.match(hashbangRE)) == null ? void 0 : _a[0].length) ?? 0;
|
|
6914
|
-
let hoistedCode = "";
|
|
6915
6914
|
let hoistedVitestImports = "";
|
|
6916
6915
|
let uid = 0;
|
|
6917
6916
|
const idToImportMap = /* @__PURE__ */ new Map();
|
|
@@ -6962,6 +6961,7 @@ ${err.message}`);
|
|
|
6962
6961
|
}
|
|
6963
6962
|
}
|
|
6964
6963
|
const declaredConst = /* @__PURE__ */ new Set();
|
|
6964
|
+
const hoistedNodes = [];
|
|
6965
6965
|
esmWalker(ast, {
|
|
6966
6966
|
onIdentifier(id2, info, parentStack) {
|
|
6967
6967
|
const binding = idToImportMap.get(id2.name);
|
|
@@ -6987,12 +6987,8 @@ ${err.message}`);
|
|
|
6987
6987
|
var _a2, _b;
|
|
6988
6988
|
if (node.callee.type === "MemberExpression" && isIdentifier(node.callee.object) && (node.callee.object.name === "vi" || node.callee.object.name === "vitest") && isIdentifier(node.callee.property)) {
|
|
6989
6989
|
const methodName = node.callee.property.name;
|
|
6990
|
-
if (methodName === "mock" || methodName === "unmock")
|
|
6991
|
-
|
|
6992
|
-
const nodeCode = code.slice(node.start, end);
|
|
6993
|
-
hoistedCode += `${nodeCode}${nodeCode.endsWith("\n") ? "" : "\n"}`;
|
|
6994
|
-
s.remove(node.start, end);
|
|
6995
|
-
}
|
|
6990
|
+
if (methodName === "mock" || methodName === "unmock")
|
|
6991
|
+
hoistedNodes.push(node);
|
|
6996
6992
|
if (methodName === "hoisted") {
|
|
6997
6993
|
const declarationNode = (_a2 = findNodeAround(ast, node.start, "VariableDeclaration")) == null ? void 0 : _a2.node;
|
|
6998
6994
|
const init = (_b = declarationNode == null ? void 0 : declarationNode.declarations[0]) == null ? void 0 : _b.init;
|
|
@@ -7001,20 +6997,20 @@ ${err.message}`);
|
|
|
7001
6997
|
};
|
|
7002
6998
|
const canMoveDeclaration = init && init.type === "CallExpression" && isViHoisted(init) || init && init.type === "AwaitExpression" && init.argument.type === "CallExpression" && isViHoisted(init.argument);
|
|
7003
6999
|
if (canMoveDeclaration) {
|
|
7004
|
-
|
|
7005
|
-
const nodeCode = code.slice(declarationNode.start, end);
|
|
7006
|
-
hoistedCode += `${nodeCode}${nodeCode.endsWith("\n") ? "" : "\n"}`;
|
|
7007
|
-
s.remove(declarationNode.start, end);
|
|
7000
|
+
hoistedNodes.push(declarationNode);
|
|
7008
7001
|
} else {
|
|
7009
|
-
|
|
7010
|
-
const nodeCode = code.slice(node.start, end);
|
|
7011
|
-
hoistedCode += `${nodeCode}${nodeCode.endsWith("\n") ? "" : "\n"}`;
|
|
7012
|
-
s.remove(node.start, end);
|
|
7002
|
+
hoistedNodes.push(node);
|
|
7013
7003
|
}
|
|
7014
7004
|
}
|
|
7015
7005
|
}
|
|
7016
7006
|
}
|
|
7017
7007
|
});
|
|
7008
|
+
const hoistedCode = hoistedNodes.map((node) => {
|
|
7009
|
+
const end = getBetterEnd(code, node);
|
|
7010
|
+
const nodeCode = s.slice(node.start, end);
|
|
7011
|
+
s.remove(node.start, end);
|
|
7012
|
+
return `${nodeCode}${nodeCode.endsWith("\n") ? "" : "\n"}`;
|
|
7013
|
+
}).join("");
|
|
7018
7014
|
if (hoistedCode || hoistedVitestImports) {
|
|
7019
7015
|
s.prepend(
|
|
7020
7016
|
hoistedVitestImports + (!hoistedVitestImports && hoistedCode ? API_NOT_FOUND_CHECK : "") + hoistedCode
|
|
@@ -1466,7 +1466,6 @@ function cliTruncate(text, columns, options = {}) {
|
|
|
1466
1466
|
throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`);
|
|
1467
1467
|
}
|
|
1468
1468
|
|
|
1469
|
-
const DURATION_LONG$1 = 300;
|
|
1470
1469
|
const outputMap$1 = /* @__PURE__ */ new WeakMap();
|
|
1471
1470
|
function formatFilepath$1(path) {
|
|
1472
1471
|
const lastSlash = Math.max(path.lastIndexOf("/") + 1, 0);
|
|
@@ -1544,7 +1543,7 @@ function renderTree$1(tasks, options, level = 0, maxRows) {
|
|
|
1544
1543
|
if (task.type === "test" && ((_b = task.result) == null ? void 0 : _b.repeatCount) && task.result.repeatCount > 0)
|
|
1545
1544
|
suffix += c.yellow(` (repeat x${task.result.repeatCount})`);
|
|
1546
1545
|
if (((_c = task.result) == null ? void 0 : _c.duration) != null) {
|
|
1547
|
-
if (task.result.duration >
|
|
1546
|
+
if (task.result.duration > options.slowTestThreshold)
|
|
1548
1547
|
suffix += c.yellow(` ${Math.round(task.result.duration)}${c.dim("ms")}`);
|
|
1549
1548
|
}
|
|
1550
1549
|
if (options.showHeap && ((_d = task.result) == null ? void 0 : _d.heap) != null)
|
|
@@ -1672,6 +1671,7 @@ class DefaultReporter extends BaseReporter {
|
|
|
1672
1671
|
if (this.isTTY) {
|
|
1673
1672
|
this.rendererOptions.logger = this.ctx.logger;
|
|
1674
1673
|
this.rendererOptions.showHeap = this.ctx.config.logHeapUsage;
|
|
1674
|
+
this.rendererOptions.slowTestThreshold = this.ctx.config.slowTestThreshold;
|
|
1675
1675
|
this.rendererOptions.mode = this.mode;
|
|
1676
1676
|
const files = this.ctx.state.getFiles(this.watchFilters);
|
|
1677
1677
|
if (!this.renderer)
|
|
@@ -2425,7 +2425,6 @@ class JsonReporter {
|
|
|
2425
2425
|
}
|
|
2426
2426
|
}
|
|
2427
2427
|
|
|
2428
|
-
const DURATION_LONG = 300;
|
|
2429
2428
|
const outputMap = /* @__PURE__ */ new WeakMap();
|
|
2430
2429
|
function formatFilepath(path) {
|
|
2431
2430
|
const lastSlash = Math.max(path.lastIndexOf("/") + 1, 0);
|
|
@@ -2525,7 +2524,7 @@ ${padding}`;
|
|
|
2525
2524
|
if (task.mode === "skip" || task.mode === "todo")
|
|
2526
2525
|
suffix += ` ${c.dim(c.gray("[skipped]"))}`;
|
|
2527
2526
|
if (((_b = task.result) == null ? void 0 : _b.duration) != null) {
|
|
2528
|
-
if (task.result.duration >
|
|
2527
|
+
if (task.result.duration > options.slowTestThreshold)
|
|
2529
2528
|
suffix += c.yellow(` ${Math.round(task.result.duration)}${c.dim("ms")}`);
|
|
2530
2529
|
}
|
|
2531
2530
|
if (options.showHeap && ((_c = task.result) == null ? void 0 : _c.heap) != null)
|
|
@@ -2606,6 +2605,7 @@ class TableReporter extends BaseReporter {
|
|
|
2606
2605
|
if (this.isTTY) {
|
|
2607
2606
|
this.rendererOptions.logger = this.ctx.logger;
|
|
2608
2607
|
this.rendererOptions.showHeap = this.ctx.config.logHeapUsage;
|
|
2608
|
+
this.rendererOptions.slowTestThreshold = this.ctx.config.slowTestThreshold;
|
|
2609
2609
|
const files = this.ctx.state.getFiles(this.watchFilters);
|
|
2610
2610
|
if (!this.renderer)
|
|
2611
2611
|
this.renderer = createTableRenderer(files, this.rendererOptions).start();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.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
|
-
"@vitest/
|
|
151
|
-
"@vitest/
|
|
152
|
-
"@vitest/spy": "1.1.
|
|
153
|
-
"@vitest/
|
|
154
|
-
"@vitest/
|
|
155
|
-
"vite-node": "1.1.
|
|
150
|
+
"@vitest/runner": "1.1.3",
|
|
151
|
+
"@vitest/expect": "1.1.3",
|
|
152
|
+
"@vitest/spy": "1.1.3",
|
|
153
|
+
"@vitest/snapshot": "1.1.3",
|
|
154
|
+
"@vitest/utils": "1.1.3",
|
|
155
|
+
"vite-node": "1.1.3"
|
|
156
156
|
},
|
|
157
157
|
"devDependencies": {
|
|
158
158
|
"@ampproject/remapping": "^2.2.1",
|