@vitest/runner
Advanced tools
Comparing version 2.0.5 to 2.1.0-beta.1
import { VitestRunner } from './types.js'; | ||
export { CancelReason, VitestRunnerConfig, VitestRunnerConstructor, VitestRunnerImportSource } from './types.js'; | ||
import { T as Task, F as File, d as SuiteAPI, e as TestAPI, f as SuiteCollector, g as CustomAPI, B as BeforeAllListener, A as AfterAllListener, h as BeforeEachListener, i as AfterEachListener, j as TaskHook, O as OnTestFailedHandler, k as OnTestFinishedHandler, a as Test, C as Custom, S as Suite, l as SuiteHooks } from './tasks-zB5uPauP.js'; | ||
export { D as DoneCallback, L as ExtendedContext, w as Fixture, v as FixtureFn, u as FixtureOptions, x as Fixtures, y as HookCleanupCallback, H as HookListener, I as InferFixturesTypes, R as RunMode, G as RuntimeContext, M as SequenceHooks, N as SequenceSetupFiles, E as SuiteFactory, n as TaskBase, K as TaskContext, z as TaskCustomOptions, p as TaskMeta, o as TaskPopulated, q as TaskResult, r as TaskResultPack, m as TaskState, J as TestContext, s as TestFunction, t as TestOptions, U as Use } from './tasks-zB5uPauP.js'; | ||
import { T as Task, F as File, d as SuiteAPI, e as TestAPI, f as SuiteCollector, g as CustomAPI, B as BeforeAllListener, A as AfterAllListener, h as BeforeEachListener, i as AfterEachListener, j as TaskHook, O as OnTestFailedHandler, k as OnTestFinishedHandler, a as Test, C as Custom, S as Suite, l as SuiteHooks } from './tasks-C13WjyUB.js'; | ||
export { D as DoneCallback, L as ExtendedContext, w as Fixture, v as FixtureFn, u as FixtureOptions, x as Fixtures, y as HookCleanupCallback, H as HookListener, I as InferFixturesTypes, R as RunMode, G as RuntimeContext, M as SequenceHooks, N as SequenceSetupFiles, E as SuiteFactory, n as TaskBase, K as TaskContext, z as TaskCustomOptions, p as TaskMeta, o as TaskPopulated, q as TaskResult, r as TaskResultPack, m as TaskState, J as TestContext, s as TestFunction, t as TestOptions, U as Use } from './tasks-C13WjyUB.js'; | ||
import { Awaitable } from '@vitest/utils'; | ||
@@ -6,0 +6,0 @@ export { processError } from '@vitest/utils/error'; |
@@ -310,3 +310,9 @@ import { getSafeTimers, isObject, createDefer, isNegativeNaN, format, objDisplay, objectAttr, toArray, shuffle } from '@vitest/utils'; | ||
let currentTestFilepath; | ||
function assert(condition, message) { | ||
if (!condition) { | ||
throw new Error(`Vitest failed to find ${message}. This is a bug in Vitest. Please, open an issue with reproduction.`); | ||
} | ||
} | ||
function getDefaultSuite() { | ||
assert(defaultSuite, "the default suite"); | ||
return defaultSuite; | ||
@@ -318,2 +324,3 @@ } | ||
function getRunner() { | ||
assert(runner, "the runner"); | ||
return runner; | ||
@@ -338,3 +345,5 @@ } | ||
function getCurrentSuite() { | ||
return collectorContext.currentSuite || defaultSuite; | ||
const currentSuite = collectorContext.currentSuite || defaultSuite; | ||
assert(currentSuite, "the current suite"); | ||
return currentSuite; | ||
} | ||
@@ -524,3 +533,3 @@ function createSuiteHooks() { | ||
const mode = this.only ? "only" : this.skip ? "skip" : this.todo ? "todo" : "run"; | ||
const currentSuite = getCurrentSuite(); | ||
const currentSuite = collectorContext.currentSuite || defaultSuite; | ||
let { options, handler: factory } = parseArguments( | ||
@@ -527,0 +536,0 @@ factoryOrOptions, |
@@ -1,6 +0,9 @@ | ||
import { M as SequenceHooks, N as SequenceSetupFiles, F as File, T as Task, S as Suite, r as TaskResultPack, a as Test, C as Custom, K as TaskContext, L as ExtendedContext } from './tasks-zB5uPauP.js'; | ||
export { A as AfterAllListener, i as AfterEachListener, B as BeforeAllListener, h as BeforeEachListener, g as CustomAPI, D as DoneCallback, w as Fixture, v as FixtureFn, u as FixtureOptions, x as Fixtures, y as HookCleanupCallback, H as HookListener, I as InferFixturesTypes, O as OnTestFailedHandler, k as OnTestFinishedHandler, R as RunMode, G as RuntimeContext, d as SuiteAPI, f as SuiteCollector, E as SuiteFactory, l as SuiteHooks, n as TaskBase, z as TaskCustomOptions, j as TaskHook, p as TaskMeta, o as TaskPopulated, q as TaskResult, m as TaskState, e as TestAPI, J as TestContext, s as TestFunction, t as TestOptions, U as Use } from './tasks-zB5uPauP.js'; | ||
import { M as SequenceHooks, N as SequenceSetupFiles, F as File, T as Task, a as Test, C as Custom, S as Suite, r as TaskResultPack, K as TaskContext, L as ExtendedContext } from './tasks-C13WjyUB.js'; | ||
export { A as AfterAllListener, i as AfterEachListener, B as BeforeAllListener, h as BeforeEachListener, g as CustomAPI, D as DoneCallback, w as Fixture, v as FixtureFn, u as FixtureOptions, x as Fixtures, y as HookCleanupCallback, H as HookListener, I as InferFixturesTypes, O as OnTestFailedHandler, k as OnTestFinishedHandler, R as RunMode, G as RuntimeContext, d as SuiteAPI, f as SuiteCollector, E as SuiteFactory, l as SuiteHooks, n as TaskBase, z as TaskCustomOptions, j as TaskHook, p as TaskMeta, o as TaskPopulated, q as TaskResult, m as TaskState, e as TestAPI, J as TestContext, s as TestFunction, t as TestOptions, U as Use } from './tasks-C13WjyUB.js'; | ||
import { DiffOptions } from '@vitest/utils/diff'; | ||
import '@vitest/utils'; | ||
/** | ||
* This is a subset of Vitest config that's required for the runner to work. | ||
*/ | ||
interface VitestRunnerConfig { | ||
@@ -68,3 +71,3 @@ root: string; | ||
*/ | ||
onTaskFinished?: (test: Task) => unknown; | ||
onTaskFinished?: (test: Test | Custom) => unknown; | ||
/** | ||
@@ -112,3 +115,3 @@ * Called after result and state are set. | ||
/** | ||
* Called when new context for a test is defined. Useful, if you want to add custom properties to the context. | ||
* Called when new context for a test is defined. Useful if you want to add custom properties to the context. | ||
* If you only want to define custom context, consider using "beforeAll" in "setupFiles" instead. | ||
@@ -122,3 +125,3 @@ * | ||
/** | ||
* Called, when files are imported. Can be called in two situations: when collecting tests and when importing setup files. | ||
* Called when test and setup files are imported. Can be called in two situations: when collecting tests and when importing setup files. | ||
*/ | ||
@@ -125,0 +128,0 @@ importFile: (filepath: string, source: VitestRunnerImportSource) => unknown; |
@@ -1,3 +0,3 @@ | ||
import { S as Suite, F as File, T as Task, a as Test, C as Custom } from './tasks-zB5uPauP.js'; | ||
export { b as ChainableFunction, c as createChainable } from './tasks-zB5uPauP.js'; | ||
import { S as Suite, F as File, T as Task, a as Test, C as Custom } from './tasks-C13WjyUB.js'; | ||
export { b as ChainableFunction, c as createChainable } from './tasks-C13WjyUB.js'; | ||
import { Arrayable } from '@vitest/utils'; | ||
@@ -4,0 +4,0 @@ |
{ | ||
"name": "@vitest/runner", | ||
"type": "module", | ||
"version": "2.0.5", | ||
"version": "2.1.0-beta.1", | ||
"description": "Vitest test runner", | ||
@@ -42,3 +42,3 @@ "license": "MIT", | ||
"pathe": "^1.1.2", | ||
"@vitest/utils": "2.0.5" | ||
"@vitest/utils": "2.1.0-beta.1" | ||
}, | ||
@@ -45,0 +45,0 @@ "scripts": { |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
87585
2374
1
+ Added@vitest/pretty-format@2.1.0-beta.1(transitive)
+ Added@vitest/utils@2.1.0-beta.1(transitive)
- Removed@vitest/pretty-format@2.0.5(transitive)
- Removed@vitest/utils@2.0.5(transitive)
Updated@vitest/utils@2.1.0-beta.1