ealush / vest

Vest ✅ Declarative validations framework
https://vestjs.dev/
MIT License
2.57k stars 84 forks source link

In SvelteKit, all the asynchronous tests below do not work at all. #1106

Closed kpouters closed 1 year ago

kpouters commented 1 year ago

test.memo( "username", "Username already taken", () => doesUserExist(data.username), [data.username] );

test('username', 'Username already taken', async () => { await doesUserExist(data.username); });

test('name', 'I always fail', () => Promise.reject());

ealush commented 1 year ago

Hey @kpouters, can you share a repro?

Usually, this is due to not applying done() following the async tests: https://vestjs.dev/docs/writing_your_suite/accessing_the_result#done

Here's a svelte example: https://codesandbox.io/s/svelte-vest-5-imnq9z?file=/Form.svelte