ealush / vest

Vest ✅ Declarative validations framework

Home Page:https://vestjs.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

kpouters opened this issue · comments

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());

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