@geekmidas/testkit 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/Factory.mjs +1 -1
  2. package/dist/{KyselyFactory-BGvSMLtd.cjs → KyselyFactory-BX7Kv2uP.cjs} +1 -1
  3. package/dist/{KyselyFactory-ionH4gvk.mjs → KyselyFactory-pOMOFQWE.mjs} +2 -2
  4. package/dist/KyselyFactory.cjs +2 -2
  5. package/dist/KyselyFactory.mjs +3 -3
  6. package/dist/{ObjectionFactory-CFrtXe7i.mjs → ObjectionFactory-ChuX8sZN.mjs} +1 -1
  7. package/dist/ObjectionFactory.mjs +2 -2
  8. package/dist/{PostgresKyselyMigrator-CbtiZgfI.mjs → PostgresKyselyMigrator-D8fm35-s.mjs} +1 -1
  9. package/dist/{PostgresKyselyMigrator-Cxf2Dp9y.cjs → PostgresKyselyMigrator-JTY2LfwD.cjs} +2 -2
  10. package/dist/PostgresKyselyMigrator.cjs +2 -2
  11. package/dist/PostgresKyselyMigrator.mjs +2 -2
  12. package/dist/{PostgresMigrator-eqyAFSf-.cjs → PostgresMigrator-Bz-tnjB6.cjs} +1 -1
  13. package/dist/PostgresMigrator.cjs +1 -1
  14. package/dist/PostgresMigrator.mjs +1 -1
  15. package/dist/{VitestKyselyTransactionIsolator-DXjWQtDN.mjs → VitestKyselyTransactionIsolator-BS3R-V0I.mjs} +1 -1
  16. package/dist/{VitestKyselyTransactionIsolator-Dh2AgJDd.cjs → VitestKyselyTransactionIsolator-DWSTKIe3.cjs} +1 -1
  17. package/dist/VitestKyselyTransactionIsolator.cjs +2 -3
  18. package/dist/VitestKyselyTransactionIsolator.mjs +2 -3
  19. package/dist/{VitestTransactionIsolator-pLwsDo_A.mjs → VitestTransactionIsolator-BjVXqFs6.mjs} +1 -1
  20. package/dist/{VitestTransactionIsolator-zK5NJ7DQ.cjs → VitestTransactionIsolator-Bx2c4OzK.cjs} +3 -2
  21. package/dist/VitestTransactionIsolator.cjs +1 -2
  22. package/dist/VitestTransactionIsolator.mjs +1 -2
  23. package/dist/__tests__/Factory.spec.cjs +42 -42
  24. package/dist/__tests__/Factory.spec.mjs +23 -24
  25. package/dist/__tests__/KyselyFactory.spec.cjs +46 -47
  26. package/dist/__tests__/KyselyFactory.spec.mjs +40 -41
  27. package/dist/__tests__/ObjectionFactory.spec.cjs +80 -81
  28. package/dist/__tests__/ObjectionFactory.spec.mjs +52 -53
  29. package/dist/__tests__/PostgresMigrator.spec.cjs +59 -60
  30. package/dist/__tests__/PostgresMigrator.spec.mjs +31 -32
  31. package/dist/__tests__/faker.spec.cjs +60 -60
  32. package/dist/__tests__/faker.spec.mjs +35 -36
  33. package/dist/__tests__/integration.spec.cjs +40 -40
  34. package/dist/__tests__/integration.spec.mjs +42 -43
  35. package/dist/{chunk-DWy1uDak.cjs → chunk-CUT6urMc.cjs} +0 -9
  36. package/dist/example.cjs +2 -2
  37. package/dist/example.mjs +3 -3
  38. package/dist/{faker-h6CkRloU.cjs → faker-caz-8zt8.cjs} +1 -1
  39. package/dist/faker.cjs +1 -1
  40. package/dist/faker.mjs +1 -1
  41. package/dist/{helpers-C_RZk04R.cjs → helpers-B9Jdk_C7.cjs} +3 -3
  42. package/dist/{helpers-C2NH7xcz.cjs → helpers-DKEBHABj.cjs} +1 -1
  43. package/dist/{helpers-BnARb5Ap.mjs → helpers-DOiGIkaU.mjs} +2 -2
  44. package/dist/helpers.cjs +3 -4
  45. package/dist/helpers.mjs +3 -4
  46. package/dist/kysely.cjs +6 -7
  47. package/dist/kysely.mjs +7 -8
  48. package/dist/objection.mjs +2 -2
  49. package/package.json +2 -1
  50. package/dist/dist-BM2KvLG1.mjs +0 -5618
  51. package/dist/dist-DE3gAxQI.cjs +0 -5736
  52. package/dist/magic-string.es-C6yzoryu.mjs +0 -1014
  53. package/dist/magic-string.es-jdtJrR0A.cjs +0 -1015
  54. package/dist/vi.bdSIJ99Y-BgRxGeO2.mjs +0 -9382
  55. package/dist/vi.bdSIJ99Y-CFuzUeY6.cjs +0 -9393
  56. /package/dist/{Factory-D52Lsc6Z.mjs → Factory-DlzMkMzb.mjs} +0 -0
  57. /package/dist/{PostgresMigrator-DqeuPy-e.mjs → PostgresMigrator-CEoRKTdq.mjs} +0 -0
  58. /package/dist/{faker-cGCFcrj2.mjs → faker-BwaXA_RF.mjs} +0 -0
  59. /package/dist/{helpers-CukcFAU9.mjs → helpers-BfuX-cjN.mjs} +0 -0
