-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
feat: contextp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
Had difficult time debugging why a test is timing out. Root cause was that I was returning from fixture when specific condition is met, without calling use. Let's improve the error message in these cases by saying something like Fixture returned value but didn't call 'use'. Hook will timeout.
const test = base.extend({
value: undefined as string | undefined,
setup: [
async ({ value }, use) => {
// optional value, no setups if it's missing
if (!value) {
return; // Forgot to call use here 🙃
// return await use(undefined)
}
await prepare(value);
await use(undefined);
},
{ auto: true },
],
});
describe("working example", () => {
test.scoped({ value: "something" })
test('example 1', () => {});
})
test('example 2', () => {});Reproduction
System Info
Stackblitz, Vitest 4.0.18Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat: contextp3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)