Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vitest/runner

Package Overview
Dependencies
Maintainers
3
Versions
94
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.1.1 to 1.1.2

18

dist/index.js

@@ -114,7 +114,8 @@ import limit from 'p-limit';

const fixtureValueMaps = /* @__PURE__ */ new Map();
let cleanupFnArray = new Array();
async function callFixtureCleanup() {
const cleanupFnArrayMap = /* @__PURE__ */ new Map();
async function callFixtureCleanup(context) {
const cleanupFnArray = cleanupFnArrayMap.get(context) ?? [];
for (const cleanup of cleanupFnArray.reverse())
await cleanup();
cleanupFnArray = [];
cleanupFnArrayMap.delete(context);
}

@@ -135,2 +136,5 @@ function withFixtures(fn, testContext) {

const fixtureValueMap = fixtureValueMaps.get(context);
if (!cleanupFnArrayMap.has(context))
cleanupFnArrayMap.set(context, []);
const cleanupFnArray = cleanupFnArrayMap.get(context);
const usedFixtures = fixtures.filter(({ prop }) => usedProps.includes(prop));

@@ -155,3 +159,3 @@ const pendingFixtures = resolveDeps(usedFixtures);

}
async function resolveFixtureFunction(fixtureFn, context, cleanupFnArray2) {
async function resolveFixtureFunction(fixtureFn, context, cleanupFnArray) {
const useFnArgPromise = createDefer();

@@ -163,3 +167,3 @@ let isUseFnArgResolved = false;

const useReturnPromise = createDefer();
cleanupFnArray2.push(async () => {
cleanupFnArray.push(async () => {
useReturnPromise.resolve();

@@ -248,3 +252,3 @@ await fixtureReturn;

if (getCurrentTest())
throw new Error("Nested tests are not allowed");
throw new Error('Calling the test function inside another test function is not allowed. Please put it inside "describe" or "suite" so it can be properly collected.');
getCurrentSuite().test.fn.call(this, formatName(name), fn, options);

@@ -704,3 +708,3 @@ }

await callCleanupHooks(beforeEachCleanups);
await callFixtureCleanup();
await callFixtureCleanup(test.context);
} catch (e) {

@@ -707,0 +711,0 @@ failTask(test.result, e, runner.config.diffOptions);

{
"name": "@vitest/runner",
"type": "module",
"version": "1.1.1",
"version": "1.1.2",
"description": "Vitest test runner",

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

"pathe": "^1.1.1",
"@vitest/utils": "1.1.1"
"@vitest/utils": "1.1.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