@@ -1,14 +1,13 @@
1
- const require_chunk = require('../chunk-DWy1uDak.cjs');
1
+ const require_chunk = require('../chunk-CUT6urMc.cjs');
2
2
  require('../Factory-DREHoms3.cjs');
3
- require('../faker-h6CkRloU.cjs');
4
- const require_KyselyFactory = require('../KyselyFactory-BGvSMLtd.cjs');
5
- const require_dist = require('../dist-DE3gAxQI.cjs');
6
- const require_vi_bdSIJ99Y = require('../vi.bdSIJ99Y-CFuzUeY6.cjs');
7
- require('../VitestTransactionIsolator-zK5NJ7DQ.cjs');
8
- require('../VitestKyselyTransactionIsolator-Dh2AgJDd.cjs');
9
- const require_helpers = require('../helpers-C_RZk04R.cjs');
10
- const require_helpers$1 = require('../helpers-C2NH7xcz.cjs');
3
+ require('../faker-caz-8zt8.cjs');
4
+ const require_KyselyFactory = require('../KyselyFactory-BX7Kv2uP.cjs');
5
+ require('../VitestTransactionIsolator-Bx2c4OzK.cjs');
6
+ require('../VitestKyselyTransactionIsolator-DWSTKIe3.cjs');
7
+ const require_helpers = require('../helpers-B9Jdk_C7.cjs');
8
+ const require_helpers$1 = require('../helpers-DKEBHABj.cjs');
11
9
  const pg = require_chunk.__toESM(require("pg"));
10
+ const vitest = require_chunk.__toESM(require("vitest"));
12
11
 
13
12
  //#region src/__tests__/KyselyFactory.spec.ts
14
13
  const db = require_helpers.createKyselyDb(require_helpers$1.TEST_DATABASE_CONFIG);
@@ -17,10 +16,10 @@ const int8TypeId = 20;
17
16
  pg.default.types.setTypeParser(int8TypeId, (val) => {
18
17
  return parseInt(val, 10);
19
18
  });
