@vitest/runner
Advanced tools
Comparing version 1.0.0-beta.2 to 1.0.0-beta.3
@@ -228,5 +228,15 @@ import limit from 'p-limit'; | ||
let _test; | ||
function setCurrentTest(test) { | ||
_test = test; | ||
} | ||
function getCurrentTest() { | ||
return _test; | ||
} | ||
const suite = createSuite(); | ||
const test = createTest( | ||
function(name, fn, options) { | ||
if (getCurrentTest()) | ||
throw new Error("Nested tests are not allowed"); | ||
getCurrentSuite().test.fn.call(this, formatName(name), fn, options); | ||
@@ -527,3 +537,2 @@ } | ||
state: "fail", | ||
error, | ||
errors: [error] | ||
@@ -540,10 +549,2 @@ }; | ||
let _test; | ||
function setCurrentTest(test) { | ||
_test = test; | ||
} | ||
function getCurrentTest() { | ||
return _test; | ||
} | ||
const now = Date.now; | ||
@@ -706,7 +707,5 @@ function updateSuiteHookState(suite, name, state, runner) { | ||
test.result.state = "fail"; | ||
test.result.error = error; | ||
test.result.errors = [error]; | ||
} else { | ||
test.result.state = "pass"; | ||
test.result.error = void 0; | ||
test.result.errors = void 0; | ||
@@ -729,3 +728,2 @@ } | ||
const error = processError(e, diffOptions); | ||
result.error ?? (result.error = error); | ||
result.errors ?? (result.errors = []); | ||
@@ -745,3 +743,3 @@ result.errors.push(error); | ||
async function runSuite(suite, runner) { | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d; | ||
await ((_a = runner.onBeforeRunSuite) == null ? void 0 : _a.call(runner, suite)); | ||
@@ -799,5 +797,4 @@ if (((_b = suite.result) == null ? void 0 : _b.state) === "fail") { | ||
suite.result.state = "fail"; | ||
if (!suite.result.error) { | ||
if (!((_c = suite.result.errors) == null ? void 0 : _c.length)) { | ||
const error = processError(new Error(`No test found in suite ${suite.name}`)); | ||
suite.result.error = error; | ||
suite.result.errors = [error]; | ||
@@ -813,3 +810,3 @@ } | ||
suite.result.duration = now() - start; | ||
await ((_c = runner.onAfterRunSuite) == null ? void 0 : _c.call(runner, suite)); | ||
await ((_d = runner.onAfterRunSuite) == null ? void 0 : _d.call(runner, suite)); | ||
} | ||
@@ -831,3 +828,2 @@ } | ||
state: "fail", | ||
error, | ||
errors: [error] | ||
@@ -834,0 +830,0 @@ }; |
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, h as SuiteHooks, O as OnTestFailedHandler, a as Test, C as Custom } from './tasks-54dc134a.js'; | ||
export { D as DoneCallback, E as ExtendedContext, q as Fixture, r as Fixtures, s as HookCleanupCallback, H as HookListener, I as InferFixturesTypes, R as RunMode, v as RuntimeContext, y as SequenceHooks, z as SequenceSetupFiles, S as Suite, u as SuiteFactory, j as TaskBase, x as TaskContext, t as TaskCustomOptions, l as TaskMeta, k as TaskPopulated, m as TaskResult, n as TaskResultPack, i as TaskState, w as TestContext, o as TestFunction, p as TestOptions } from './tasks-54dc134a.js'; | ||
import { T as Task, F as File, d as SuiteAPI, e as TestAPI, f as SuiteCollector, g as CustomAPI, h as SuiteHooks, O as OnTestFailedHandler, a as Test, C as Custom } from './tasks-3ea70b32.js'; | ||
export { D as DoneCallback, E as ExtendedContext, q as Fixture, r as Fixtures, s as HookCleanupCallback, H as HookListener, I as InferFixturesTypes, R as RunMode, v as RuntimeContext, y as SequenceHooks, z as SequenceSetupFiles, S as Suite, u as SuiteFactory, j as TaskBase, x as TaskContext, t as TaskCustomOptions, l as TaskMeta, k as TaskPopulated, m as TaskResult, n as TaskResultPack, i as TaskState, w as TestContext, o as TestFunction, p as TestOptions } from './tasks-3ea70b32.js'; | ||
import { Awaitable } from '@vitest/utils'; | ||
@@ -6,0 +6,0 @@ export { processError } from '@vitest/utils/error'; |
@@ -228,5 +228,15 @@ import limit from 'p-limit'; | ||
let _test; | ||
function setCurrentTest(test) { | ||
_test = test; | ||
} | ||
function getCurrentTest() { | ||
return _test; | ||
} | ||
const suite = createSuite(); | ||
const test = createTest( | ||
function(name, fn, options) { | ||
if (getCurrentTest()) | ||
throw new Error("Nested tests are not allowed"); | ||
getCurrentSuite().test.fn.call(this, formatName(name), fn, options); | ||
@@ -527,3 +537,2 @@ } | ||
state: "fail", | ||
error, | ||
errors: [error] | ||
@@ -540,10 +549,2 @@ }; | ||
let _test; | ||
function setCurrentTest(test) { | ||
_test = test; | ||
} | ||
function getCurrentTest() { | ||
return _test; | ||
} | ||
const now = Date.now; | ||
@@ -706,7 +707,5 @@ function updateSuiteHookState(suite, name, state, runner) { | ||
test.result.state = "fail"; | ||
test.result.error = error; | ||
test.result.errors = [error]; | ||
} else { | ||
test.result.state = "pass"; | ||
test.result.error = void 0; | ||
test.result.errors = void 0; | ||
@@ -729,3 +728,2 @@ } | ||
const error = processError(e, diffOptions); | ||
result.error ?? (result.error = error); | ||
result.errors ?? (result.errors = []); | ||
@@ -745,3 +743,3 @@ result.errors.push(error); | ||
async function runSuite(suite, runner) { | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d; | ||
await ((_a = runner.onBeforeRunSuite) == null ? void 0 : _a.call(runner, suite)); | ||
@@ -799,5 +797,4 @@ if (((_b = suite.result) == null ? void 0 : _b.state) === "fail") { | ||
suite.result.state = "fail"; | ||
if (!suite.result.error) { | ||
if (!((_c = suite.result.errors) == null ? void 0 : _c.length)) { | ||
const error = processError(new Error(`No test found in suite ${suite.name}`)); | ||
suite.result.error = error; | ||
suite.result.errors = [error]; | ||
@@ -813,3 +810,3 @@ } | ||
suite.result.duration = now() - start; | ||
await ((_c = runner.onAfterRunSuite) == null ? void 0 : _c.call(runner, suite)); | ||
await ((_d = runner.onAfterRunSuite) == null ? void 0 : _d.call(runner, suite)); | ||
} | ||
@@ -831,3 +828,2 @@ } | ||
state: "fail", | ||
error, | ||
errors: [error] | ||
@@ -834,0 +830,0 @@ }; |
@@ -1,3 +0,3 @@ | ||
import { y as SequenceHooks, z as SequenceSetupFiles, F as File, k as TaskPopulated, S as Suite, n as TaskResultPack, a as Test, C as Custom, x as TaskContext, E as ExtendedContext } from './tasks-54dc134a.js'; | ||
export { g as CustomAPI, D as DoneCallback, q as Fixture, r as Fixtures, s as HookCleanupCallback, H as HookListener, I as InferFixturesTypes, O as OnTestFailedHandler, R as RunMode, v as RuntimeContext, d as SuiteAPI, f as SuiteCollector, u as SuiteFactory, h as SuiteHooks, T as Task, j as TaskBase, t as TaskCustomOptions, l as TaskMeta, m as TaskResult, i as TaskState, e as TestAPI, w as TestContext, o as TestFunction, p as TestOptions } from './tasks-54dc134a.js'; | ||
import { y as SequenceHooks, z as SequenceSetupFiles, F as File, k as TaskPopulated, S as Suite, n as TaskResultPack, a as Test, C as Custom, x as TaskContext, E as ExtendedContext } from './tasks-3ea70b32.js'; | ||
export { g as CustomAPI, D as DoneCallback, q as Fixture, r as Fixtures, s as HookCleanupCallback, H as HookListener, I as InferFixturesTypes, O as OnTestFailedHandler, R as RunMode, v as RuntimeContext, d as SuiteAPI, f as SuiteCollector, u as SuiteFactory, h as SuiteHooks, T as Task, j as TaskBase, t as TaskCustomOptions, l as TaskMeta, m as TaskResult, i as TaskState, e as TestAPI, w as TestContext, o as TestFunction, p as TestOptions } from './tasks-3ea70b32.js'; | ||
import '@vitest/utils'; | ||
@@ -4,0 +4,0 @@ |
@@ -1,3 +0,3 @@ | ||
import { S as Suite, T as Task, a as Test, C as Custom } from './tasks-54dc134a.js'; | ||
export { b as ChainableFunction, c as createChainable } from './tasks-54dc134a.js'; | ||
import { S as Suite, T as Task, a as Test, C as Custom } from './tasks-3ea70b32.js'; | ||
export { b as ChainableFunction, c as createChainable } from './tasks-3ea70b32.js'; | ||
import { Arrayable } from '@vitest/utils'; | ||
@@ -4,0 +4,0 @@ |
@@ -73,3 +73,2 @@ import { processError } from '@vitest/utils/error'; | ||
state: "fail", | ||
error, | ||
errors: [error] | ||
@@ -129,4 +128,4 @@ }; | ||
const tests = []; | ||
const suite_arr = toArray(suite); | ||
for (const s of suite_arr) { | ||
const arraySuites = toArray(suite); | ||
for (const s of arraySuites) { | ||
if (isAtomTest(s)) { | ||
@@ -133,0 +132,0 @@ tests.push(s); |
{ | ||
"name": "@vitest/runner", | ||
"type": "module", | ||
"version": "1.0.0-beta.2", | ||
"version": "1.0.0-beta.3", | ||
"description": "Vitest test runner", | ||
@@ -43,3 +43,3 @@ "license": "MIT", | ||
"pathe": "^1.1.1", | ||
"@vitest/utils": "1.0.0-beta.2" | ||
"@vitest/utils": "1.0.0-beta.3" | ||
}, | ||
@@ -46,0 +46,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
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
85250
2314
+ Added@vitest/utils@1.0.0-beta.3(transitive)
- Removed@vitest/utils@1.0.0-beta.2(transitive)
Updated@vitest/utils@1.0.0-beta.3