Create unit test for createInterview
action
#555
Annotations
2 errors
actions/interviews.test.ts > createInterview > should return an error if anonymous recruitment is not enabled and participantIdentifier is not provided :
actions/interviews.ts#L230
Error: [vitest] No "default" export is defined on the "~/lib/analytics" mock. Did you forget to return it from "vi.mock"?
If you need to partially mock a module, you can use "importOriginal" helper inside:
vi.mock("~/lib/analytics", async (importOriginal) => {
const actual = await importOriginal()
return {
...actual,
// your mocked methods
}
})
❯ Module.createInterview actions/interviews.ts:230:10
❯ actions/interviews.test.ts:56:26
|
build
Process completed with exit code 1.
|