@geekmidas/testkit 0.0.4 → 0.0.6

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 (68) 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-D-qpeVKO.mjs} +1 -1
  16. package/dist/{VitestKyselyTransactionIsolator-Dh2AgJDd.cjs → VitestKyselyTransactionIsolator-jF6Ohyu_.cjs} +1 -1
  17. package/dist/VitestKyselyTransactionIsolator.cjs +2 -3
  18. package/dist/VitestKyselyTransactionIsolator.mjs +2 -3
  19. package/dist/{VitestTransactionIsolator-zK5NJ7DQ.cjs → VitestTransactionIsolator-BK9UsrKt.cjs} +4 -2
  20. package/dist/{VitestTransactionIsolator-pLwsDo_A.mjs → VitestTransactionIsolator-e-R3p_X8.mjs} +4 -3
  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 +80 -80
  26. package/dist/__tests__/KyselyFactory.spec.mjs +74 -74
  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 +44 -41
  34. package/dist/__tests__/integration.spec.mjs +45 -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-C2NH7xcz.cjs → helpers-B2CfbaTC.cjs} +1 -1
  42. package/dist/helpers-DN4sJO4i.mjs +13 -0
  43. package/dist/helpers-DOtYCEvZ.cjs +19 -0
  44. package/dist/helpers.cjs +2 -6
  45. package/dist/helpers.mjs +2 -5
  46. package/dist/kysely-C1-aHdnU.mjs +11 -0
  47. package/dist/kysely-DL3C2eM4.cjs +16 -0
  48. package/dist/kysely.cjs +8 -15
  49. package/dist/kysely.mjs +8 -15
  50. package/dist/objection.mjs +2 -2
  51. package/package.json +2 -1
  52. package/src/VitestTransactionIsolator.ts +4 -2
  53. package/src/__tests__/KyselyFactory.spec.ts +4 -6
  54. package/src/__tests__/integration.spec.ts +8 -3
  55. package/src/helpers.ts +1 -18
  56. package/src/kysely.ts +3 -1
  57. package/dist/dist-BM2KvLG1.mjs +0 -5618
  58. package/dist/dist-DE3gAxQI.cjs +0 -5736
  59. package/dist/helpers-BnARb5Ap.mjs +0 -19
  60. package/dist/helpers-C_RZk04R.cjs +0 -31
  61. package/dist/magic-string.es-C6yzoryu.mjs +0 -1014
  62. package/dist/magic-string.es-jdtJrR0A.cjs +0 -1015
  63. package/dist/vi.bdSIJ99Y-BgRxGeO2.mjs +0 -9382
  64. package/dist/vi.bdSIJ99Y-CFuzUeY6.cjs +0 -9393
  65. /package/dist/{Factory-D52Lsc6Z.mjs → Factory-DlzMkMzb.mjs} +0 -0
  66. /package/dist/{PostgresMigrator-DqeuPy-e.mjs → PostgresMigrator-CEoRKTdq.mjs} +0 -0
  67. /package/dist/{faker-cGCFcrj2.mjs → faker-BwaXA_RF.mjs} +0 -0
  68. /package/dist/{helpers-CukcFAU9.mjs → helpers-Rf5F71r9.mjs} +0 -0
package/dist/Factory.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { Factory } from "./Factory-D52Lsc6Z.mjs";
1
+ import { Factory } from "./Factory-DlzMkMzb.mjs";
2
2
 
3
3
  export { Factory };
@@ -1,5 +1,5 @@
1
1
  const require_Factory = require('./Factory-DREHoms3.cjs');
2
- const require_faker = require('./faker-h6CkRloU.cjs');
2
+ const require_faker = require('./faker-caz-8zt8.cjs');
3
3
 
4
4
  //#region src/KyselyFactory.ts
