Socket
Socket
Sign inDemoInstall

@vitest/runner

Package Overview
Dependencies
Maintainers
3
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitest/runner - npm Package Compare versions

Comparing version 1.0.0-beta.1 to 1.0.0-beta.2

dist/tasks-54dc134a.d.ts

17

./dist/index.js
import limit from 'p-limit';
import { getSafeTimers, format, isObject, objDisplay, objectAttr, noop, toArray, shuffle } from '@vitest/utils';
import { processError } from '@vitest/utils/error';
export { processError } from '@vitest/utils/error';
import { createChainable, generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, partitionSuiteChildren, hasTests, hasFailed } from './utils.js';

@@ -113,10 +114,7 @@ import { relative } from 'pathe';

const fixtureValueMap = /* @__PURE__ */ new Map();
const fixtureCleanupFnMap = /* @__PURE__ */ new Map();
async function callFixtureCleanup(id) {
const cleanupFnArray = fixtureCleanupFnMap.get(id);
if (!cleanupFnArray)
return;
let cleanupFnArray = new Array();
async function callFixtureCleanup() {
for (const cleanup of cleanupFnArray.reverse())
await cleanup();
fixtureCleanupFnMap.delete(id);
cleanupFnArray = [];
}

@@ -128,7 +126,2 @@ function withFixtures(fn, testContext) {

return fn({});
let cleanupFnArray = fixtureCleanupFnMap.get(context.task.suite.id);
if (!cleanupFnArray) {
cleanupFnArray = [];
fixtureCleanupFnMap.set(context.task.suite.id, cleanupFnArray);
}
const fixtures = getFixture(context);

@@ -693,2 +686,3 @@ if (!(fixtures == null ? void 0 : fixtures.length))

await callCleanupHooks(beforeEachCleanups);
await callFixtureCleanup();
} catch (e) {

@@ -794,3 +788,2 @@ failTask(test.result, e, runner.config.diffOptions);

try {
await callFixtureCleanup(suite.id);
await callSuiteHook(suite, suite, "afterAll", runner, [suite]);

@@ -797,0 +790,0 @@ await callCleanupHooks(beforeAllCleanups);

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-b31a73cb.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-b31a73cb.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 { Awaitable } from '@vitest/utils';
export { processError } from '@vitest/utils/error';

@@ -7,0 +8,0 @@ declare function updateTask(task: Task, runner: VitestRunner): void;

import limit from 'p-limit';
import { getSafeTimers, format, isObject, objDisplay, objectAttr, noop, toArray, shuffle } from '@vitest/utils';
import { processError } from '@vitest/utils/error';
export { processError } from '@vitest/utils/error';
import { createChainable, generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, partitionSuiteChildren, hasTests, hasFailed } from './utils.js';

@@ -113,10 +114,7 @@ import { relative } from 'pathe';

const fixtureValueMap = /* @__PURE__ */ new Map();
const fixtureCleanupFnMap = /* @__PURE__ */ new Map();
async function callFixtureCleanup(id) {
const cleanupFnArray = fixtureCleanupFnMap.get(id);
if (!cleanupFnArray)
return;
let cleanupFnArray = new Array();
async function callFixtureCleanup() {
for (const cleanup of cleanupFnArray.reverse())
await cleanup();
fixtureCleanupFnMap.delete(id);
cleanupFnArray = [];
}

@@ -128,7 +126,2 @@ function withFixtures(fn, testContext) {

return fn({});
let cleanupFnArray = fixtureCleanupFnMap.get(context.task.suite.id);
if (!cleanupFnArray) {
cleanupFnArray = [];
fixtureCleanupFnMap.set(context.task.suite.id, cleanupFnArray);
}
const fixtures = getFixture(context);

@@ -693,2 +686,3 @@ if (!(fixtures == null ? void 0 : fixtures.length))

await callCleanupHooks(beforeEachCleanups);
await callFixtureCleanup();
} catch (e) {

@@ -794,3 +788,2 @@ failTask(test.result, e, runner.config.diffOptions);

try {
await callFixtureCleanup(suite.id);
await callSuiteHook(suite, suite, "afterAll", runner, [suite]);

@@ -797,0 +790,0 @@ await callCleanupHooks(beforeAllCleanups);

@@ -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-b31a73cb.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-b31a73cb.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-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 '@vitest/utils';

@@ -161,2 +161,2 @@

export { CancelReason, Custom, ExtendedContext, File, SequenceHooks, SequenceSetupFiles, Suite, TaskContext, TaskPopulated, TaskResultPack, Test, VitestRunner, VitestRunnerConfig, VitestRunnerConstructor, VitestRunnerImportSource };
export { type CancelReason, Custom, ExtendedContext, File, SequenceHooks, SequenceSetupFiles, Suite, TaskContext, TaskPopulated, TaskResultPack, Test, type VitestRunner, type VitestRunnerConfig, type VitestRunnerConstructor, type VitestRunnerImportSource };

@@ -1,3 +0,3 @@

import { S as Suite, T as Task, a as Test, C as Custom } from './tasks-b31a73cb.js';
export { b as ChainableFunction, c as createChainable } from './tasks-b31a73cb.js';
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 { Arrayable } from '@vitest/utils';

@@ -4,0 +4,0 @@

{
"name": "@vitest/runner",
"type": "module",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "Vitest test runner",

@@ -43,3 +43,3 @@ "license": "MIT",

"pathe": "^1.1.1",
"@vitest/utils": "1.0.0-beta.1"
"@vitest/utils": "1.0.0-beta.2"
},

@@ -46,0 +46,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc