Skip to content

Commit 1a27220

Browse files
committed
fix: tests
1 parent 3496b42 commit 1a27220

4 files changed

Lines changed: 7 additions & 12 deletions

File tree

src/app/hooks/use-sync-reminders-to-sw.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { beforeEach, describe, expect, test } from "vitest"
2-
import { createJazzTestAccount, setupJazzTestSync } from "jazz-tools/testing"
2+
import { createJazzTestAccount } from "jazz-tools/testing"
33
import { co } from "jazz-tools"
44
import { UserAccount, Person, Reminder } from "#shared/schema/user"
55

@@ -28,8 +28,6 @@ describe("extractRemindersForSync", () => {
2828
let account: co.loaded<typeof UserAccount>
2929

3030
beforeEach(async () => {
31-
await setupJazzTestSync()
32-
3331
account = await createJazzTestAccount({
3432
isCurrentActiveAccount: true,
3533
AccountSchema: UserAccount,

src/shared/lib/delete-covalue.test.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { beforeEach, describe, expect, test } from "vitest"
2-
import { createJazzTestAccount, setupJazzTestSync } from "jazz-tools/testing"
2+
import { createJazzTestAccount } from "jazz-tools/testing"
33
import { co, Group } from "jazz-tools"
44
import { Person, Note, Reminder, UserAccount } from "#shared/schema/user"
55
import {
@@ -13,8 +13,6 @@ describe("permanentlyDeleteNote", () => {
1313
let person: co.loaded<typeof Person>
1414

1515
beforeEach(async () => {
16-
await setupJazzTestSync()
17-
1816
account = await createJazzTestAccount({
1917
isCurrentActiveAccount: true,
2018
AccountSchema: UserAccount,
@@ -95,8 +93,6 @@ describe("permanentlyDeleteReminder", () => {
9593
let person: co.loaded<typeof Person>
9694

9795
beforeEach(async () => {
98-
await setupJazzTestSync()
99-
10096
account = await createJazzTestAccount({
10197
isCurrentActiveAccount: true,
10298
AccountSchema: UserAccount,
@@ -153,8 +149,6 @@ describe("permanentlyDeletePerson", () => {
153149
let account: co.loaded<typeof UserAccount>
154150

155151
beforeEach(async () => {
156-
await setupJazzTestSync()
157-
158152
account = await createJazzTestAccount({
159153
isCurrentActiveAccount: true,
160154
AccountSchema: UserAccount,
@@ -258,8 +252,6 @@ describe("deleted items in lists", () => {
258252
let account: co.loaded<typeof UserAccount>
259253

260254
beforeEach(async () => {
261-
await setupJazzTestSync()
262-
263255
account = await createJazzTestAccount({
264256
isCurrentActiveAccount: true,
265257
AccountSchema: UserAccount,

vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default defineConfig({
99
setupFiles: ["./vitest.setup.ts"],
1010
exclude: ["**/node_modules/**", "**/.reference/**"],
1111
include: ["src/**/*.{test,spec}.{ts,tsx}"],
12+
fileParallelism: false,
1213
typecheck: {
1314
enabled: true,
1415
include: ["src/**/*.{test,spec}.{ts,tsx}"],

vitest.setup.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ if (typeof navigator === "undefined") {
55
language: "en-US",
66
}
77
}
8+
9+
// Setup Jazz test sync globally (must be called before any test account creation)
10+
import { setupJazzTestSync } from "jazz-tools/testing"
11+
await setupJazzTestSync()

0 commit comments

Comments
 (0)