5
5
  var KyselyFactory = class extends require_Factory.Factory {
@@ -1,5 +1,5 @@
1
- import { Factory } from "./Factory-D52Lsc6Z.mjs";
2
- import { faker } from "./faker-cGCFcrj2.mjs";
1
+ import { Factory } from "./Factory-DlzMkMzb.mjs";
2
+ import { faker } from "./faker-BwaXA_RF.mjs";
3
3
 
4
4
  //#region src/KyselyFactory.ts
5
5
  var KyselyFactory = class extends Factory {
@@ -1,5 +1,5 @@
1
1
  require('./Factory-DREHoms3.cjs');
2
- require('./faker-h6CkRloU.cjs');
3
- const require_KyselyFactory = require('./KyselyFactory-BGvSMLtd.cjs');
2
+ require('./faker-caz-8zt8.cjs');
3
+ const require_KyselyFactory = require('./KyselyFactory-BX7Kv2uP.cjs');
4
4
 
5
5
  exports.KyselyFactory = require_KyselyFactory.KyselyFactory;
@@ -1,5 +1,5 @@
1
- import "./Factory-D52Lsc6Z.mjs";
2
- import "./faker-cGCFcrj2.mjs";
3
- import { KyselyFactory } from "./KyselyFactory-ionH4gvk.mjs";
1
+ import "./Factory-DlzMkMzb.mjs";
2
+ import "./faker-BwaXA_RF.mjs";
3
+ import { KyselyFactory } from "./KyselyFactory-pOMOFQWE.mjs";
4
4
 
5
5
  export { KyselyFactory };
@@ -1,4 +1,4 @@
1
- import { Factory } from "./Factory-D52Lsc6Z.mjs";
1
+ import { Factory } from "./Factory-DlzMkMzb.mjs";
2
2
 
3
3
  //#region src/ObjectionFactory.ts
4
4
  var ObjectionFactory = class extends Factory {
@@ -1,4 +1,4 @@
1
- import "./Factory-D52Lsc6Z.mjs";
2
- import { ObjectionFactory } from "./ObjectionFactory-CFrtXe7i.mjs";
1
+ import "./Factory-DlzMkMzb.mjs";
2
+ import { ObjectionFactory } from "./ObjectionFactory-ChuX8sZN.mjs";
3
3
 
4
4
  export { ObjectionFactory };
@@ -1,4 +1,4 @@
1
- import { PostgresMigrator } from "./PostgresMigrator-DqeuPy-e.mjs";
1
+ import { PostgresMigrator } from "./PostgresMigrator-CEoRKTdq.mjs";
2
2
  import { Migrator } from "kysely";
3
3
 
4
4
  //#region src/PostgresKyselyMigrator.ts
@@ -1,5 +1,5 @@
1
- const require_chunk = require('./chunk-DWy1uDak.cjs');
2
- const require_PostgresMigrator = require('./PostgresMigrator-eqyAFSf-.cjs');
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ const require_PostgresMigrator = require('./PostgresMigrator-Bz-tnjB6.cjs');
3
3
  const kysely = require_chunk.__toESM(require("kysely"));
4
4
 
5
5
  //#region src/PostgresKyselyMigrator.ts
@@ -1,4 +1,4 @@
1
- require('./PostgresMigrator-eqyAFSf-.cjs');
2
- const require_PostgresKyselyMigrator = require('./PostgresKyselyMigrator-Cxf2Dp9y.cjs');
1
+ require('./PostgresMigrator-Bz-tnjB6.cjs');
2
+ const require_PostgresKyselyMigrator = require('./PostgresKyselyMigrator-JTY2LfwD.cjs');
3
3
 
4
4
  exports.PostgresKyselyMigrator = require_PostgresKyselyMigrator.PostgresKyselyMigrator;
@@ -1,4 +1,4 @@
1
- import "./PostgresMigrator-DqeuPy-e.mjs";
2
- import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-CbtiZgfI.mjs";
1
+ import "./PostgresMigrator-CEoRKTdq.mjs";
2
+ import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-D8fm35-s.mjs";
3
3
 
4
4
  export { PostgresKyselyMigrator };
@@ -1,4 +1,4 @@
1
- const require_chunk = require('./chunk-DWy1uDak.cjs');
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
2
  const pg = require_chunk.__toESM(require("pg"));
3
3
 
4
4
  //#region src/PostgresMigrator.ts
@@ -1,3 +1,3 @@
1
- const require_PostgresMigrator = require('./PostgresMigrator-eqyAFSf-.cjs');
1
+ const require_PostgresMigrator = require('./PostgresMigrator-Bz-tnjB6.cjs');
2
2
 
3
3
  exports.PostgresMigrator = require_PostgresMigrator.PostgresMigrator;
@@ -1,3 +1,3 @@
1
- import { PostgresMigrator } from "./PostgresMigrator-DqeuPy-e.mjs";
1
+ import { PostgresMigrator } from "./PostgresMigrator-CEoRKTdq.mjs";
2
2
 
3
3
  export { PostgresMigrator };
@@ -1,4 +1,4 @@
1
- import { VitestPostgresTransactionIsolator } from "./VitestTransactionIsolator-pLwsDo_A.mjs";
1
+ import { VitestPostgresTransactionIsolator } from "./VitestTransactionIsolator-e-R3p_X8.mjs";
2
2
 
3
3
  //#region src/VitestKyselyTransactionIsolator.ts
4
4
  var VitestKyselyTransactionIsolator = class extends VitestPostgresTransactionIsolator {
@@ -1,4 +1,4 @@
1
- const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-zK5NJ7DQ.cjs');
1
+ const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-BK9UsrKt.cjs');
2
2
 
3
3
  //#region src/VitestKyselyTransactionIsolator.ts
4
4
  var VitestKyselyTransactionIsolator = class extends require_VitestTransactionIsolator.VitestPostgresTransactionIsolator {
@@ -1,5 +1,4 @@
1
- require('./dist-DE3gAxQI.cjs');
2
- require('./VitestTransactionIsolator-zK5NJ7DQ.cjs');
3
- const require_VitestKyselyTransactionIsolator = require('./VitestKyselyTransactionIsolator-Dh2AgJDd.cjs');
1
+ require('./VitestTransactionIsolator-BK9UsrKt.cjs');
2
+ const require_VitestKyselyTransactionIsolator = require('./VitestKyselyTransactionIsolator-jF6Ohyu_.cjs');
4
3
 
5
4
  exports.VitestKyselyTransactionIsolator = require_VitestKyselyTransactionIsolator.VitestKyselyTransactionIsolator;
@@ -1,5 +1,4 @@
1
- import "./dist-BM2KvLG1.mjs";
2
- import "./VitestTransactionIsolator-pLwsDo_A.mjs";
3
- import { VitestKyselyTransactionIsolator } from "./VitestKyselyTransactionIsolator-DXjWQtDN.mjs";
1
+ import "./VitestTransactionIsolator-e-R3p_X8.mjs";
2
+ import { VitestKyselyTransactionIsolator } from "./VitestKyselyTransactionIsolator-D-qpeVKO.mjs";
4
3
 
5
4
  export { VitestKyselyTransactionIsolator };
@@ -1,4 +1,3 @@
1
- const require_dist = require('./dist-DE3gAxQI.cjs');
2
1
 
3
2
  //#region src/VitestTransactionIsolator.ts
4
3
  let IsolationLevel = /* @__PURE__ */ function(IsolationLevel$1) {
@@ -9,8 +8,11 @@ let IsolationLevel = /* @__PURE__ */ function(IsolationLevel$1) {
9
8
  return IsolationLevel$1;
10
9
  }({});
11
10
  var VitestPostgresTransactionIsolator = class {
11
+ constructor(api) {
12
+ this.api = api;
13
+ }
12
14
  wrapVitestWithTransaction(conn, setup, level = IsolationLevel.REPEATABLE_READ) {
13
- return require_dist.test.extend({ trx: async ({}, use) => {
15
+ return this.api.extend({ trx: async ({}, use) => {
14
16
  class TestRollback extends Error {
15
17
  constructor() {
16
18
  super("Test rollback");
@@ -1,5 +1,3 @@
1
- import { test } from "./dist-BM2KvLG1.mjs";
2
-
3
1
  //#region src/VitestTransactionIsolator.ts
4
2
  let IsolationLevel = /* @__PURE__ */ function(IsolationLevel$1) {
5
3
  IsolationLevel$1["READ_UNCOMMITTED"] = "READ UNCOMMITTED";
@@ -9,8 +7,11 @@ let IsolationLevel = /* @__PURE__ */ function(IsolationLevel$1) {
9
7
  return IsolationLevel$1;
10
8
  }({});
11
9
  var VitestPostgresTransactionIsolator = class {
10
+ constructor(api) {
11
+ this.api = api;
12
+ }
12
13
  wrapVitestWithTransaction(conn, setup, level = IsolationLevel.REPEATABLE_READ) {
13
- return test.extend({ trx: async ({}, use) => {
14
+ return this.api.extend({ trx: async ({}, use) => {
14
15
  class TestRollback extends Error {
15
16
  constructor() {
16
17
  super("Test rollback");
@@ -1,5 +1,4 @@
1
- require('./dist-DE3gAxQI.cjs');
2
- const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-zK5NJ7DQ.cjs');
1
+ const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-BK9UsrKt.cjs');
3
2
 
4
3
  exports.IsolationLevel = require_VitestTransactionIsolator.IsolationLevel;
5
4
  exports.VitestPostgresTransactionIsolator = require_VitestTransactionIsolator.VitestPostgresTransactionIsolator;
@@ -1,4 +1,3 @@
1
- import "./dist-BM2KvLG1.mjs";
2
- import { IsolationLevel, VitestPostgresTransactionIsolator } from "./VitestTransactionIsolator-pLwsDo_A.mjs";
1
+ import { IsolationLevel, VitestPostgresTransactionIsolator } from "./VitestTransactionIsolator-e-R3p_X8.mjs";
3
2
 
4
3
  export { IsolationLevel, VitestPostgresTransactionIsolator };
@@ -1,6 +1,6 @@
1
+ const require_chunk = require('../chunk-CUT6urMc.cjs');
1
2
  const require_Factory = require('../Factory-DREHoms3.cjs');
2
- const require_dist = require('../dist-DE3gAxQI.cjs');
3
- const require_vi_bdSIJ99Y = require('../vi.bdSIJ99Y-CFuzUeY6.cjs');
3
+ const vitest = require_chunk.__toESM(require("vitest"));
4
4
 
5
5
  //#region src/__tests__/Factory.spec.ts
6
6
  var TestFactory = class extends require_Factory.Factory {
@@ -25,22 +25,22 @@ var TestFactory = class extends require_Factory.Factory {
25
25
  });
26
26
  }
27
27
  };
28
- require_dist.describe("Factory", () => {
29
- require_dist.describe("abstract class functionality", () => {
30
- require_dist.it("should be instantiable through concrete implementation", () => {
28
+ (0, vitest.describe)("Factory", () => {
29
+ (0, vitest.describe)("abstract class functionality", () => {
30
+ (0, vitest.it)("should be instantiable through concrete implementation", () => {
31
31
  const factory = new TestFactory();
32
- require_vi_bdSIJ99Y.globalExpect(factory).toBeInstanceOf(require_Factory.Factory);
33
- require_vi_bdSIJ99Y.globalExpect(factory).toBeInstanceOf(TestFactory);
32
+ (0, vitest.expect)(factory).toBeInstanceOf(require_Factory.Factory);
33
+ (0, vitest.expect)(factory).toBeInstanceOf(TestFactory);
34
34
  });
35
- require_dist.it("should have abstract methods defined", () => {
35
+ (0, vitest.it)("should have abstract methods defined", () => {
36
36
  const factory = new TestFactory();
37
- require_vi_bdSIJ99Y.globalExpect(typeof factory.insert).toBe("function");
38
- require_vi_bdSIJ99Y.globalExpect(typeof factory.insertMany).toBe("function");
39
- require_vi_bdSIJ99Y.globalExpect(typeof factory.seed).toBe("function");
37
+ (0, vitest.expect)(typeof factory.insert).toBe("function");
38
+ (0, vitest.expect)(typeof factory.insertMany).toBe("function");
39
+ (0, vitest.expect)(typeof factory.seed).toBe("function");
40
40
  });
41
41
  });
42
- require_dist.describe("createSeed static method", () => {
43
- require_dist.it("should return the seed function unchanged", () => {
42
+ (0, vitest.describe)("createSeed static method", () => {
43
+ (0, vitest.it)("should return the seed function unchanged", () => {
44
44
  const seedFn = async (attrs, factory, db) => {
45
45
  return {
46
46
  id: 1,
@@ -48,10 +48,10 @@ require_dist.describe("Factory", () => {
48
48
  };
49
49
  };
50
50
  const result = require_Factory.Factory.createSeed(seedFn);
51
- require_vi_bdSIJ99Y.globalExpect(result).toBe(seedFn);
52
- require_vi_bdSIJ99Y.globalExpect(typeof result).toBe("function");
51
+ (0, vitest.expect)(result).toBe(seedFn);
52
+ (0, vitest.expect)(typeof result).toBe("function");
53
53
  });
54
- require_dist.it("should work with different seed function signatures", () => {
54
+ (0, vitest.it)("should work with different seed function signatures", () => {
55
55
  const simpleSeed = () => Promise.resolve({ simple: true });
56
56
  const complexSeed = async (attrs, factory, db) => {
57
57
  return {
@@ -61,78 +61,78 @@ require_dist.describe("Factory", () => {
61
61
  };
62
62
  const result1 = require_Factory.Factory.createSeed(simpleSeed);
63
63
  const result2 = require_Factory.Factory.createSeed(complexSeed);
64
- require_vi_bdSIJ99Y.globalExpect(result1).toBe(simpleSeed);
65
- require_vi_bdSIJ99Y.globalExpect(result2).toBe(complexSeed);
64
+ (0, vitest.expect)(result1).toBe(simpleSeed);
65
+ (0, vitest.expect)(result2).toBe(complexSeed);
66
66
  });
67
67
  });
68
- require_dist.describe("concrete implementation behavior", () => {
68
+ (0, vitest.describe)("concrete implementation behavior", () => {
69
69
  let factory;
70
- require_dist.beforeEach(() => {
70
+ (0, vitest.beforeEach)(() => {
71
71
  factory = new TestFactory();
72
72
  });
73
- require_dist.it("should implement insert method", async () => {
73
+ (0, vitest.it)("should implement insert method", async () => {
74
74
  const result = await factory.insert("testBuilder", { name: "test" });
75
- require_vi_bdSIJ99Y.globalExpect(result).toEqual({
75
+ (0, vitest.expect)(result).toEqual({
76
76
  id: 1,
77
77
  name: "test"
78
78
  });
79
79
  });
80
- require_dist.it("should implement insertMany method", async () => {
80
+ (0, vitest.it)("should implement insertMany method", async () => {
81
81
  const results = await factory.insertMany(3, "testBuilder", { name: "test" });
82
- require_vi_bdSIJ99Y.globalExpect(results).toHaveLength(3);
83
- require_vi_bdSIJ99Y.globalExpect(results[0]).toEqual({
82
+ (0, vitest.expect)(results).toHaveLength(3);
83
+ (0, vitest.expect)(results[0]).toEqual({
84
84
  id: 1,
85
85
  name: "test"
86
86
  });
87
87
  });
88
- require_dist.it("should implement insertMany with function attributes", async () => {
88
+ (0, vitest.it)("should implement insertMany with function attributes", async () => {
89
89
  const results = await factory.insertMany(2, "testBuilder", (idx) => ({ name: `test${idx}` }));
90
- require_vi_bdSIJ99Y.globalExpect(results).toHaveLength(2);
91
- require_vi_bdSIJ99Y.globalExpect(results[0]).toEqual({
90
+ (0, vitest.expect)(results).toHaveLength(2);
91
+ (0, vitest.expect)(results[0]).toEqual({
92
92
  id: 1,
93
93
  name: "test0"
94
94
  });
95
- require_vi_bdSIJ99Y.globalExpect(results[1]).toEqual({
95
+ (0, vitest.expect)(results[1]).toEqual({
96
96
  id: 1,
97
97
  name: "test1"
98
98
  });
99
99
  });
100
- require_dist.it("should implement seed method", async () => {
100
+ (0, vitest.it)("should implement seed method", async () => {
101
101
  const result = await factory.seed("testSeed", { custom: "value" });
102
- require_vi_bdSIJ99Y.globalExpect(result).toEqual({
102
+ (0, vitest.expect)(result).toEqual({
103
103
  seedResult: true,
104
104
  custom: "value"
105
105
  });
106
106
  });
107
107
  });
108
- require_dist.describe("type definitions", () => {
109
- require_dist.it("should properly type MixedFactoryBuilder", () => {
108
+ (0, vitest.describe)("type definitions", () => {
109
+ (0, vitest.it)("should properly type MixedFactoryBuilder", () => {
110
110
  const syncBuilder = (attrs, factory, db) => ({ sync: true });
111
111
  const asyncBuilder = async (attrs, factory, db) => ({ async: true });
112
- require_vi_bdSIJ99Y.globalExpect(typeof syncBuilder).toBe("function");
113
- require_vi_bdSIJ99Y.globalExpect(typeof asyncBuilder).toBe("function");
112
+ (0, vitest.expect)(typeof syncBuilder).toBe("function");
113
+ (0, vitest.expect)(typeof asyncBuilder).toBe("function");
114
114
  });
115
- require_dist.it("should properly type FactorySeed", () => {
115
+ (0, vitest.it)("should properly type FactorySeed", () => {
116
116
  const seed = async (attrs, factory, db) => ({ seeded: true });
117
- require_vi_bdSIJ99Y.globalExpect(typeof seed).toBe("function");
117
+ (0, vitest.expect)(typeof seed).toBe("function");
118
118
  });
119
119
  });
120
120
  });
121
- require_dist.describe("Factory types", () => {
122
- require_dist.it("should export MixedFactoryBuilder type", () => {
121
+ (0, vitest.describe)("Factory types", () => {
122
+ (0, vitest.it)("should export MixedFactoryBuilder type", () => {
123
123
  const builder = (attrs, factory, db) => {
124
124
  return {
125
125
  id: 1,
126
126
  name: attrs.name
127
127
  };
128
128
  };
129
- require_vi_bdSIJ99Y.globalExpect(typeof builder).toBe("function");
129
+ (0, vitest.expect)(typeof builder).toBe("function");
130
130
  });
131
- require_dist.it("should export FactorySeed type", () => {
131
+ (0, vitest.it)("should export FactorySeed type", () => {
132
132
  const seed = async (attrs, factory, db) => {
133
133
  return { created: attrs.count };
134
134
  };
135
- require_vi_bdSIJ99Y.globalExpect(typeof seed).toBe("function");
135
+ (0, vitest.expect)(typeof seed).toBe("function");
136
136
  });
137
137
  });
138
138
 
@@ -1,6 +1,5 @@
1
- import { beforeEach, describe, it } from "../dist-BM2KvLG1.mjs";
2
- import { Factory } from "../Factory-D52Lsc6Z.mjs";
3
- import { globalExpect } from "../vi.bdSIJ99Y-BgRxGeO2.mjs";
1
+ import { Factory } from "../Factory-DlzMkMzb.mjs";
2
+ import { beforeEach, describe, expect, it } from "vitest";
4
3
 
5
4
  //#region src/__tests__/Factory.spec.ts
6
5
  var TestFactory = class extends Factory {
@@ -29,14 +28,14 @@ describe("Factory", () => {
29
28
  describe("abstract class functionality", () => {
30
29
  it("should be instantiable through concrete implementation", () => {
31
30
  const factory = new TestFactory();
32
- globalExpect(factory).toBeInstanceOf(Factory);
33
- globalExpect(factory).toBeInstanceOf(TestFactory);
31
+ expect(factory).toBeInstanceOf(Factory);
32
+ expect(factory).toBeInstanceOf(TestFactory);
34
33
  });
35
34
  it("should have abstract methods defined", () => {
36
35
  const factory = new TestFactory();
37
- globalExpect(typeof factory.insert).toBe("function");
38
- globalExpect(typeof factory.insertMany).toBe("function");
39
- globalExpect(typeof factory.seed).toBe("function");
36
+ expect(typeof factory.insert).toBe("function");
37
+ expect(typeof factory.insertMany).toBe("function");
38
+ expect(typeof factory.seed).toBe("function");
40
39
  });
41
40
  });
42
41
  describe("createSeed static method", () => {
@@ -48,8 +47,8 @@ describe("Factory", () => {
48
47
  };
49
48
  };
50
49
  const result = Factory.createSeed(seedFn);
51
- globalExpect(result).toBe(seedFn);
52
- globalExpect(typeof result).toBe("function");
50
+ expect(result).toBe(seedFn);
51
+ expect(typeof result).toBe("function");
53
52
  });
54
53
  it("should work with different seed function signatures", () => {
55
54
  const simpleSeed = () => Promise.resolve({ simple: true });
@@ -61,8 +60,8 @@ describe("Factory", () => {
61
60
  };
62
61
  const result1 = Factory.createSeed(simpleSeed);
63
62
  const result2 = Factory.createSeed(complexSeed);
64
- globalExpect(result1).toBe(simpleSeed);
65
- globalExpect(result2).toBe(complexSeed);
63
+ expect(result1).toBe(simpleSeed);
64
+ expect(result2).toBe(complexSeed);
66
65
  });
67
66
  });
68
67
  describe("concrete implementation behavior", () => {
@@ -72,34 +71,34 @@ describe("Factory", () => {
72
71
  });
73
72
  it("should implement insert method", async () => {
74
73
  const result = await factory.insert("testBuilder", { name: "test" });
75
- globalExpect(result).toEqual({
74
+ expect(result).toEqual({
76
75
  id: 1,
77
76
  name: "test"
78
77
  });
79
78
  });
80
79
  it("should implement insertMany method", async () => {
81
80
  const results = await factory.insertMany(3, "testBuilder", { name: "test" });
82
- globalExpect(results).toHaveLength(3);
83
- globalExpect(results[0]).toEqual({
81
+ expect(results).toHaveLength(3);
82
+ expect(results[0]).toEqual({
84
83
  id: 1,
85
84
  name: "test"
86
85
  });
87
86
  });
88
87
  it("should implement insertMany with function attributes", async () => {
89
88
  const results = await factory.insertMany(2, "testBuilder", (idx) => ({ name: `test${idx}` }));
90
- globalExpect(results).toHaveLength(2);
91
- globalExpect(results[0]).toEqual({
89
+ expect(results).toHaveLength(2);
90
+ expect(results[0]).toEqual({
92
91
  id: 1,
93
92
  name: "test0"
94
93
  });
95
- globalExpect(results[1]).toEqual({
94
+ expect(results[1]).toEqual({
96
95
  id: 1,
97
96
  name: "test1"
98
97
  });
99
98
  });
100
99
  it("should implement seed method", async () => {
101
100
  const result = await factory.seed("testSeed", { custom: "value" });
102
- globalExpect(result).toEqual({
101
+ expect(result).toEqual({
103
102
  seedResult: true,
104
103
  custom: "value"
105
104
  });
@@ -109,12 +108,12 @@ describe("Factory", () => {
109
108
  it("should properly type MixedFactoryBuilder", () => {
110
109
  const syncBuilder = (attrs, factory, db) => ({ sync: true });
111
110
  const asyncBuilder = async (attrs, factory, db) => ({ async: true });
112
- globalExpect(typeof syncBuilder).toBe("function");
113
- globalExpect(typeof asyncBuilder).toBe("function");
111
+ expect(typeof syncBuilder).toBe("function");
112
+ expect(typeof asyncBuilder).toBe("function");
114
113
  });
115
114
  it("should properly type FactorySeed", () => {
116
115
  const seed = async (attrs, factory, db) => ({ seeded: true });
117
- globalExpect(typeof seed).toBe("function");
116
+ expect(typeof seed).toBe("function");
118
117
  });
119
118
  });
120
119
  });
@@ -126,13 +125,13 @@ describe("Factory types", () => {
126
125
  name: attrs.name
127
126
  };
128
127
  };
129
- globalExpect(typeof builder).toBe("function");
128
+ expect(typeof builder).toBe("function");
130
129
  });
131
130
  it("should export FactorySeed type", () => {
132
131
  const seed = async (attrs, factory, db) => {
133
132
  return { created: attrs.count };
134
133
  };
135
- globalExpect(typeof seed).toBe("function");
134
+ expect(typeof seed).toBe("function");
136
135
  });
137
136
  });
138
137