Skip to content

Commit 068fc30

Browse files
committed
fix: tests
1 parent dbbeae7 commit 068fc30

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

tests/relationships.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ describe.concurrent("relationships", () => {
1212
await expect(
1313
import("./schemas/one-to-one-missing-foreign-key.zero"),
1414
).rejects.toThrowErrorMatchingInlineSnapshot(
15-
`[Error: No relationship found for: userPosts (One from users to posts). Did you forget to define foreign keys?]`,
15+
`[Error: drizzle-zero: No relationship found for: userPosts (One from users to posts). Did you forget to define foreign keys?]`,
1616
);
1717
});
1818

1919
test("relationships - many-to-many-missing-foreign-key", async () => {
2020
await expect(
2121
import("./schemas/many-to-many-missing-foreign-key.zero"),
2222
).rejects.toThrowErrorMatchingInlineSnapshot(
23-
`[Error: Invalid many-to-many configuration for user.groups: Could not find foreign key relationships in junction table users_to_group]`,
23+
`[Error: drizzle-zero: Invalid many-to-many configuration for user.groups: Could not find foreign key relationships in junction table users_to_group]`,
2424
);
2525
});
2626

@@ -29,23 +29,23 @@ describe.concurrent("relationships", () => {
2929
await expect(
3030
import("./schemas/many-to-many-duplicate-relationship.zero"),
3131
).rejects.toThrowErrorMatchingInlineSnapshot(
32-
`[Error: Duplicate relationship found for: usersToGroups (Many from user to users_to_group).]`,
32+
`[Error: drizzle-zero: Duplicate relationship found for: usersToGroups (Many from user to users_to_group).]`,
3333
);
3434
});
3535

3636
test("relationships - one-to-one-missing-foreign-key", async () => {
3737
await expect(
3838
import("./schemas/one-to-one-missing-foreign-key.zero"),
3939
).rejects.toThrowErrorMatchingInlineSnapshot(
40-
`[Error: No relationship found for: userPosts (One from users to posts). Did you forget to define foreign keys?]`,
40+
`[Error: drizzle-zero: No relationship found for: userPosts (One from users to posts). Did you forget to define foreign keys?]`,
4141
);
4242
});
4343

4444
test("relationships - one-to-many-missing-named", async () => {
4545
await expect(
4646
import("./schemas/one-to-many-missing-named.zero"),
4747
).rejects.toThrowErrorMatchingInlineSnapshot(
48-
`[Error: No relationship found for: author (Many from users to posts). Did you forget to define foreign keys for named relation "author"?]`,
48+
`[Error: drizzle-zero: No relationship found for: author (Many from users to posts). Did you forget to define foreign keys for named relation "author"?]`,
4949
);
5050
});
5151

tests/tables.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ describe.concurrent("tables", () => {
194194
scores: true,
195195
}),
196196
).toThrowErrorMatchingInlineSnapshot(
197-
`[Error: Unsupported column type: array. It must be supported by Zero, e.g.: number | bigint | boolean | date | string | json]`,
197+
`[Error: drizzle-zero: Unsupported column type: array. It must be supported by Zero, e.g.: number | bigint | boolean | date | string | json]`,
198198
);
199199
});
200200

@@ -1237,7 +1237,7 @@ describe.concurrent("tables", () => {
12371237
invalid: "someinvalidtype",
12381238
} as unknown as ColumnsConfig<typeof table>),
12391239
).toThrowErrorMatchingInlineSnapshot(
1240-
`[Error: Invalid column config for column invalid - expected boolean or object but was string]`,
1240+
`[Error: drizzle-zero: Invalid column config for column invalid - expected boolean or object but was string]`,
12411241
);
12421242
});
12431243

@@ -1251,7 +1251,7 @@ describe.concurrent("tables", () => {
12511251
id: true,
12521252
}),
12531253
).toThrowErrorMatchingInlineSnapshot(
1254-
`[Error: No primary keys found in table - test. Did you forget to define a primary key?]`,
1254+
`[Error: drizzle-zero: No primary keys found in table - test. Did you forget to define a primary key?]`,
12551255
);
12561256
});
12571257

@@ -1267,7 +1267,7 @@ describe.concurrent("tables", () => {
12671267
name: true,
12681268
}),
12691269
).toThrowErrorMatchingInlineSnapshot(
1270-
`[Error: Primary key column id cannot have a default value defined on the database level and cannot be optional, since auto-incrementing primary keys can cause race conditions with concurrent inserts. See the Zero docs for more information.]`,
1270+
`[Error: drizzle-zero: Primary key column id cannot have a default value defined on the database level and cannot be optional, since auto-incrementing primary keys can cause race conditions with concurrent inserts. See the Zero docs for more information.]`,
12711271
);
12721272
});
12731273

@@ -1283,7 +1283,7 @@ describe.concurrent("tables", () => {
12831283
name: true,
12841284
}),
12851285
).toThrowErrorMatchingInlineSnapshot(
1286-
`[Error: Unsupported table type: test. Only Postgres tables are supported.]`,
1286+
`[Error: drizzle-zero: Unsupported table type: test. Only Postgres tables are supported.]`,
12871287
);
12881288
});
12891289
});

vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { defineConfig } from "vitest/config";
33

44
export default defineConfig({
55
test: {
6+
testTimeout: 15000,
67
include: ["tests/**/*.test.ts"],
78
typecheck: {
89
tsconfig: "tsconfig.json",

0 commit comments

Comments
 (0)