20
- require_dist.describe("KyselyFactory", () => {
19
+ (0, vitest.describe)("KyselyFactory", () => {
21
20
  let db$1;
22
21
  let trx;
23
- require_dist.describe("KyselyFactory.insert", () => {
22
+ (0, vitest.describe)("KyselyFactory.insert", () => {
24
23
  itWithTransaction("should insert a record with defaults", async ({ trx: trx$1 }) => {
25
24
  const userBuilder = require_KyselyFactory.KyselyFactory.createBuilder("users", async (attrs) => ({
26
25
  name: "John Doe",
@@ -30,12 +29,12 @@ require_dist.describe("KyselyFactory", () => {
30
29
  const builders = { user: userBuilder };
31
30
  const factory = new require_KyselyFactory.KyselyFactory(builders, {}, trx$1);
32
31
  const user = await factory.insert("user");
33
- require_vi_bdSIJ99Y.globalExpect(user).toBeDefined();
34
- require_vi_bdSIJ99Y.globalExpect(user.id).toBeDefined();
35
- require_vi_bdSIJ99Y.globalExpect(user.name).toBe("John Doe");
36
- require_vi_bdSIJ99Y.globalExpect(user.email).toContain("user");
37
- require_vi_bdSIJ99Y.globalExpect(user.email).toContain("@example.com");
38
- require_vi_bdSIJ99Y.globalExpect(user.createdAt).toBeInstanceOf(Date);
32
+ (0, vitest.expect)(user).toBeDefined();
33
+ (0, vitest.expect)(user.id).toBeDefined();
34
+ (0, vitest.expect)(user.name).toBe("John Doe");
35
+ (0, vitest.expect)(user.email).toContain("user");
36
+ (0, vitest.expect)(user.email).toContain("@example.com");
37
+ (0, vitest.expect)(user.createdAt).toBeInstanceOf(Date);
39
38
  });
40
39
  itWithTransaction("should override defaults with provided attributes", async ({ trx: trx$1 }) => {
41
40
  const userBuilder = require_KyselyFactory.KyselyFactory.createBuilder("users", async (attrs) => ({
@@ -51,8 +50,8 @@ require_dist.describe("KyselyFactory", () => {
51
50
  email: customEmail,
52
51
  name: customName
53
52
  });
54
- require_vi_bdSIJ99Y.globalExpect(user.name).toBe(customName);
55
- require_vi_bdSIJ99Y.globalExpect(user.email).toBe(customEmail);
53
+ (0, vitest.expect)(user.name).toBe(customName);
54
+ (0, vitest.expect)(user.email).toBe(customEmail);
56
55
  });
57
56
  itWithTransaction("should handle relations", async ({ trx: trx$1 }) => {
58
57
  const userBuilder = require_KyselyFactory.KyselyFactory.createBuilder("users", async (attrs) => ({
@@ -82,17 +81,17 @@ require_dist.describe("KyselyFactory", () => {
82
81
  };
83
82
  const factory = new require_KyselyFactory.KyselyFactory(builders, {}, trx$1);
84
83
  const post = await factory.insert("post", { title: "Test Post" });
85
- require_vi_bdSIJ99Y.globalExpect(post).toBeDefined();
86
- require_vi_bdSIJ99Y.globalExpect(post.title).toBe("Test Post");
87
- require_vi_bdSIJ99Y.globalExpect(post.userId).toBeDefined();
88
- require_vi_bdSIJ99Y.globalExpect(typeof post.userId).toBe("number");
84
+ (0, vitest.expect)(post).toBeDefined();
85
+ (0, vitest.expect)(post.title).toBe("Test Post");
86
+ (0, vitest.expect)(post.userId).toBeDefined();
87
+ (0, vitest.expect)(typeof post.userId).toBe("number");
89
88
  });
90
89
  itWithTransaction("should throw error for non-existent builder", async ({ trx: trx$1 }) => {
91
90
  const factory = new require_KyselyFactory.KyselyFactory({}, {}, trx$1);
92
- await require_vi_bdSIJ99Y.globalExpect(factory.insert("nonExistent")).rejects.toThrow("Factory \"nonExistent\" does not exist");
91
+ await (0, vitest.expect)(factory.insert("nonExistent")).rejects.toThrow("Factory \"nonExistent\" does not exist");
93
92
  });
94
93
  });
95
- require_dist.describe("KyselyFactory.insertMany", () => {
94
+ (0, vitest.describe)("KyselyFactory.insertMany", () => {
96
95
  itWithTransaction("should insert multiple records with same attributes", async ({ trx: trx$1 }) => {
97
96
  const userBuilder = require_KyselyFactory.KyselyFactory.createBuilder("users", async (attrs) => ({
98
97
  name: "John Doe",
@@ -102,11 +101,11 @@ require_dist.describe("KyselyFactory", () => {
102
101
  const builders = { user: userBuilder };
103
102
  const factory = new require_KyselyFactory.KyselyFactory(builders, {}, trx$1);
104
103
  const users = await factory.insertMany(3, "user");
105
- require_vi_bdSIJ99Y.globalExpect(users).toHaveLength(3);
104
+ (0, vitest.expect)(users).toHaveLength(3);
106
105
  users.forEach((user, index) => {
107
- require_vi_bdSIJ99Y.globalExpect(user.id).toBeDefined();
108
- require_vi_bdSIJ99Y.globalExpect(user.name).toBe("John Doe");
109
- require_vi_bdSIJ99Y.globalExpect(user.email).toContain("@example.com");
106
+ (0, vitest.expect)(user.id).toBeDefined();
107
+ (0, vitest.expect)(user.name).toBe("John Doe");
108
+ (0, vitest.expect)(user.email).toContain("@example.com");
110
109
  });
111
110
  });
112
111
  itWithTransaction("should insert multiple records with dynamic attributes", async ({ trx: trx$1 }) => {
@@ -117,17 +116,17 @@ require_dist.describe("KyselyFactory", () => {
117
116
  const builders = { user: userBuilder };
118
117
  const factory = new require_KyselyFactory.KyselyFactory(builders, {}, trx$1);
119
118
  const users = await factory.insertMany(3, "user", (idx) => ({ name: `User ${idx}` }));
120
- require_vi_bdSIJ99Y.globalExpect(users).toHaveLength(3);
119
+ (0, vitest.expect)(users).toHaveLength(3);
121
120
  users.forEach((user, index) => {
122
- require_vi_bdSIJ99Y.globalExpect(user.name).toBe(`User ${index}`);
121
+ (0, vitest.expect)(user.name).toBe(`User ${index}`);
123
122
  });
124
123
  });
125
124
  itWithTransaction("should throw error for non-existent builder", async ({ trx: trx$1 }) => {
126
125
  const factory = new require_KyselyFactory.KyselyFactory({}, {}, trx$1);
127
- await require_vi_bdSIJ99Y.globalExpect(factory.insertMany(2, "nonExistent")).rejects.toThrow("Builder \"nonExistent\" is not registered");
126
+ await (0, vitest.expect)(factory.insertMany(2, "nonExistent")).rejects.toThrow("Builder \"nonExistent\" is not registered");
128
127
  });
129
128
  });
130
- require_dist.describe("KyselyFactory.createBuilder", () => {
129
+ (0, vitest.describe)("KyselyFactory.createBuilder", () => {
131
130
  itWithTransaction("should work with async defaults", async ({ trx: trx$1 }) => {
132
131
  let counter = 0;
133
132
  const userBuilder = require_KyselyFactory.KyselyFactory.createBuilder("users", async (attrs) => {
@@ -143,11 +142,11 @@ require_dist.describe("KyselyFactory", () => {
143
142
  const factory = new require_KyselyFactory.KyselyFactory(builders, {}, trx$1);
144
143
  const user1 = await factory.insert("user");
145
144
  const user2 = await factory.insert("user");
146
- require_vi_bdSIJ99Y.globalExpect(user1.name).toBe("Async User 1");
147
- require_vi_bdSIJ99Y.globalExpect(user2.name).toBe("Async User 2");
145
+ (0, vitest.expect)(user1.name).toBe("Async User 1");
146
+ (0, vitest.expect)(user2.name).toBe("Async User 2");
148
147
  });
149
148
  });
150
- require_dist.describe("KyselyFactory.seed", () => {
149
+ (0, vitest.describe)("KyselyFactory.seed", () => {
151
150
  itWithTransaction("should execute seed functions", async ({ trx: trx$1 }) => {
152
151
  const userBuilder = require_KyselyFactory.KyselyFactory.createBuilder("users", async (attrs) => ({
153
152
  name: "John Doe",
@@ -163,9 +162,9 @@ require_dist.describe("KyselyFactory", () => {
163
162
  }) };
164
163
  const factory = new require_KyselyFactory.KyselyFactory(builders, seeds, trx$1);
165
164
  const adminUser = await factory.seed("createAdminUser");
166
- require_vi_bdSIJ99Y.globalExpect(adminUser).toBeDefined();
167
- require_vi_bdSIJ99Y.globalExpect(adminUser.name).toBe("Admin User");
168
- require_vi_bdSIJ99Y.globalExpect(adminUser.email).toBe("admin@example.com");
165
+ (0, vitest.expect)(adminUser).toBeDefined();
166
+ (0, vitest.expect)(adminUser.name).toBe("Admin User");
167
+ (0, vitest.expect)(adminUser.email).toBe("admin@example.com");
169
168
  });
170
169
  itWithTransaction("should pass attributes to seed functions", async ({ trx: trx$1 }) => {
171
170
  const userBuilder = require_KyselyFactory.KyselyFactory.createBuilder("users", async (attrs) => ({
@@ -182,15 +181,15 @@ require_dist.describe("KyselyFactory", () => {
182
181
  name: "Custom User",
183
182
  email: "custom@test.com"
184
183
  });
185
- require_vi_bdSIJ99Y.globalExpect(customUser.name).toBe("Custom User");
186
- require_vi_bdSIJ99Y.globalExpect(customUser.email).toBe("custom@test.com");
184
+ (0, vitest.expect)(customUser.name).toBe("Custom User");
185
+ (0, vitest.expect)(customUser.email).toBe("custom@test.com");
187
186
  });
188
187
  itWithTransaction("should throw error for non-existent seed", async ({ trx: trx$1 }) => {
189
188
  const factory = new require_KyselyFactory.KyselyFactory({}, {}, trx$1);
190
- require_vi_bdSIJ99Y.globalExpect(() => factory.seed("nonExistent")).toThrow("Seed \"nonExistent\" is not registered");
189
+ (0, vitest.expect)(() => factory.seed("nonExistent")).toThrow("Seed \"nonExistent\" is not registered");
191
190
  });
192
191
  });
193
- require_dist.describe("Factory integration", () => {
192
+ (0, vitest.describe)("Factory integration", () => {
194
193
  itWithTransaction("should work with controlled transactions", async ({ trx: trx$1 }) => {
195
194
  const userBuilder = require_KyselyFactory.KyselyFactory.createBuilder("users", async (attrs) => ({
196
195
  name: "John Doe",
@@ -201,8 +200,8 @@ require_dist.describe("KyselyFactory", () => {
201
200
  const factory = new require_KyselyFactory.KyselyFactory(builders, {}, trx$1);
202
201
  const user = await factory.insert("user");
203
202
  const foundUser = await trx$1.selectFrom("users").selectAll().where("id", "=", user.id).executeTakeFirst();
204
- require_vi_bdSIJ99Y.globalExpect(foundUser).toBeDefined();
205
- require_vi_bdSIJ99Y.globalExpect(foundUser?.id).toBe(user.id);
203
+ (0, vitest.expect)(foundUser).toBeDefined();
204
+ (0, vitest.expect)(foundUser?.id).toBe(user.id);
206
205
  });
207
206
  itWithTransaction("should work with factory passed to defaults", async ({ trx: trx$1 }) => {
208
207
  const userBuilder = require_KyselyFactory.KyselyFactory.createBuilder("users", async (attrs) => ({
@@ -225,9 +224,9 @@ require_dist.describe("KyselyFactory", () => {
225
224
  };
226
225
  const factory = new require_KyselyFactory.KyselyFactory(builders, {}, trx$1);
227
226
  const post = await factory.insert("post");
228
- require_vi_bdSIJ99Y.globalExpect(post.userId).toBeDefined();
227
+ (0, vitest.expect)(post.userId).toBeDefined();
229
228
  const relatedUser = await trx$1.selectFrom("users").selectAll().where("id", "=", post.userId).executeTakeFirst();
230
- require_vi_bdSIJ99Y.globalExpect(relatedUser).toBeDefined();
229
+ (0, vitest.expect)(relatedUser).toBeDefined();
231
230
  });
232
231
  });
233
232
  });
@@ -1,13 +1,12 @@
1
- import { describe } from "../dist-BM2KvLG1.mjs";
2
- import "../Factory-D52Lsc6Z.mjs";
3
- import "../faker-cGCFcrj2.mjs";
4
- import { KyselyFactory } from "../KyselyFactory-ionH4gvk.mjs";
5
- import { globalExpect } from "../vi.bdSIJ99Y-BgRxGeO2.mjs";
6
- import "../VitestTransactionIsolator-pLwsDo_A.mjs";
7
- import "../VitestKyselyTransactionIsolator-DXjWQtDN.mjs";
8
- import { createKyselyDb, wrapVitestKyselyTransaction } from "../helpers-BnARb5Ap.mjs";
9
- import { TEST_DATABASE_CONFIG, createTestTables } from "../helpers-CukcFAU9.mjs";
1
+ import "../Factory-DlzMkMzb.mjs";
2
+ import "../faker-BwaXA_RF.mjs";
3
+ import { KyselyFactory } from "../KyselyFactory-pOMOFQWE.mjs";
4
+ import "../VitestTransactionIsolator-BjVXqFs6.mjs";
5
+ import "../VitestKyselyTransactionIsolator-BS3R-V0I.mjs";
6
+ import { createKyselyDb, wrapVitestKyselyTransaction } from "../helpers-DOiGIkaU.mjs";
7
+ import { TEST_DATABASE_CONFIG, createTestTables } from "../helpers-BfuX-cjN.mjs";
10
8
  import pg from "pg";
9
+ import { describe, expect } from "vitest";
11
10
 
12
11
  //#region src/__tests__/KyselyFactory.spec.ts
13
12
  const db = createKyselyDb(TEST_DATABASE_CONFIG);
@@ -29,12 +28,12 @@ describe("KyselyFactory", () => {
29
28
  const builders = { user: userBuilder };
30
29
  const factory = new KyselyFactory(builders, {}, trx$1);
31
30
  const user = await factory.insert("user");
32
- globalExpect(user).toBeDefined();
33
- globalExpect(user.id).toBeDefined();
34
- globalExpect(user.name).toBe("John Doe");
35
- globalExpect(user.email).toContain("user");
36
- globalExpect(user.email).toContain("@example.com");
37
- globalExpect(user.createdAt).toBeInstanceOf(Date);
31
+ expect(user).toBeDefined();
32
+ expect(user.id).toBeDefined();
33
+ expect(user.name).toBe("John Doe");
34
+ expect(user.email).toContain("user");
35
+ expect(user.email).toContain("@example.com");
36
+ expect(user.createdAt).toBeInstanceOf(Date);
38
37
  });
39
38
  itWithTransaction("should override defaults with provided attributes", async ({ trx: trx$1 }) => {
40
39
  const userBuilder = KyselyFactory.createBuilder("users", async (attrs) => ({
@@ -50,8 +49,8 @@ describe("KyselyFactory", () => {
50
49
  email: customEmail,
51
50
  name: customName
52
51
  });
53
- globalExpect(user.name).toBe(customName);
54
- globalExpect(user.email).toBe(customEmail);
52
+ expect(user.name).toBe(customName);
53
+ expect(user.email).toBe(customEmail);
55
54
  });
56
55
  itWithTransaction("should handle relations", async ({ trx: trx$1 }) => {
57
56
  const userBuilder = KyselyFactory.createBuilder("users", async (attrs) => ({
@@ -81,14 +80,14 @@ describe("KyselyFactory", () => {
81
80
  };
82
81
  const factory = new KyselyFactory(builders, {}, trx$1);
83
82
  const post = await factory.insert("post", { title: "Test Post" });
84
- globalExpect(post).toBeDefined();
85
- globalExpect(post.title).toBe("Test Post");
86
- globalExpect(post.userId).toBeDefined();
87
- globalExpect(typeof post.userId).toBe("number");
83
+ expect(post).toBeDefined();
84
+ expect(post.title).toBe("Test Post");
85
+ expect(post.userId).toBeDefined();
86
+ expect(typeof post.userId).toBe("number");
88
87
  });
89
88
  itWithTransaction("should throw error for non-existent builder", async ({ trx: trx$1 }) => {
90
89
  const factory = new KyselyFactory({}, {}, trx$1);
91
- await globalExpect(factory.insert("nonExistent")).rejects.toThrow("Factory \"nonExistent\" does not exist");
90
+ await expect(factory.insert("nonExistent")).rejects.toThrow("Factory \"nonExistent\" does not exist");
92
91
  });
93
92
  });
94
93
  describe("KyselyFactory.insertMany", () => {
@@ -101,11 +100,11 @@ describe("KyselyFactory", () => {
101
100
  const builders = { user: userBuilder };
102
101
  const factory = new KyselyFactory(builders, {}, trx$1);
103
102
  const users = await factory.insertMany(3, "user");
104
- globalExpect(users).toHaveLength(3);
103
+ expect(users).toHaveLength(3);
105
104
  users.forEach((user, index) => {
106
- globalExpect(user.id).toBeDefined();
107
- globalExpect(user.name).toBe("John Doe");
108
- globalExpect(user.email).toContain("@example.com");
105
+ expect(user.id).toBeDefined();
106
+ expect(user.name).toBe("John Doe");
107
+ expect(user.email).toContain("@example.com");
109
108
  });
110
109
  });
111
110
  itWithTransaction("should insert multiple records with dynamic attributes", async ({ trx: trx$1 }) => {
@@ -116,14 +115,14 @@ describe("KyselyFactory", () => {
116
115
  const builders = { user: userBuilder };
117
116
  const factory = new KyselyFactory(builders, {}, trx$1);
118
117
  const users = await factory.insertMany(3, "user", (idx) => ({ name: `User ${idx}` }));
119
- globalExpect(users).toHaveLength(3);
118
+ expect(users).toHaveLength(3);
120
119
  users.forEach((user, index) => {
121
- globalExpect(user.name).toBe(`User ${index}`);
120
+ expect(user.name).toBe(`User ${index}`);
122
121
  });
123
122
  });
124
123
  itWithTransaction("should throw error for non-existent builder", async ({ trx: trx$1 }) => {
125
124
  const factory = new KyselyFactory({}, {}, trx$1);
126
- await globalExpect(factory.insertMany(2, "nonExistent")).rejects.toThrow("Builder \"nonExistent\" is not registered");
125
+ await expect(factory.insertMany(2, "nonExistent")).rejects.toThrow("Builder \"nonExistent\" is not registered");
127
126
  });
128
127
  });
129
128
  describe("KyselyFactory.createBuilder", () => {
@@ -142,8 +141,8 @@ describe("KyselyFactory", () => {
142
141
  const factory = new KyselyFactory(builders, {}, trx$1);
143
142
  const user1 = await factory.insert("user");
144
143
  const user2 = await factory.insert("user");
145
- globalExpect(user1.name).toBe("Async User 1");
146
- globalExpect(user2.name).toBe("Async User 2");
144
+ expect(user1.name).toBe("Async User 1");
145
+ expect(user2.name).toBe("Async User 2");
147
146
  });
148
147
  });
149
148
  describe("KyselyFactory.seed", () => {
@@ -162,9 +161,9 @@ describe("KyselyFactory", () => {
162
161
  }) };
163
162
  const factory = new KyselyFactory(builders, seeds, trx$1);
164
163
  const adminUser = await factory.seed("createAdminUser");
165
- globalExpect(adminUser).toBeDefined();
166
- globalExpect(adminUser.name).toBe("Admin User");
167
- globalExpect(adminUser.email).toBe("admin@example.com");
164
+ expect(adminUser).toBeDefined();
165
+ expect(adminUser.name).toBe("Admin User");
166
+ expect(adminUser.email).toBe("admin@example.com");
168
167
  });
169
168
  itWithTransaction("should pass attributes to seed functions", async ({ trx: trx$1 }) => {
170
169
  const userBuilder = KyselyFactory.createBuilder("users", async (attrs) => ({
@@ -181,12 +180,12 @@ describe("KyselyFactory", () => {
181
180
  name: "Custom User",
182
181
  email: "custom@test.com"
183
182
  });
184
- globalExpect(customUser.name).toBe("Custom User");
185
- globalExpect(customUser.email).toBe("custom@test.com");
183
+ expect(customUser.name).toBe("Custom User");
184
+ expect(customUser.email).toBe("custom@test.com");
186
185
  });
187
186
  itWithTransaction("should throw error for non-existent seed", async ({ trx: trx$1 }) => {
188
187
  const factory = new KyselyFactory({}, {}, trx$1);
189
- globalExpect(() => factory.seed("nonExistent")).toThrow("Seed \"nonExistent\" is not registered");
188
+ expect(() => factory.seed("nonExistent")).toThrow("Seed \"nonExistent\" is not registered");
190
189
  });
191
190
  });
192
191
  describe("Factory integration", () => {
@@ -200,8 +199,8 @@ describe("KyselyFactory", () => {
200
199
  const factory = new KyselyFactory(builders, {}, trx$1);
201
200
  const user = await factory.insert("user");
202
201
  const foundUser = await trx$1.selectFrom("users").selectAll().where("id", "=", user.id).executeTakeFirst();
203
- globalExpect(foundUser).toBeDefined();
204
- globalExpect(foundUser?.id).toBe(user.id);
202
+ expect(foundUser).toBeDefined();
203
+ expect(foundUser?.id).toBe(user.id);
205
204
  });
206
205
  itWithTransaction("should work with factory passed to defaults", async ({ trx: trx$1 }) => {
207
206
  const userBuilder = KyselyFactory.createBuilder("users", async (attrs) => ({
@@ -224,9 +223,9 @@ describe("KyselyFactory", () => {
224
223
  };
225
224
  const factory = new KyselyFactory(builders, {}, trx$1);
226
225
  const post = await factory.insert("post");
227
- globalExpect(post.userId).toBeDefined();
226
+ expect(post.userId).toBeDefined();
228
227
  const relatedUser = await trx$1.selectFrom("users").selectAll().where("id", "=", post.userId).executeTakeFirst();
229
- globalExpect(relatedUser).toBeDefined();
228
+ expect(relatedUser).toBeDefined();
230
229
  });
231
230
  });
232
231
  });