@vitest/runner
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -142,26 +142,3 @@ import limit from 'p-limit'; | ||
continue; | ||
let resolvedValue; | ||
if (fixture.isFn) { | ||
const useFnArgPromise = createDefer(); | ||
let isUseFnArgResolved = false; | ||
const fixtureReturn = fixture.value(context, async (useFnArg) => { | ||
isUseFnArgResolved = true; | ||
useFnArgPromise.resolve(useFnArg); | ||
const useReturnPromise = createDefer(); | ||
cleanupFnArray.push(async () => { | ||
useReturnPromise.resolve(); | ||
await fixtureReturn; | ||
}); | ||
await useReturnPromise; | ||
}).catch((e) => { | ||
if (!isUseFnArgResolved) { | ||
useFnArgPromise.reject(e); | ||
return; | ||
} | ||
throw e; | ||
}); | ||
resolvedValue = await useFnArgPromise; | ||
} else { | ||
resolvedValue = fixture.value; | ||
} | ||
const resolvedValue = fixture.isFn ? await resolveFixtureFunction(fixture.value, context, cleanupFnArray) : fixture.value; | ||
context[fixture.prop] = resolvedValue; | ||
@@ -177,2 +154,23 @@ fixtureValueMap.set(fixture, resolvedValue); | ||
} | ||
async function resolveFixtureFunction(fixtureFn, context, cleanupFnArray2) { | ||
const useFnArgPromise = createDefer(); | ||
let isUseFnArgResolved = false; | ||
const fixtureReturn = fixtureFn(context, async (useFnArg) => { | ||
isUseFnArgResolved = true; | ||
useFnArgPromise.resolve(useFnArg); | ||
const useReturnPromise = createDefer(); | ||
cleanupFnArray2.push(async () => { | ||
useReturnPromise.resolve(); | ||
await fixtureReturn; | ||
}); | ||
await useReturnPromise; | ||
}).catch((e) => { | ||
if (!isUseFnArgResolved) { | ||
useFnArgPromise.reject(e); | ||
return; | ||
} | ||
throw e; | ||
}); | ||
return useFnArgPromise; | ||
} | ||
function resolveDeps(fixtures, depSet = /* @__PURE__ */ new Set(), pendingFixtures = []) { | ||
@@ -697,2 +695,3 @@ fixtures.forEach((fixture) => { | ||
updateTask(test, runner); | ||
setCurrentTest(void 0); | ||
return; | ||
@@ -699,0 +698,0 @@ } |
{ | ||
"name": "@vitest/runner", | ||
"type": "module", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Vitest test runner", | ||
@@ -43,3 +43,3 @@ "license": "MIT", | ||
"pathe": "^1.1.1", | ||
"@vitest/utils": "1.1.0" | ||
"@vitest/utils": "1.1.1" | ||
}, | ||
@@ -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
57104
1444
+ Added@vitest/utils@1.1.1(transitive)
- Removed@vitest/utils@1.1.0(transitive)
Updated@vitest/utils@1.1.1