@geekmidas/testkit 1.0.5 → 1.0.7

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 (64) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/{Factory-CUM2767q.d.cts → Factory-BOX312yd.d.cts} +2 -2
  3. package/dist/{Factory-CUM2767q.d.cts.map → Factory-BOX312yd.d.cts.map} +1 -1
  4. package/dist/{Factory-SFupxRC2.d.mts → Factory-_w0_BN4J.d.mts} +2 -2
  5. package/dist/{Factory-SFupxRC2.d.mts.map → Factory-_w0_BN4J.d.mts.map} +1 -1
  6. package/dist/Factory.d.cts +2 -2
  7. package/dist/Factory.d.mts +2 -2
  8. package/dist/{KyselyFactory-OMwcuAX_.d.cts → KyselyFactory-BFxq2hz5.d.mts} +3 -3
  9. package/dist/{KyselyFactory-OMwcuAX_.d.cts.map → KyselyFactory-BFxq2hz5.d.mts.map} +1 -1
  10. package/dist/{KyselyFactory-vAxYodck.d.mts → KyselyFactory-Dy5zzV4B.d.cts} +3 -3
  11. package/dist/{KyselyFactory-vAxYodck.d.mts.map → KyselyFactory-Dy5zzV4B.d.cts.map} +1 -1
  12. package/dist/KyselyFactory.d.cts +3 -3
  13. package/dist/KyselyFactory.d.mts +3 -3
  14. package/dist/{ObjectionFactory-BWjB49-i.d.mts → ObjectionFactory-C4IsQ_wj.d.mts} +3 -3
  15. package/dist/{ObjectionFactory-BWjB49-i.d.mts.map → ObjectionFactory-C4IsQ_wj.d.mts.map} +1 -1
  16. package/dist/{ObjectionFactory-DvmZVHhe.d.cts → ObjectionFactory-CD-WFuMJ.d.cts} +3 -3
  17. package/dist/{ObjectionFactory-DvmZVHhe.d.cts.map → ObjectionFactory-CD-WFuMJ.d.cts.map} +1 -1
  18. package/dist/ObjectionFactory.d.cts +3 -3
  19. package/dist/ObjectionFactory.d.mts +3 -3
  20. package/dist/{VitestKyselyTransactionIsolator-D7RRXOBa.cjs → VitestKyselyTransactionIsolator-0CqOsuc9.cjs} +2 -2
  21. package/dist/{VitestKyselyTransactionIsolator-D7RRXOBa.cjs.map → VitestKyselyTransactionIsolator-0CqOsuc9.cjs.map} +1 -1
  22. package/dist/{VitestKyselyTransactionIsolator-DceyIqr4.mjs → VitestKyselyTransactionIsolator-CfSMOFlN.mjs} +2 -2
  23. package/dist/{VitestKyselyTransactionIsolator-DceyIqr4.mjs.map → VitestKyselyTransactionIsolator-CfSMOFlN.mjs.map} +1 -1
  24. package/dist/VitestKyselyTransactionIsolator.cjs +2 -2
  25. package/dist/VitestKyselyTransactionIsolator.mjs +2 -2
  26. package/dist/{VitestObjectionTransactionIsolator-CdLRrzNf.cjs → VitestObjectionTransactionIsolator-B5J9jjKq.cjs} +2 -2
  27. package/dist/{VitestObjectionTransactionIsolator-CdLRrzNf.cjs.map → VitestObjectionTransactionIsolator-B5J9jjKq.cjs.map} +1 -1
  28. package/dist/{VitestObjectionTransactionIsolator-OF2osYY5.mjs → VitestObjectionTransactionIsolator-CNo40EdC.mjs} +2 -2
  29. package/dist/{VitestObjectionTransactionIsolator-OF2osYY5.mjs.map → VitestObjectionTransactionIsolator-CNo40EdC.mjs.map} +1 -1
  30. package/dist/VitestObjectionTransactionIsolator.cjs +2 -2
  31. package/dist/VitestObjectionTransactionIsolator.mjs +2 -2
  32. package/dist/VitestTransactionIsolator-BNWJqh9f.d.mts.map +1 -1
  33. package/dist/VitestTransactionIsolator-CSroc7Df.d.cts.map +1 -1
  34. package/dist/{VitestTransactionIsolator-CMfJXZP8.cjs → VitestTransactionIsolator-CtZaOUjH.cjs} +3 -3
  35. package/dist/VitestTransactionIsolator-CtZaOUjH.cjs.map +1 -0
  36. package/dist/{VitestTransactionIsolator-DQ7tLqgV.mjs → VitestTransactionIsolator-D6ZxLWys.mjs} +3 -3
  37. package/dist/VitestTransactionIsolator-D6ZxLWys.mjs.map +1 -0
  38. package/dist/VitestTransactionIsolator.cjs +1 -1
  39. package/dist/VitestTransactionIsolator.mjs +1 -1
  40. package/dist/better-auth.d.cts +2 -2
  41. package/dist/better-auth.d.mts +2 -2
  42. package/dist/{directory-CYXmolu1.d.mts → directory-DAVs0Yaq.d.mts} +3 -3
  43. package/dist/{directory-CYXmolu1.d.mts.map → directory-DAVs0Yaq.d.mts.map} +1 -1
  44. package/dist/{faker-DHh7xs4u.d.mts → faker-Br8MzXil.d.mts} +3 -3
  45. package/dist/{faker-DHh7xs4u.d.mts.map → faker-Br8MzXil.d.mts.map} +1 -1
  46. package/dist/{faker-zVCm31nU.d.cts → faker-Cg76aFNO.d.cts} +3 -3
  47. package/dist/{faker-zVCm31nU.d.cts.map → faker-Cg76aFNO.d.cts.map} +1 -1
  48. package/dist/faker.d.cts +1 -1
  49. package/dist/faker.d.mts +1 -1
  50. package/dist/kysely.cjs +2 -2
  51. package/dist/kysely.d.cts +3 -3
  52. package/dist/kysely.d.mts +3 -3
  53. package/dist/kysely.mjs +2 -2
  54. package/dist/objection.cjs +2 -2
  55. package/dist/objection.d.cts +3 -3
  56. package/dist/objection.d.mts +3 -3
  57. package/dist/objection.mjs +2 -2
  58. package/dist/os/directory.d.mts +1 -1
  59. package/dist/os/index.d.mts +1 -1
  60. package/package.json +85 -35
  61. package/src/VitestTransactionIsolator.ts +4 -2
  62. package/src/__tests__/PostgresMigrator.spec.ts +0 -4
  63. package/dist/VitestTransactionIsolator-CMfJXZP8.cjs.map +0 -1
  64. package/dist/VitestTransactionIsolator-DQ7tLqgV.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @geekmidas/testkit
2
2
 
3
+ ## 1.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 🐛 [`d70c6c0`](https://github.com/geekmidas/toolbox/commit/d70c6c0aeb8a79da2473ac77dbd8255a4a2f5651) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix `package.json` exports so TypeScript declarations resolve correctly under NodeNext/Bundler module resolution. Each subpath export now nests `types` inside its `import`/`require` condition, pointing at the `.d.mts` and `.d.cts` files that `tsdown` actually emits (previously the exports referenced non-existent `.d.ts` files, causing type-resolution failures for consumers). Both ESM (`.mjs`) and CJS (`.cjs`) runtime entry points are preserved. Additionally, `@geekmidas/ui` had `import` paths pointing at `.js` files that were never emitted — those are corrected to `.mjs`.
8
+
9
+ - Updated dependencies [[`d70c6c0`](https://github.com/geekmidas/toolbox/commit/d70c6c0aeb8a79da2473ac77dbd8255a4a2f5651)]:
10
+ - @geekmidas/envkit@1.0.7
11
+ - @geekmidas/logger@1.0.2
12
+
13
+ ## 1.0.6
14
+
15
+ ### Patch Changes
16
+
17
+ - 🐛 [`b8a17e3`](https://github.com/geekmidas/toolbox/commit/b8a17e33de415a5d749297f7840564e824609a92) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix global zod registry and fix this reference on test extensions
18
+
3
19
  ## 1.0.5
4
20
 
5
21
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { FakerFactory } from "./faker-zVCm31nU.cjs";
1
+ import { FakerFactory } from "./faker-Cg76aFNO.cjs";
2
2
 
3
3
  //#region src/Factory.d.ts
4
4
 
@@ -144,4 +144,4 @@ type ExtractSeedAttrs<T> = T extends ((context: {
144
144
  //# sourceMappingURL=Factory.d.ts.map
145
145
  //#endregion
146
146
  export { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder };
147
- //# sourceMappingURL=Factory-CUM2767q.d.cts.map
147
+ //# sourceMappingURL=Factory-BOX312yd.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Factory-CUM2767q.d.cts","names":[],"sources":["../src/Factory.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;;;;;;;;;;;;;;;;;;;;;AAiD6B,uBAjDP,OAiDO,CAAA,iBAhDX,MAgDW,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cA/Cd,MA+Cc,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA;EAAQ;;;;;;;;;;;;;;;;EAavB,OAAA,UAAA,CAAA,aA1CkB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;;;;;;;;;;;;;;;;;;;;;;;;;KA8BT,kFAKA,gBAAgB,aAAa,OAAO,SAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgCrD;SAKW;WAAgB;MAAa;MAAS,QAAQ;;;;;KAMzD,sBAAsB;;;;aAK/B"}
@@ -1,4 +1,4 @@
1
- import { FakerFactory } from "./faker-DHh7xs4u.mjs";
1
+ import { FakerFactory } from "./faker-Br8MzXil.mjs";
2
2
 
3
3
  //#region src/Factory.d.ts
4
4
 
@@ -144,4 +144,4 @@ type ExtractSeedAttrs<T> = T extends ((context: {
144
144
  //# sourceMappingURL=Factory.d.ts.map
145
145
  //#endregion
146
146
  export { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder };
147
- //# sourceMappingURL=Factory-SFupxRC2.d.mts.map
147
+ //# sourceMappingURL=Factory-_w0_BN4J.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Factory-SFupxRC2.d.mts","names":[],"sources":["../src/Factory.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;;;;;;;;;;;;;;;;;;;;;AAiD6B,uBAjDP,OAiDO,CAAA,iBAhDX,MAgDW,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cA/Cd,MA+Cc,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA;EAAQ;;;;;;;;;;;;;;;;EAavB,OAAA,UAAA,CAAA,aA1CkB,WA0ClB,CAAA,CAAA,MAAA,EA1CuC,IA0CvC,CAAA,EA1C8C,IA0C9C;EA8BF;;;;;;EAK0C,SAAW,MAAA,CAAA,UAAA,MApEhC,QAoEgC,CAAA,CAAA,WAAA,EAnElD,CAmEkD,EAAA,KAAA,CAAA,EAlEvD,UAkEuD,CAlE5C,QAkE4C,CAlEnC,CAkEmC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAjE7D,OAiE6D,CAjErD,OAiEqD,CAjE7C,UAiE6C,CAjElC,QAiEkC,CAjEzB,CAiEyB,CA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eedAttrs, Factory, FactorySeed, MixedFactoryBuilder } from "./Factory-BOX312yd.cjs";
3
3
  export { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder };
@@ -1,3 +1,3 @@
1
- import "./faker-DHh7xs4u.mjs";
2
- import { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder } from "./Factory-SFupxRC2.mjs";
1
+ import "./faker-Br8MzXil.mjs";
2
+ import { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder } from "./Factory-_w0_BN4J.mjs";
3
3
  export { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder };
@@ -1,5 +1,5 @@
1
- import { FakerFactory } from "./faker-zVCm31nU.cjs";
2
- import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-CUM2767q.cjs";
1
+ import { FakerFactory } from "./faker-Br8MzXil.mjs";
2
+ import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-_w0_BN4J.mjs";
3
3
  import { ControlledTransaction, Insertable, Kysely, Selectable } from "kysely";
4
4
 
5
5
  //#region src/KyselyFactory.d.ts
@@ -225,4 +225,4 @@ declare class KyselyFactory<DB, Builders extends Record<string, any>, Seeds exte
225
225
  //# sourceMappingURL=KyselyFactory.d.ts.map
226
226
  //#endregion
227
227
  export { KyselyFactory };
228
- //# sourceMappingURL=KyselyFactory-OMwcuAX_.d.cts.map
228
+ //# sourceMappingURL=KyselyFactory-BFxq2hz5.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"KyselyFactory-OMwcuAX_.d.cts","names":[],"sources":["../src/KyselyFactory.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA+CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GK,cA5GQ,aA4GR,CAAA,EAAA,EAAA,iBA1Ga,MA0Gb,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cAzGU,MAyGV,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAxGK,OAwGL,CAxGa,QAw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M"}
@@ -1,5 +1,5 @@
1
- import { FakerFactory } from "./faker-DHh7xs4u.mjs";
2
- import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-SFupxRC2.mjs";
1
+ import { FakerFactory } from "./faker-Cg76aFNO.cjs";
2
+ import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-BOX312yd.cjs";
3
3
  import { ControlledTransaction, Insertable, Kysely, Selectable } from "kysely";
4
4
 
5
5
  //#region src/KyselyFactory.d.ts
@@ -225,4 +225,4 @@ declare class KyselyFactory<DB, Builders extends Record<string, any>, Seeds exte
225
225
  //# sourceMappingURL=KyselyFactory.d.ts.map
226
226
  //#endregion
227
227
  export { KyselyFactory };
228
- //# sourceMappingURL=KyselyFactory-vAxYodck.d.mts.map
228
+ //# sourceMappingURL=KyselyFactory-Dy5zzV4B.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"KyselyFactory-vAxYodck.d.mts","names":[],"sources":["../src/KyselyFactory.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA+CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GK,cA5GQ,aA4GR,CAAA,EAAA,EAAA,iBA1Ga,MA0Gb,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cAzGU,MAyGV,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAxGK,OAwGL,CAxGa,QAwGb,EAxGuB,KAwGvB,CAAA,CAAA;EAAO,QACoB,QAAA;EAAE,QAAC,KAAA;EAAS,QAAvB,EAAA;EAAU;;;;;;;;;;;;;;;;;;;;;EAwJf,OACK,UAAA,CAAA,aA5OoB,WA4OpB,CAAA,CAAA,MAAA,EA5OyC,IA4OzC,CAAA,EA5OgD,IA4OhD;EAAQ;;;;;;;EAClB,WACuB,CAAA,QAAA,EAlOd,QAkOc,EAAA,KAAA,EAjOjB,KAiOiB,EAAA,EAAA,EAhOpB,MAgOoB,CAhOb,EAgOa,CAAA,GAhOP,qBAgOO,CAhOe,EAgOf,EAA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AAQ;;;;;;;EAClB,WACuB,CAAA,QAAA,EAlOd,QAkOc,EAAA,KAAA,EAjOjB,KAiOiB,EAAA,EAAA,EAhOpB,MAgOoB,CAhOb,EAgOa,CAAA,GAhOP,qBAgOO,CAhOe,EAgOf,EAAA,EAAA,CAAA;EAAQ;;;;;;;;;;;;;;;;;;;;;;;AApQzB;;;;;;;;;;;;;;;;;;;;;;;;mDA0FS,2BACV,QAAQ,WAAW,GAAG,eAAe,QAClD,WAAW,GAAG,sCAGN,WAAW,GAAG,oBAEhB;WAEC;aACE;QACL,OAAO;WACJ;QAEL,QAAQ,WAAW,GAAG,eACtB,QAAQ,QAAQ,WAAW,GAAG,8CAG1B,gBACE,aACL,OAAO,YACJ,iBACH,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAuEgB,uBACf,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAqEN,sCAEnB,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;6BACN,sCAEnB,+BAGL,iBACH,WAAW,SAAS,SAAS,QAAQ,WAAW,SAAS,UAC5D,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAsDlB,iBACV,WACF,iBAAiB,MAAM,MAC7B,WAAW,MAAM"}
@@ -1,4 +1,4 @@
1
- import "./faker-zVCm31nU.cjs";
2
- import "./Factory-CUM2767q.cjs";
3
- import { KyselyFactory } from "./KyselyFactory-OMwcuAX_.cjs";
1
+ import "./faker-Cg76aFNO.cjs";
2
+ import "./Factory-BOX312yd.cjs";
3
+ import { KyselyFactory } from "./KyselyFactory-Dy5zzV4B.cjs";
4
4
  export { KyselyFactory };
@@ -1,4 +1,4 @@
1
- import "./faker-DHh7xs4u.mjs";
2
- import "./Factory-SFupxRC2.mjs";
3
- import { KyselyFactory } from "./KyselyFactory-vAxYodck.mjs";
1
+ import "./faker-Br8MzXil.mjs";
2
+ import "./Factory-_w0_BN4J.mjs";
3
+ import { KyselyFactory } from "./KyselyFactory-BFxq2hz5.mjs";
4
4
  export { KyselyFactory };
@@ -1,5 +1,5 @@
1
- import { FakerFactory } from "./faker-DHh7xs4u.mjs";
2
- import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-SFupxRC2.mjs";
1
+ import { FakerFactory } from "./faker-Br8MzXil.mjs";
2
+ import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-_w0_BN4J.mjs";
3
3
  import { Knex } from "knex";
4
4
  import { Model } from "objection";
5
5
 
@@ -238,4 +238,4 @@ declare class ObjectionFactory<Builders extends Record<string, any>, Seeds exten
238
238
  //# sourceMappingURL=ObjectionFactory.d.ts.map
239
239
  //#endregion
240
240
  export { ObjectionFactory };
241
- //# sourceMappingURL=ObjectionFactory-BWjB49-i.d.mts.map
241
+ //# sourceMappingURL=ObjectionFactory-C4IsQ_wj.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectionFactory-BWjB49-i.d.mts","names":[],"sources":["../src/ObjectionFactory.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAyCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0Gc,cA1GD,gBA0GC,CAAA,iBAzGI,MAyGJ,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cAxGC,MAwGD,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAvGJ,OAuGI,CAvGI,QAuGJ,EAvGc,KAuGd,CAAA,CAAA;EAAM,QAAd,QAAA;EAAO,QAqDO,KAAA;EAAQ,QACX,EAAA;EAAK;;;;;;;;;;;;;;;;;;;;;EA2GX,OACuB,UAAA,CAAA,aAnPO,WAmPP,CAAA,CAAA,MAAA,EAnP4B,IAmP5B,CAAA,EAnPmC,IAmPnC;EAAQ;;;;;;;;;;;;;;;;;;;AAzQzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAmFO,qBACR,QAAQ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WAEJ;aACE;QACL;WACG;QAEL,QAAQ,aAAa,WACrB,QAAQ,QAAQ,aAAa,0CAGzB,gBACE,aACL,aACG,iBACH,QAAQ;;;;;;;;wBAqDM,iBACH,WACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAoCgB,uBACf,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA+DN,sCAEnB,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;6BACN,sCAEnB,+BACe,iBAAiB,WAAW,SAAS,SAC/D,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAgFlB,iBACV,WACF,iBAAiB,MAAM,MAC7B,WAAW,MAAM"}
@@ -1,5 +1,5 @@
1
- import { FakerFactory } from "./faker-zVCm31nU.cjs";
2
- import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-CUM2767q.cjs";
1
+ import { FakerFactory } from "./faker-Cg76aFNO.cjs";
2
+ import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-BOX312yd.cjs";
3
3
  import { Knex } from "knex";
4
4
  import { Model } from "objection";
5
5
 
@@ -238,4 +238,4 @@ declare class ObjectionFactory<Builders extends Record<string, any>, Seeds exten
238
238
  //# sourceMappingURL=ObjectionFactory.d.ts.map
239
239
  //#endregion
240
240
  export { ObjectionFactory };
241
- //# sourceMappingURL=ObjectionFactory-DvmZVHhe.d.cts.map
241
+ //# sourceMappingURL=ObjectionFactory-CD-WFuMJ.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectionFactory-DvmZVHhe.d.cts","names":[],"sources":["../src/ObjectionFactory.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAyCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0Gc,cA1GD,gBA0GC,CAAA,iBAzGI,MAyGJ,CAAA,MAAA,EAAA,GAAA,CAAA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AA,CAAA,SAvGJ,OAuGI,CAvGI,QAuGJ,EAvGc,KAuGd,CAAA,CAAA;EAAM,QAAd,QAAA;EAAO,QAqDO,KAAA;EAAQ,QACX,EAAA;EAAK;;;;;;;;;;;;;;;;;;;;;EA2GX,OACuB,UAAA,CAAA,aAnPO,WAmPP,CAAA,CAAA,MAAA,EAnP4B,IAmP5B,CAAA,EAnPmC,IAmPnC;EAAQ;;;;;;;;;;;;;;;;;;;AAzQzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAmFO,qBACR,QAAQ,aAAa,WAAW,QAAQ,aAAa,kCAE1D,aAAa,qBAEV;WAEJ;aACE;QACL;WACG;QAEL,QAAQ,aAAa,WACrB,QAAQ,QAAQ,aAAa,0CAGzB,gBACE,aACL,aACG,iBACH,QAAQ;;;;;;;;wBAqDM,iBACH,WACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAoCgB,uBACf,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA+DN,sCAEnB,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;6BACN,sCAEnB,+BACe,iBAAiB,WAAW,SAAS,SAC/D,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAgFlB,iBACV,WACF,iBAAiB,MAAM,MAC7B,WAAW,MAAM"}
@@ -1,4 +1,4 @@
1
- import "./faker-zVCm31nU.cjs";
2
- import "./Factory-CUM2767q.cjs";
3
- import { ObjectionFactory } from "./ObjectionFactory-DvmZVHhe.cjs";
1
+ import "./faker-Cg76aFNO.cjs";
2
+ import "./Factory-BOX312yd.cjs";
3
+ import { ObjectionFactory } from "./ObjectionFactory-CD-WFuMJ.cjs";
4
4
  export { ObjectionFactory };
@@ -1,4 +1,4 @@
1
- import "./faker-DHh7xs4u.mjs";
2
- import "./Factory-SFupxRC2.mjs";
3
- import { ObjectionFactory } from "./ObjectionFactory-BWjB49-i.mjs";
1
+ import "./faker-Br8MzXil.mjs";
2
+ import "./Factory-_w0_BN4J.mjs";
3
+ import { ObjectionFactory } from "./ObjectionFactory-C4IsQ_wj.mjs";
4
4
  export { ObjectionFactory };
@@ -1,4 +1,4 @@
1
- const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-CMfJXZP8.cjs');
1
+ const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-CtZaOUjH.cjs');
2
2
 
3
3
  //#region src/VitestKyselyTransactionIsolator.ts
4
4
  /**
@@ -62,4 +62,4 @@ Object.defineProperty(exports, 'VitestKyselyTransactionIsolator', {
62
62
  return VitestKyselyTransactionIsolator;
63
63
  }
64
64
  });
65
- //# sourceMappingURL=VitestKyselyTransactionIsolator-D7RRXOBa.cjs.map
65
+ //# sourceMappingURL=VitestKyselyTransactionIsolator-0CqOsuc9.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"VitestKyselyTransactionIsolator-D7RRXOBa.cjs","names":["VitestPostgresTransactionIsolator","_conn: Kysely<Database>","conn: Kysely<Database>","level: IsolationLevel","fn: (trx: Transaction<Database>) => Promise<void>"],"sources":["../src/VitestKyselyTransactionIsolator.ts"],"sourcesContent":["import type { Kysely, Transaction } from 'kysely';\nimport {\n\ttype IsolationLevel,\n\tVitestPostgresTransactionIsolator,\n} from './VitestTransactionIsolator';\n\n/**\n * Kysely-specific implementation of the Vitest transaction isolator.\n * Provides automatic transaction rollback for test isolation using Kysely's transaction API.\n * Each test runs within a database transaction that is rolled back after completion,\n * ensuring a clean state between tests without the overhead of recreating data.\n *\n * @template Database - The database schema type\n *\n * @example\n * ```typescript\n * import { VitestKyselyTransactionIsolator } from '@geekmidas/testkit';\n * import { db } from './database';\n *\n * // Create isolator instance\n * const isolator = new VitestKyselyTransactionIsolator<Database>();\n *\n * // In your test setup\n * beforeEach(async () => {\n * await isolator.start(db);\n * });\n *\n * afterEach(async () => {\n * await isolator.rollback();\n * });\n *\n * // Tests run in isolated transactions\n * it('should create user', async () => {\n * const user = await db.insertInto('users')\n * .values({ name: 'Test User' })\n * .returningAll()\n * .executeTakeFirst();\n *\n * expect(user).toBeDefined();\n * // This data will be rolled back after the test\n * });\n * ```\n */\nexport class VitestKyselyTransactionIsolator<\n\tDatabase,\n> extends VitestPostgresTransactionIsolator<\n\tKysely<Database>,\n\tTransaction<Database>\n> {\n\tasync destroy(_conn: Kysely<Database>): Promise<void> {\n\t\t// return conn.destroy();\n\t}\n\t/**\n\t * Creates a Kysely transaction with the specified isolation level.\n\t * Implements the abstract transact method from VitestPostgresTransactionIsolator.\n\t *\n\t * @param conn - The Kysely database connection\n\t * @param level - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t */\n\tasync transact(\n\t\tconn: Kysely<Database>,\n\t\tlevel: IsolationLevel,\n\t\tfn: (trx: Transaction<Database>) => Promise<void>,\n\t): Promise<void> {\n\t\tconst isolationLevel =\n\t\t\tlevel.toLocaleLowerCase() as Lowercase<IsolationLevel>;\n\t\tawait conn.transaction().setIsolationLevel(isolationLevel).execute(fn);\n\t}\n\t// Implement any Kysely-specific transaction logic here\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAa,kCAAb,cAEUA,oEAGR;CACD,MAAM,QAAQC,OAAwC,CAErD;;;;;;;;;;CAUD,MAAM,SACLC,MACAC,OACAC,IACgB;EAChB,MAAM,iBACL,MAAM,mBAAmB;AAC1B,QAAM,KAAK,aAAa,CAAC,kBAAkB,eAAe,CAAC,QAAQ,GAAG;CACtE;AAED"}
1
+ {"version":3,"file":"VitestKyselyTransactionIsolator-0CqOsuc9.cjs","names":["VitestPostgresTransactionIsolator","_conn: Kysely<Database>","conn: Kysely<Database>","level: IsolationLevel","fn: (trx: Transaction<Database>) => Promise<void>"],"sources":["../src/VitestKyselyTransactionIsolator.ts"],"sourcesContent":["import type { Kysely, Transaction } from 'kysely';\nimport {\n\ttype IsolationLevel,\n\tVitestPostgresTransactionIsolator,\n} from './VitestTransactionIsolator';\n\n/**\n * Kysely-specific implementation of the Vitest transaction isolator.\n * Provides automatic transaction rollback for test isolation using Kysely's transaction API.\n * Each test runs within a database transaction that is rolled back after completion,\n * ensuring a clean state between tests without the overhead of recreating data.\n *\n * @template Database - The database schema type\n *\n * @example\n * ```typescript\n * import { VitestKyselyTransactionIsolator } from '@geekmidas/testkit';\n * import { db } from './database';\n *\n * // Create isolator instance\n * const isolator = new VitestKyselyTransactionIsolator<Database>();\n *\n * // In your test setup\n * beforeEach(async () => {\n * await isolator.start(db);\n * });\n *\n * afterEach(async () => {\n * await isolator.rollback();\n * });\n *\n * // Tests run in isolated transactions\n * it('should create user', async () => {\n * const user = await db.insertInto('users')\n * .values({ name: 'Test User' })\n * .returningAll()\n * .executeTakeFirst();\n *\n * expect(user).toBeDefined();\n * // This data will be rolled back after the test\n * });\n * ```\n */\nexport class VitestKyselyTransactionIsolator<\n\tDatabase,\n> extends VitestPostgresTransactionIsolator<\n\tKysely<Database>,\n\tTransaction<Database>\n> {\n\tasync destroy(_conn: Kysely<Database>): Promise<void> {\n\t\t// return conn.destroy();\n\t}\n\t/**\n\t * Creates a Kysely transaction with the specified isolation level.\n\t * Implements the abstract transact method from VitestPostgresTransactionIsolator.\n\t *\n\t * @param conn - The Kysely database connection\n\t * @param level - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t */\n\tasync transact(\n\t\tconn: Kysely<Database>,\n\t\tlevel: IsolationLevel,\n\t\tfn: (trx: Transaction<Database>) => Promise<void>,\n\t): Promise<void> {\n\t\tconst isolationLevel =\n\t\t\tlevel.toLocaleLowerCase() as Lowercase<IsolationLevel>;\n\t\tawait conn.transaction().setIsolationLevel(isolationLevel).execute(fn);\n\t}\n\t// Implement any Kysely-specific transaction logic here\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAa,kCAAb,cAEUA,oEAGR;CACD,MAAM,QAAQC,OAAwC,CAErD;;;;;;;;;;CAUD,MAAM,SACLC,MACAC,OACAC,IACgB;EAChB,MAAM,iBACL,MAAM,mBAAmB;AAC1B,QAAM,KAAK,aAAa,CAAC,kBAAkB,eAAe,CAAC,QAAQ,GAAG;CACtE;AAED"}
@@ -1,4 +1,4 @@
1
- import { VitestPostgresTransactionIsolator } from "./VitestTransactionIsolator-DQ7tLqgV.mjs";
1
+ import { VitestPostgresTransactionIsolator } from "./VitestTransactionIsolator-D6ZxLWys.mjs";
2
2
 
3
3
  //#region src/VitestKyselyTransactionIsolator.ts
4
4
  /**
@@ -57,4 +57,4 @@ var VitestKyselyTransactionIsolator = class extends VitestPostgresTransactionIso
57
57
 
58
58
  //#endregion
59
59
  export { VitestKyselyTransactionIsolator };
60
- //# sourceMappingURL=VitestKyselyTransactionIsolator-DceyIqr4.mjs.map
60
+ //# sourceMappingURL=VitestKyselyTransactionIsolator-CfSMOFlN.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"VitestKyselyTransactionIsolator-DceyIqr4.mjs","names":["_conn: Kysely<Database>","conn: Kysely<Database>","level: IsolationLevel","fn: (trx: Transaction<Database>) => Promise<void>"],"sources":["../src/VitestKyselyTransactionIsolator.ts"],"sourcesContent":["import type { Kysely, Transaction } from 'kysely';\nimport {\n\ttype IsolationLevel,\n\tVitestPostgresTransactionIsolator,\n} from './VitestTransactionIsolator';\n\n/**\n * Kysely-specific implementation of the Vitest transaction isolator.\n * Provides automatic transaction rollback for test isolation using Kysely's transaction API.\n * Each test runs within a database transaction that is rolled back after completion,\n * ensuring a clean state between tests without the overhead of recreating data.\n *\n * @template Database - The database schema type\n *\n * @example\n * ```typescript\n * import { VitestKyselyTransactionIsolator } from '@geekmidas/testkit';\n * import { db } from './database';\n *\n * // Create isolator instance\n * const isolator = new VitestKyselyTransactionIsolator<Database>();\n *\n * // In your test setup\n * beforeEach(async () => {\n * await isolator.start(db);\n * });\n *\n * afterEach(async () => {\n * await isolator.rollback();\n * });\n *\n * // Tests run in isolated transactions\n * it('should create user', async () => {\n * const user = await db.insertInto('users')\n * .values({ name: 'Test User' })\n * .returningAll()\n * .executeTakeFirst();\n *\n * expect(user).toBeDefined();\n * // This data will be rolled back after the test\n * });\n * ```\n */\nexport class VitestKyselyTransactionIsolator<\n\tDatabase,\n> extends VitestPostgresTransactionIsolator<\n\tKysely<Database>,\n\tTransaction<Database>\n> {\n\tasync destroy(_conn: Kysely<Database>): Promise<void> {\n\t\t// return conn.destroy();\n\t}\n\t/**\n\t * Creates a Kysely transaction with the specified isolation level.\n\t * Implements the abstract transact method from VitestPostgresTransactionIsolator.\n\t *\n\t * @param conn - The Kysely database connection\n\t * @param level - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t */\n\tasync transact(\n\t\tconn: Kysely<Database>,\n\t\tlevel: IsolationLevel,\n\t\tfn: (trx: Transaction<Database>) => Promise<void>,\n\t): Promise<void> {\n\t\tconst isolationLevel =\n\t\t\tlevel.toLocaleLowerCase() as Lowercase<IsolationLevel>;\n\t\tawait conn.transaction().setIsolationLevel(isolationLevel).execute(fn);\n\t}\n\t// Implement any Kysely-specific transaction logic here\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAa,kCAAb,cAEU,kCAGR;CACD,MAAM,QAAQA,OAAwC,CAErD;;;;;;;;;;CAUD,MAAM,SACLC,MACAC,OACAC,IACgB;EAChB,MAAM,iBACL,MAAM,mBAAmB;AAC1B,QAAM,KAAK,aAAa,CAAC,kBAAkB,eAAe,CAAC,QAAQ,GAAG;CACtE;AAED"}
1
+ {"version":3,"file":"VitestKyselyTransactionIsolator-CfSMOFlN.mjs","names":["_conn: Kysely<Database>","conn: Kysely<Database>","level: IsolationLevel","fn: (trx: Transaction<Database>) => Promise<void>"],"sources":["../src/VitestKyselyTransactionIsolator.ts"],"sourcesContent":["import type { Kysely, Transaction } from 'kysely';\nimport {\n\ttype IsolationLevel,\n\tVitestPostgresTransactionIsolator,\n} from './VitestTransactionIsolator';\n\n/**\n * Kysely-specific implementation of the Vitest transaction isolator.\n * Provides automatic transaction rollback for test isolation using Kysely's transaction API.\n * Each test runs within a database transaction that is rolled back after completion,\n * ensuring a clean state between tests without the overhead of recreating data.\n *\n * @template Database - The database schema type\n *\n * @example\n * ```typescript\n * import { VitestKyselyTransactionIsolator } from '@geekmidas/testkit';\n * import { db } from './database';\n *\n * // Create isolator instance\n * const isolator = new VitestKyselyTransactionIsolator<Database>();\n *\n * // In your test setup\n * beforeEach(async () => {\n * await isolator.start(db);\n * });\n *\n * afterEach(async () => {\n * await isolator.rollback();\n * });\n *\n * // Tests run in isolated transactions\n * it('should create user', async () => {\n * const user = await db.insertInto('users')\n * .values({ name: 'Test User' })\n * .returningAll()\n * .executeTakeFirst();\n *\n * expect(user).toBeDefined();\n * // This data will be rolled back after the test\n * });\n * ```\n */\nexport class VitestKyselyTransactionIsolator<\n\tDatabase,\n> extends VitestPostgresTransactionIsolator<\n\tKysely<Database>,\n\tTransaction<Database>\n> {\n\tasync destroy(_conn: Kysely<Database>): Promise<void> {\n\t\t// return conn.destroy();\n\t}\n\t/**\n\t * Creates a Kysely transaction with the specified isolation level.\n\t * Implements the abstract transact method from VitestPostgresTransactionIsolator.\n\t *\n\t * @param conn - The Kysely database connection\n\t * @param level - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t */\n\tasync transact(\n\t\tconn: Kysely<Database>,\n\t\tlevel: IsolationLevel,\n\t\tfn: (trx: Transaction<Database>) => Promise<void>,\n\t): Promise<void> {\n\t\tconst isolationLevel =\n\t\t\tlevel.toLocaleLowerCase() as Lowercase<IsolationLevel>;\n\t\tawait conn.transaction().setIsolationLevel(isolationLevel).execute(fn);\n\t}\n\t// Implement any Kysely-specific transaction logic here\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAa,kCAAb,cAEU,kCAGR;CACD,MAAM,QAAQA,OAAwC,CAErD;;;;;;;;;;CAUD,MAAM,SACLC,MACAC,OACAC,IACgB;EAChB,MAAM,iBACL,MAAM,mBAAmB;AAC1B,QAAM,KAAK,aAAa,CAAC,kBAAkB,eAAe,CAAC,QAAQ,GAAG;CACtE;AAED"}
@@ -1,4 +1,4 @@
1
- require('./VitestTransactionIsolator-CMfJXZP8.cjs');
2
- const require_VitestKyselyTransactionIsolator = require('./VitestKyselyTransactionIsolator-D7RRXOBa.cjs');
1
+ require('./VitestTransactionIsolator-CtZaOUjH.cjs');
2
+ const require_VitestKyselyTransactionIsolator = require('./VitestKyselyTransactionIsolator-0CqOsuc9.cjs');
3
3
 
4
4
  exports.VitestKyselyTransactionIsolator = require_VitestKyselyTransactionIsolator.VitestKyselyTransactionIsolator;
@@ -1,4 +1,4 @@
1
- import "./VitestTransactionIsolator-DQ7tLqgV.mjs";
2
- import { VitestKyselyTransactionIsolator } from "./VitestKyselyTransactionIsolator-DceyIqr4.mjs";
1
+ import "./VitestTransactionIsolator-D6ZxLWys.mjs";
2
+ import { VitestKyselyTransactionIsolator } from "./VitestKyselyTransactionIsolator-CfSMOFlN.mjs";
3
3
 
4
4
  export { VitestKyselyTransactionIsolator };
@@ -1,4 +1,4 @@
1
- const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-CMfJXZP8.cjs');
1
+ const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-CtZaOUjH.cjs');
2
2
 
3
3
  //#region src/VitestObjectionTransactionIsolator.ts
4
4
  /**
@@ -65,4 +65,4 @@ Object.defineProperty(exports, 'VitestObjectionTransactionIsolator', {
65
65
  return VitestObjectionTransactionIsolator;
66
66
  }
67
67
  });
68
- //# sourceMappingURL=VitestObjectionTransactionIsolator-CdLRrzNf.cjs.map
68
+ //# sourceMappingURL=VitestObjectionTransactionIsolator-B5J9jjKq.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"VitestObjectionTransactionIsolator-CdLRrzNf.cjs","names":["VitestPostgresTransactionIsolator","_conn: Knex<any, any[]>","connection: Knex","level: IsolationLevel","fn: (trx: Knex.Transaction) => Promise<void>"],"sources":["../src/VitestObjectionTransactionIsolator.ts"],"sourcesContent":["import type { Knex } from 'knex';\nimport {\n\ttype IsolationLevel,\n\tVitestPostgresTransactionIsolator,\n} from './VitestTransactionIsolator';\n\n/**\n * Objection.js-specific implementation of the Vitest transaction isolator.\n * Provides automatic transaction rollback for test isolation using Objection.js and Knex transaction API.\n * Each test runs within a database transaction that is rolled back after completion,\n * ensuring a clean state between tests without the overhead of recreating data.\n *\n * @example\n * ```typescript\n * import { VitestObjectionTransactionIsolator } from '@geekmidas/testkit';\n * import { knex } from './database';\n * import { User } from './models';\n * import { test } from 'vitest';\n *\n * // Create isolator instance\n * const isolator = new VitestObjectionTransactionIsolator(test);\n *\n * // Use with wrapped test API\n * const isolatedTest = isolator.wrapVitestWithTransaction(knex);\n *\n * isolatedTest('should create user', async ({ trx }) => {\n * const user = await User.query(trx)\n * .insert({ name: 'Test User' });\n *\n * expect(user).toBeDefined();\n * // This data will be rolled back after the test\n * });\n * ```\n */\nexport class VitestObjectionTransactionIsolator extends VitestPostgresTransactionIsolator<\n\tKnex,\n\tKnex.Transaction\n> {\n\tasync destroy(_conn: Knex<any, any[]>): Promise<void> {}\n\t/**\n\t * Creates a Knex transaction with the specified isolation level.\n\t * Implements the abstract transact method from VitestPostgresTransactionIsolator.\n\t * This transaction can be used with Objection.js models via Model.query(trx).\n\t *\n\t * @param conn - The Knex database connection\n\t * @param level - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t *\n\t * @example\n\t * ```typescript\n\t * await isolator.transact(knex, IsolationLevel.REPEATABLE_READ, async (trx) => {\n\t * // Use transaction with Objection models\n\t * await User.query(trx).insert({ name: 'Test' });\n\t * await Post.query(trx).where('userId', user.id).delete();\n\t * });\n\t * ```\n\t */\n\tasync transact(\n\t\tconnection: Knex,\n\t\tlevel: IsolationLevel,\n\t\tfn: (trx: Knex.Transaction) => Promise<void>,\n\t): Promise<void> {\n\t\tconst isolationLevel = level.toLowerCase() as Lowercase<IsolationLevel>;\n\n\t\tawait connection.transaction(\n\t\t\tasync (trx) => {\n\t\t\t\tawait fn(trx);\n\t\t\t},\n\t\t\t{\n\t\t\t\tisolationLevel,\n\t\t\t},\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,qCAAb,cAAwDA,oEAGtD;CACD,MAAM,QAAQC,OAAwC,CAAE;;;;;;;;;;;;;;;;;;;;CAoBxD,MAAM,SACLC,YACAC,OACAC,IACgB;EAChB,MAAM,iBAAiB,MAAM,aAAa;AAE1C,QAAM,WAAW,YAChB,OAAO,QAAQ;AACd,SAAM,GAAG,IAAI;EACb,GACD,EACC,eACA,EACD;CACD;AACD"}
1
+ {"version":3,"file":"VitestObjectionTransactionIsolator-B5J9jjKq.cjs","names":["VitestPostgresTransactionIsolator","_conn: Knex<any, any[]>","connection: Knex","level: IsolationLevel","fn: (trx: Knex.Transaction) => Promise<void>"],"sources":["../src/VitestObjectionTransactionIsolator.ts"],"sourcesContent":["import type { Knex } from 'knex';\nimport {\n\ttype IsolationLevel,\n\tVitestPostgresTransactionIsolator,\n} from './VitestTransactionIsolator';\n\n/**\n * Objection.js-specific implementation of the Vitest transaction isolator.\n * Provides automatic transaction rollback for test isolation using Objection.js and Knex transaction API.\n * Each test runs within a database transaction that is rolled back after completion,\n * ensuring a clean state between tests without the overhead of recreating data.\n *\n * @example\n * ```typescript\n * import { VitestObjectionTransactionIsolator } from '@geekmidas/testkit';\n * import { knex } from './database';\n * import { User } from './models';\n * import { test } from 'vitest';\n *\n * // Create isolator instance\n * const isolator = new VitestObjectionTransactionIsolator(test);\n *\n * // Use with wrapped test API\n * const isolatedTest = isolator.wrapVitestWithTransaction(knex);\n *\n * isolatedTest('should create user', async ({ trx }) => {\n * const user = await User.query(trx)\n * .insert({ name: 'Test User' });\n *\n * expect(user).toBeDefined();\n * // This data will be rolled back after the test\n * });\n * ```\n */\nexport class VitestObjectionTransactionIsolator extends VitestPostgresTransactionIsolator<\n\tKnex,\n\tKnex.Transaction\n> {\n\tasync destroy(_conn: Knex<any, any[]>): Promise<void> {}\n\t/**\n\t * Creates a Knex transaction with the specified isolation level.\n\t * Implements the abstract transact method from VitestPostgresTransactionIsolator.\n\t * This transaction can be used with Objection.js models via Model.query(trx).\n\t *\n\t * @param conn - The Knex database connection\n\t * @param level - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t *\n\t * @example\n\t * ```typescript\n\t * await isolator.transact(knex, IsolationLevel.REPEATABLE_READ, async (trx) => {\n\t * // Use transaction with Objection models\n\t * await User.query(trx).insert({ name: 'Test' });\n\t * await Post.query(trx).where('userId', user.id).delete();\n\t * });\n\t * ```\n\t */\n\tasync transact(\n\t\tconnection: Knex,\n\t\tlevel: IsolationLevel,\n\t\tfn: (trx: Knex.Transaction) => Promise<void>,\n\t): Promise<void> {\n\t\tconst isolationLevel = level.toLowerCase() as Lowercase<IsolationLevel>;\n\n\t\tawait connection.transaction(\n\t\t\tasync (trx) => {\n\t\t\t\tawait fn(trx);\n\t\t\t},\n\t\t\t{\n\t\t\t\tisolationLevel,\n\t\t\t},\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,qCAAb,cAAwDA,oEAGtD;CACD,MAAM,QAAQC,OAAwC,CAAE;;;;;;;;;;;;;;;;;;;;CAoBxD,MAAM,SACLC,YACAC,OACAC,IACgB;EAChB,MAAM,iBAAiB,MAAM,aAAa;AAE1C,QAAM,WAAW,YAChB,OAAO,QAAQ;AACd,SAAM,GAAG,IAAI;EACb,GACD,EACC,eACA,EACD;CACD;AACD"}
@@ -1,4 +1,4 @@
1
- import { VitestPostgresTransactionIsolator } from "./VitestTransactionIsolator-DQ7tLqgV.mjs";
1
+ import { VitestPostgresTransactionIsolator } from "./VitestTransactionIsolator-D6ZxLWys.mjs";
2
2
 
3
3
  //#region src/VitestObjectionTransactionIsolator.ts
4
4
  /**
@@ -60,4 +60,4 @@ var VitestObjectionTransactionIsolator = class extends VitestPostgresTransaction
60
60
 
61
61
  //#endregion
62
62
  export { VitestObjectionTransactionIsolator };
63
- //# sourceMappingURL=VitestObjectionTransactionIsolator-OF2osYY5.mjs.map
63
+ //# sourceMappingURL=VitestObjectionTransactionIsolator-CNo40EdC.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"VitestObjectionTransactionIsolator-OF2osYY5.mjs","names":["_conn: Knex<any, any[]>","connection: Knex","level: IsolationLevel","fn: (trx: Knex.Transaction) => Promise<void>"],"sources":["../src/VitestObjectionTransactionIsolator.ts"],"sourcesContent":["import type { Knex } from 'knex';\nimport {\n\ttype IsolationLevel,\n\tVitestPostgresTransactionIsolator,\n} from './VitestTransactionIsolator';\n\n/**\n * Objection.js-specific implementation of the Vitest transaction isolator.\n * Provides automatic transaction rollback for test isolation using Objection.js and Knex transaction API.\n * Each test runs within a database transaction that is rolled back after completion,\n * ensuring a clean state between tests without the overhead of recreating data.\n *\n * @example\n * ```typescript\n * import { VitestObjectionTransactionIsolator } from '@geekmidas/testkit';\n * import { knex } from './database';\n * import { User } from './models';\n * import { test } from 'vitest';\n *\n * // Create isolator instance\n * const isolator = new VitestObjectionTransactionIsolator(test);\n *\n * // Use with wrapped test API\n * const isolatedTest = isolator.wrapVitestWithTransaction(knex);\n *\n * isolatedTest('should create user', async ({ trx }) => {\n * const user = await User.query(trx)\n * .insert({ name: 'Test User' });\n *\n * expect(user).toBeDefined();\n * // This data will be rolled back after the test\n * });\n * ```\n */\nexport class VitestObjectionTransactionIsolator extends VitestPostgresTransactionIsolator<\n\tKnex,\n\tKnex.Transaction\n> {\n\tasync destroy(_conn: Knex<any, any[]>): Promise<void> {}\n\t/**\n\t * Creates a Knex transaction with the specified isolation level.\n\t * Implements the abstract transact method from VitestPostgresTransactionIsolator.\n\t * This transaction can be used with Objection.js models via Model.query(trx).\n\t *\n\t * @param conn - The Knex database connection\n\t * @param level - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t *\n\t * @example\n\t * ```typescript\n\t * await isolator.transact(knex, IsolationLevel.REPEATABLE_READ, async (trx) => {\n\t * // Use transaction with Objection models\n\t * await User.query(trx).insert({ name: 'Test' });\n\t * await Post.query(trx).where('userId', user.id).delete();\n\t * });\n\t * ```\n\t */\n\tasync transact(\n\t\tconnection: Knex,\n\t\tlevel: IsolationLevel,\n\t\tfn: (trx: Knex.Transaction) => Promise<void>,\n\t): Promise<void> {\n\t\tconst isolationLevel = level.toLowerCase() as Lowercase<IsolationLevel>;\n\n\t\tawait connection.transaction(\n\t\t\tasync (trx) => {\n\t\t\t\tawait fn(trx);\n\t\t\t},\n\t\t\t{\n\t\t\t\tisolationLevel,\n\t\t\t},\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,qCAAb,cAAwD,kCAGtD;CACD,MAAM,QAAQA,OAAwC,CAAE;;;;;;;;;;;;;;;;;;;;CAoBxD,MAAM,SACLC,YACAC,OACAC,IACgB;EAChB,MAAM,iBAAiB,MAAM,aAAa;AAE1C,QAAM,WAAW,YAChB,OAAO,QAAQ;AACd,SAAM,GAAG,IAAI;EACb,GACD,EACC,eACA,EACD;CACD;AACD"}
1
+ {"version":3,"file":"VitestObjectionTransactionIsolator-CNo40EdC.mjs","names":["_conn: Knex<any, any[]>","connection: Knex","level: IsolationLevel","fn: (trx: Knex.Transaction) => Promise<void>"],"sources":["../src/VitestObjectionTransactionIsolator.ts"],"sourcesContent":["import type { Knex } from 'knex';\nimport {\n\ttype IsolationLevel,\n\tVitestPostgresTransactionIsolator,\n} from './VitestTransactionIsolator';\n\n/**\n * Objection.js-specific implementation of the Vitest transaction isolator.\n * Provides automatic transaction rollback for test isolation using Objection.js and Knex transaction API.\n * Each test runs within a database transaction that is rolled back after completion,\n * ensuring a clean state between tests without the overhead of recreating data.\n *\n * @example\n * ```typescript\n * import { VitestObjectionTransactionIsolator } from '@geekmidas/testkit';\n * import { knex } from './database';\n * import { User } from './models';\n * import { test } from 'vitest';\n *\n * // Create isolator instance\n * const isolator = new VitestObjectionTransactionIsolator(test);\n *\n * // Use with wrapped test API\n * const isolatedTest = isolator.wrapVitestWithTransaction(knex);\n *\n * isolatedTest('should create user', async ({ trx }) => {\n * const user = await User.query(trx)\n * .insert({ name: 'Test User' });\n *\n * expect(user).toBeDefined();\n * // This data will be rolled back after the test\n * });\n * ```\n */\nexport class VitestObjectionTransactionIsolator extends VitestPostgresTransactionIsolator<\n\tKnex,\n\tKnex.Transaction\n> {\n\tasync destroy(_conn: Knex<any, any[]>): Promise<void> {}\n\t/**\n\t * Creates a Knex transaction with the specified isolation level.\n\t * Implements the abstract transact method from VitestPostgresTransactionIsolator.\n\t * This transaction can be used with Objection.js models via Model.query(trx).\n\t *\n\t * @param conn - The Knex database connection\n\t * @param level - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t *\n\t * @example\n\t * ```typescript\n\t * await isolator.transact(knex, IsolationLevel.REPEATABLE_READ, async (trx) => {\n\t * // Use transaction with Objection models\n\t * await User.query(trx).insert({ name: 'Test' });\n\t * await Post.query(trx).where('userId', user.id).delete();\n\t * });\n\t * ```\n\t */\n\tasync transact(\n\t\tconnection: Knex,\n\t\tlevel: IsolationLevel,\n\t\tfn: (trx: Knex.Transaction) => Promise<void>,\n\t): Promise<void> {\n\t\tconst isolationLevel = level.toLowerCase() as Lowercase<IsolationLevel>;\n\n\t\tawait connection.transaction(\n\t\t\tasync (trx) => {\n\t\t\t\tawait fn(trx);\n\t\t\t},\n\t\t\t{\n\t\t\t\tisolationLevel,\n\t\t\t},\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,qCAAb,cAAwD,kCAGtD;CACD,MAAM,QAAQA,OAAwC,CAAE;;;;;;;;;;;;;;;;;;;;CAoBxD,MAAM,SACLC,YACAC,OACAC,IACgB;EAChB,MAAM,iBAAiB,MAAM,aAAa;AAE1C,QAAM,WAAW,YAChB,OAAO,QAAQ;AACd,SAAM,GAAG,IAAI;EACb,GACD,EACC,eACA,EACD;CACD;AACD"}
@@ -1,4 +1,4 @@
1
- require('./VitestTransactionIsolator-CMfJXZP8.cjs');
2
- const require_VitestObjectionTransactionIsolator = require('./VitestObjectionTransactionIsolator-CdLRrzNf.cjs');
1
+ require('./VitestTransactionIsolator-CtZaOUjH.cjs');
2
+ const require_VitestObjectionTransactionIsolator = require('./VitestObjectionTransactionIsolator-B5J9jjKq.cjs');
3
3
 
4
4
  exports.VitestObjectionTransactionIsolator = require_VitestObjectionTransactionIsolator.VitestObjectionTransactionIsolator;
@@ -1,4 +1,4 @@
1
- import "./VitestTransactionIsolator-DQ7tLqgV.mjs";
2
- import { VitestObjectionTransactionIsolator } from "./VitestObjectionTransactionIsolator-OF2osYY5.mjs";
1
+ import "./VitestTransactionIsolator-D6ZxLWys.mjs";
2
+ import { VitestObjectionTransactionIsolator } from "./VitestObjectionTransactionIsolator-CNo40EdC.mjs";
3
3
 
4
4
  export { VitestObjectionTransactionIsolator };
@@ -1 +1 @@
1
- {"version":3,"file":"VitestTransactionIsolator-BNWJqh9f.d.mts","names":[],"sources":["../src/VitestTransactionIsolator.ts"],"sourcesContent":[],"mappings":";;;;;;AASA;AAWA;;;;AAGoC,UAdnB,gBAcmB,CAAA,WAAA,EAAA,YAAA,MAAA,CAAA,CAAA;EAAQ;AAe5C;;;EACiB,GACZ,EA1BC,WA0BD;;;AAAkB;AAQvB;AAkDsB,KA9EV,wBA8EU,CAAA,WAAiC,EAAA,WAAA,MAAA,CA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0BAA0B,OAAO,aAAa,YAAS,QAAA,iBAAA,uBAAA;;KA+EtD,mCAAmC,OAAO,QAAQ;KAClD,2BAA2B,qBAAqB;;;;UAK3C,+DAGC;;cAGL,mBAAmB;;gBAEjB,gBAAgB;;mBAEb;;aAEN,gBAAgB,aAAa;;;;;;KAO7B,8CAEM,yCAEL,iBACN,gBACD,SAAS,KAAK,QAAQ,SAAS;;;;;;;;;KAWzB,uDAEM,0CACA,WAAW,qBAAqB,WAChD,sBAEE;iDAIQ,iBAAiB,eAAe,WAAW,MAChD;kEAMK,iBAAiB,eAAe,WAAW,MAChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCS,iDAEE,mCAEP,WAAW,uCAER,aACH,gBAAgB,aAAa,YACrC,yBAAyB,aAAa,UAAU"}
@@ -97,8 +97,8 @@ var VitestPostgresTransactionIsolator = class {
97
97
  const value = await creator(trx);
98
98
  await use(value);
99
99
  };
100
- const extendFn = this.api.extend;
101
- return extendFn({
100
+ const api = this.api;
101
+ return api.extend({
102
102
  trx: async ({}, use) => {
103
103
  class TestRollback extends Error {
104
104
  constructor() {
@@ -190,4 +190,4 @@ Object.defineProperty(exports, 'extendWithFixtures', {
190
190
  return extendWithFixtures;
191
191
  }
192
192
  });
193
- //# sourceMappingURL=VitestTransactionIsolator-CMfJXZP8.cjs.map
193
+ //# sourceMappingURL=VitestTransactionIsolator-CtZaOUjH.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VitestTransactionIsolator-CtZaOUjH.cjs","names":["api: TestAPI","options: TransactionWrapperOptions<TConn, Transaction, Extended>","additionalFixtures: Record<string, unknown>","use: (value: unknown) => Promise<void>","use: (value: Transaction) => Promise<void>","testError: Error | undefined","wrappedTest: T","fixtures: FixtureCreators<Transaction, Extended>","fixtureDefinitions: Record<string, any>"],"sources":["../src/VitestTransactionIsolator.ts"],"sourcesContent":["import type { TestAPI } from 'vitest';\n\n/**\n * Type definition for test fixtures that provide transaction access.\n * Used with Vitest's test.extend() API to inject transactions into tests.\n *\n * @template Transaction - The transaction type specific to the database driver\n * @template Extended - Additional context properties provided by the extend function\n */\nexport interface DatabaseFixtures<Transaction, _Extended = object> {\n\t/**\n\t * The database transaction available to the test.\n\t * All database operations should use this transaction to ensure proper rollback.\n\t */\n\ttrx: Transaction;\n}\n\n/**\n * Combined fixtures type that merges the base transaction fixture with extended context.\n */\nexport type ExtendedDatabaseFixtures<\n\tTransaction,\n\tExtended = object,\n> = DatabaseFixtures<Transaction> & Extended;\n\n/**\n * Function type for extending test context with additional properties.\n * Receives the transaction and returns additional context to be merged with { trx }.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional context to provide\n *\n * @example\n * ```typescript\n * const extendContext: ExtendContextFn<Transaction<DB>, { factory: KyselyFactory }> =\n * (trx) => ({ factory: new KyselyFactory(builders, seeds, trx) });\n * ```\n */\nexport type ExtendContextFn<Transaction, Extended> = (\n\ttrx: Transaction,\n) => Extended | Promise<Extended>;\n\n/**\n * PostgreSQL transaction isolation levels.\n * Controls the visibility of concurrent transactions.\n *\n * @see https://www.postgresql.org/docs/current/transaction-iso.html\n */\nexport enum IsolationLevel {\n\t/**\n\t * Lowest isolation level. Allows dirty reads.\n\t * Not recommended for testing.\n\t */\n\tREAD_UNCOMMITTED = 'READ UNCOMMITTED',\n\t/**\n\t * Default PostgreSQL isolation level.\n\t * Prevents dirty reads but allows non-repeatable reads.\n\t */\n\tREAD_COMMITTED = 'READ COMMITTED',\n\t/**\n\t * Prevents dirty reads and non-repeatable reads.\n\t * Recommended for most test scenarios.\n\t */\n\tREPEATABLE_READ = 'REPEATABLE READ',\n\t/**\n\t * Highest isolation level. Prevents all phenomena.\n\t * May cause performance overhead in tests.\n\t */\n\tSERIALIZABLE = 'SERIALIZABLE',\n}\n\n/**\n * Abstract base class for implementing database transaction isolation in Vitest tests.\n * Provides automatic transaction rollback after each test to maintain test isolation.\n * Subclasses must implement the transact() method for their specific database driver.\n *\n * @template TConn - The database connection type\n * @template Transaction - The transaction type\n *\n * @example\n * ```typescript\n * // Implement for your database driver\n * class MyDatabaseIsolator extends VitestPostgresTransactionIsolator<MyDB, MyTx> {\n * async transact(conn: MyDB, level: IsolationLevel, fn: (tx: MyTx) => Promise<void>) {\n * await conn.transaction(level, fn);\n * }\n * }\n *\n * // Use in tests\n * const isolator = new MyDatabaseIsolator(test);\n * const isolatedTest = isolator.wrapVitestWithTransaction(db);\n *\n * isolatedTest('should create user', async ({ trx }) => {\n * await trx.insert('users', { name: 'Test' });\n * // Data is automatically rolled back after test\n * });\n * ```\n */\nexport abstract class VitestPostgresTransactionIsolator<TConn, Transaction> {\n\t/**\n\t * Abstract method to create a transaction with the specified isolation level.\n\t * Must be implemented by subclasses for specific database drivers.\n\t *\n\t * @param conn - The database connection\n\t * @param isolationLevel - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t */\n\tabstract transact(\n\t\tconn: TConn,\n\t\tisolationLevel: IsolationLevel,\n\t\tfn: (trx: Transaction) => Promise<void>,\n\t): Promise<void>;\n\n\tabstract destroy(conn: TConn): Promise<void>;\n\t/**\n\t * Creates a new VitestPostgresTransactionIsolator instance.\n\t *\n\t * @param api - The Vitest test API (usually the `test` export from vitest)\n\t */\n\tconstructor(private readonly api: TestAPI) {}\n\n\t/**\n\t * Creates a wrapped version of Vitest's test API that provides transaction isolation.\n\t * Each test will run within a database transaction that is automatically rolled back.\n\t *\n\t * @param options - Configuration options for transaction wrapping\n\t * @returns A wrapped test API with transaction support\n\t *\n\t * @example\n\t * ```typescript\n\t * const isolatedTest = isolator.wrapVitestWithTransaction({\n\t * connection: db,\n\t * setup: async (trx) => {\n\t * await trx.insert('settings', { key: 'test', value: 'true' });\n\t * },\n\t * fixtures: {\n\t * factory: (trx) => new Factory(trx),\n\t * },\n\t * });\n\t *\n\t * isolatedTest('test with transaction', async ({ trx, factory }) => {\n\t * const user = await factory.insert('user', { name: 'Test' });\n\t * expect(user).toBeDefined();\n\t * });\n\t * ```\n\t */\n\twrapVitestWithTransaction<Extended extends Record<string, unknown> = {}>(\n\t\toptions: TransactionWrapperOptions<TConn, Transaction, Extended>,\n\t) {\n\t\tconst {\n\t\t\tconnection,\n\t\t\tsetup,\n\t\t\tisolationLevel = IsolationLevel.REPEATABLE_READ,\n\t\t\tfixtures,\n\t\t} = options;\n\n\t\t// Build fixture definitions for additional fixtures that depend on trx\n\t\tconst additionalFixtures: Record<string, unknown> = {};\n\t\tif (fixtures) {\n\t\t\tfor (const [key, creator] of Object.entries(fixtures)) {\n\t\t\t\tadditionalFixtures[key] = async (\n\t\t\t\t\t{ trx }: { trx: Transaction },\n\t\t\t\t\tuse: (value: unknown) => Promise<void>,\n\t\t\t\t) => {\n\t\t\t\t\tconst value = await (creator as (trx: Transaction) => unknown)(trx);\n\t\t\t\t\tawait use(value);\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\ttype CombinedFixtures = DatabaseFixtures<Transaction> & Extended;\n\n\t\t// Cast to bypass Vitest's strict fixture typing which can't infer\n\t\t// dynamically built fixture objects\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tconst api = this.api as TestAPI & {\n\t\t\textend: <T>(fixtures: any) => TestAPI<T>;\n\t\t};\n\n\t\treturn api.extend<CombinedFixtures>({\n\t\t\t// This fixture automatically provides a transaction to each test\n\t\t\t// biome-ignore lint/correctness/noEmptyPattern: this has to be like this to satisfy Biome\n\t\t\ttrx: async ({}: {}, use: (value: Transaction) => Promise<void>) => {\n\t\t\t\t// Create a custom error class for rollback\n\t\t\t\tclass TestRollback extends Error {\n\t\t\t\t\tconstructor() {\n\t\t\t\t\t\tsuper('Test rollback');\n\t\t\t\t\t\tthis.name = 'TestRollback';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet testError: Error | undefined;\n\t\t\t\tconst conn = await connection();\n\t\t\t\ttry {\n\t\t\t\t\tawait this.transact(conn, isolationLevel, async (transaction) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Provide the transaction to the test\n\t\t\t\t\t\t\tawait setup?.(transaction);\n\t\t\t\t\t\t\tawait use(transaction);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t// Capture any test errors\n\t\t\t\t\t\t\ttestError = error as Error;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Always throw to trigger rollback\n\t\t\t\t\t\tthrow new TestRollback();\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// Only rethrow if it's not our rollback error\n\t\t\t\t\tif (!(error instanceof TestRollback)) {\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the test had an error, throw it now\n\t\t\t\t\tif (testError) {\n\t\t\t\t\t\tthrow testError;\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tawait this.destroy(conn);\n\t\t\t\t}\n\t\t\t},\n\t\t\t...additionalFixtures,\n\t\t});\n\t}\n}\n\nexport type DatabaseConnectionFn<Conn> = () => Conn | Promise<Conn>;\nexport type DatabaseConnection<Conn> = DatabaseConnectionFn<Conn>;\n\n/**\n * Options for wrapping Vitest tests with database transaction isolation.\n */\nexport interface TransactionWrapperOptions<\n\tTConn,\n\tTransaction,\n\tExtended extends Record<string, unknown> = {},\n> {\n\t/** Function that creates or returns a database connection */\n\tconnection: DatabaseConnection<TConn>;\n\t/** Optional setup function to run within the transaction before each test */\n\tsetup?: (trx: Transaction) => Promise<void>;\n\t/** Transaction isolation level (defaults to REPEATABLE_READ) */\n\tisolationLevel?: IsolationLevel;\n\t/** Additional fixtures that depend on the transaction */\n\tfixtures?: FixtureCreators<Transaction, Extended>;\n}\n\n/**\n * Type for fixture creator functions that depend on the transaction.\n * Each function receives the transaction and returns the fixture value.\n */\nexport type FixtureCreators<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n> = {\n\t[K in keyof Extended]: (\n\t\ttrx: Transaction,\n\t) => Extended[K] | Promise<Extended[K]>;\n};\n\n/**\n * The test API returned by extendWithFixtures.\n * Provides access to both the transaction (trx) and all extended fixtures.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional fixtures provided\n * @template BaseTest - The base wrapped test type\n */\nexport type TestWithExtendedFixtures<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n\tBaseTest extends ReturnType<TestAPI['extend']> = ReturnType<\n\t\tTestAPI['extend']\n\t>,\n> = BaseTest & {\n\t<C extends object>(\n\t\tname: string,\n\t\tfn: (\n\t\t\tcontext: DatabaseFixtures<Transaction> & Extended & C,\n\t\t) => Promise<void>,\n\t): void;\n\t<C extends object>(\n\t\tname: string,\n\t\toptions: object,\n\t\tfn: (\n\t\t\tcontext: DatabaseFixtures<Transaction> & Extended & C,\n\t\t) => Promise<void>,\n\t): void;\n};\n\n/**\n * Extends a wrapped test API with additional fixtures that depend on the transaction.\n * This allows composing test context with factories, repositories, or other helpers.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional context to provide\n * @param wrappedTest - The base wrapped test from wrapVitestWithTransaction\n * @param fixtures - Object mapping fixture names to creator functions\n * @returns An extended test API with both trx and the additional fixtures\n *\n * @example\n * ```typescript\n * import { wrapVitestKyselyTransaction, extendWithFixtures } from '@geekmidas/testkit/kysely';\n *\n * // Create base wrapped test\n * const baseTest = wrapVitestKyselyTransaction(test, {\n * connection: db,\n * setup: createTestTables,\n * });\n *\n * // Extend with fixtures\n * const it = extendWithFixtures(baseTest, {\n * factory: (trx) => new KyselyFactory(builders, seeds, trx),\n * userRepo: (trx) => new UserRepository(trx),\n * });\n *\n * // Use in tests - trx and all fixtures are available\n * it('should create user with factory', async ({ trx, factory, userRepo }) => {\n * const user = await factory.insert('user', { name: 'Test' });\n * expect(user).toBeDefined();\n * });\n * ```\n */\nexport function extendWithFixtures<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tT extends ReturnType<TestAPI['extend']> = any,\n>(\n\twrappedTest: T,\n\tfixtures: FixtureCreators<Transaction, Extended>,\n): TestWithExtendedFixtures<Transaction, Extended, T> {\n\t// Build fixture definitions for Vitest's extend API\n\tconst fixtureDefinitions: Record<string, any> = {};\n\n\tfor (const [key, creator] of Object.entries(fixtures)) {\n\t\tfixtureDefinitions[key] = async (\n\t\t\t{ trx }: { trx: Transaction },\n\t\t\tuse: (value: unknown) => Promise<void>,\n\t\t) => {\n\t\t\tconst value = await (creator as (trx: Transaction) => unknown)(trx);\n\t\t\tawait use(value);\n\t\t};\n\t}\n\n\treturn (wrappedTest as any).extend(fixtureDefinitions);\n}\n"],"mappings":";;;;;;;;AAgDA,IAAY,4DAAL;;;;;AAKN;;;;;AAKA;;;;;AAKA;;;;;AAKA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,IAAsB,oCAAtB,MAA4E;;;;;;CAsB3E,YAA6BA,KAAc;EAAd;CAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B7C,0BACCC,SACC;EACD,MAAM,EACL,YACA,OACA,iBAAiB,eAAe,iBAChC,UACA,GAAG;EAGJ,MAAMC,qBAA8C,CAAE;AACtD,MAAI,SACH,MAAK,MAAM,CAAC,KAAK,QAAQ,IAAI,OAAO,QAAQ,SAAS,CACpD,oBAAmB,OAAO,OACzB,EAAE,KAA2B,EAC7BC,QACI;GACJ,MAAM,QAAQ,MAAM,AAAC,QAA0C,IAAI;AACnE,SAAM,IAAI,MAAM;EAChB;EASH,MAAM,MAAM,KAAK;AAIjB,SAAO,IAAI,OAAyB;GAGnC,KAAK,OAAO,EAAM,EAAEC,QAA+C;IAElE,MAAM,qBAAqB,MAAM;KAChC,cAAc;AACb,YAAM,gBAAgB;AACtB,WAAK,OAAO;KACZ;IACD;IAED,IAAIC;IACJ,MAAM,OAAO,MAAM,YAAY;AAC/B,QAAI;AACH,WAAM,KAAK,SAAS,MAAM,gBAAgB,OAAO,gBAAgB;AAChE,UAAI;AAEH,aAAM,QAAQ,YAAY;AAC1B,aAAM,IAAI,YAAY;MACtB,SAAQ,OAAO;AAEf,mBAAY;MACZ;AAGD,YAAM,IAAI;KACV,EAAC;IACF,SAAQ,OAAO;AAEf,WAAM,iBAAiB,cACtB,OAAM;AAIP,SAAI,UACH,OAAM;IAEP,UAAS;AACT,WAAM,KAAK,QAAQ,KAAK;IACxB;GACD;GACD,GAAG;EACH,EAAC;CACF;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGD,SAAgB,mBAMfC,aACAC,UACqD;CAErD,MAAMC,qBAA0C,CAAE;AAElD,MAAK,MAAM,CAAC,KAAK,QAAQ,IAAI,OAAO,QAAQ,SAAS,CACpD,oBAAmB,OAAO,OACzB,EAAE,KAA2B,EAC7BL,QACI;EACJ,MAAM,QAAQ,MAAM,AAAC,QAA0C,IAAI;AACnE,QAAM,IAAI,MAAM;CAChB;AAGF,QAAO,AAAC,YAAoB,OAAO,mBAAmB;AACtD"}
@@ -96,8 +96,8 @@ var VitestPostgresTransactionIsolator = class {
96
96
  const value = await creator(trx);
97
97
  await use(value);
98
98
  };
99
- const extendFn = this.api.extend;
100
- return extendFn({
99
+ const api = this.api;
100
+ return api.extend({
101
101
  trx: async ({}, use) => {
102
102
  class TestRollback extends Error {
103
103
  constructor() {
@@ -172,4 +172,4 @@ function extendWithFixtures(wrappedTest, fixtures) {
172
172
 
173
173
  //#endregion
174
174
  export { IsolationLevel, VitestPostgresTransactionIsolator, extendWithFixtures };
175
- //# sourceMappingURL=VitestTransactionIsolator-DQ7tLqgV.mjs.map
175
+ //# sourceMappingURL=VitestTransactionIsolator-D6ZxLWys.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VitestTransactionIsolator-D6ZxLWys.mjs","names":["api: TestAPI","options: TransactionWrapperOptions<TConn, Transaction, Extended>","additionalFixtures: Record<string, unknown>","use: (value: unknown) => Promise<void>","use: (value: Transaction) => Promise<void>","testError: Error | undefined","wrappedTest: T","fixtures: FixtureCreators<Transaction, Extended>","fixtureDefinitions: Record<string, any>"],"sources":["../src/VitestTransactionIsolator.ts"],"sourcesContent":["import type { TestAPI } from 'vitest';\n\n/**\n * Type definition for test fixtures that provide transaction access.\n * Used with Vitest's test.extend() API to inject transactions into tests.\n *\n * @template Transaction - The transaction type specific to the database driver\n * @template Extended - Additional context properties provided by the extend function\n */\nexport interface DatabaseFixtures<Transaction, _Extended = object> {\n\t/**\n\t * The database transaction available to the test.\n\t * All database operations should use this transaction to ensure proper rollback.\n\t */\n\ttrx: Transaction;\n}\n\n/**\n * Combined fixtures type that merges the base transaction fixture with extended context.\n */\nexport type ExtendedDatabaseFixtures<\n\tTransaction,\n\tExtended = object,\n> = DatabaseFixtures<Transaction> & Extended;\n\n/**\n * Function type for extending test context with additional properties.\n * Receives the transaction and returns additional context to be merged with { trx }.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional context to provide\n *\n * @example\n * ```typescript\n * const extendContext: ExtendContextFn<Transaction<DB>, { factory: KyselyFactory }> =\n * (trx) => ({ factory: new KyselyFactory(builders, seeds, trx) });\n * ```\n */\nexport type ExtendContextFn<Transaction, Extended> = (\n\ttrx: Transaction,\n) => Extended | Promise<Extended>;\n\n/**\n * PostgreSQL transaction isolation levels.\n * Controls the visibility of concurrent transactions.\n *\n * @see https://www.postgresql.org/docs/current/transaction-iso.html\n */\nexport enum IsolationLevel {\n\t/**\n\t * Lowest isolation level. Allows dirty reads.\n\t * Not recommended for testing.\n\t */\n\tREAD_UNCOMMITTED = 'READ UNCOMMITTED',\n\t/**\n\t * Default PostgreSQL isolation level.\n\t * Prevents dirty reads but allows non-repeatable reads.\n\t */\n\tREAD_COMMITTED = 'READ COMMITTED',\n\t/**\n\t * Prevents dirty reads and non-repeatable reads.\n\t * Recommended for most test scenarios.\n\t */\n\tREPEATABLE_READ = 'REPEATABLE READ',\n\t/**\n\t * Highest isolation level. Prevents all phenomena.\n\t * May cause performance overhead in tests.\n\t */\n\tSERIALIZABLE = 'SERIALIZABLE',\n}\n\n/**\n * Abstract base class for implementing database transaction isolation in Vitest tests.\n * Provides automatic transaction rollback after each test to maintain test isolation.\n * Subclasses must implement the transact() method for their specific database driver.\n *\n * @template TConn - The database connection type\n * @template Transaction - The transaction type\n *\n * @example\n * ```typescript\n * // Implement for your database driver\n * class MyDatabaseIsolator extends VitestPostgresTransactionIsolator<MyDB, MyTx> {\n * async transact(conn: MyDB, level: IsolationLevel, fn: (tx: MyTx) => Promise<void>) {\n * await conn.transaction(level, fn);\n * }\n * }\n *\n * // Use in tests\n * const isolator = new MyDatabaseIsolator(test);\n * const isolatedTest = isolator.wrapVitestWithTransaction(db);\n *\n * isolatedTest('should create user', async ({ trx }) => {\n * await trx.insert('users', { name: 'Test' });\n * // Data is automatically rolled back after test\n * });\n * ```\n */\nexport abstract class VitestPostgresTransactionIsolator<TConn, Transaction> {\n\t/**\n\t * Abstract method to create a transaction with the specified isolation level.\n\t * Must be implemented by subclasses for specific database drivers.\n\t *\n\t * @param conn - The database connection\n\t * @param isolationLevel - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t */\n\tabstract transact(\n\t\tconn: TConn,\n\t\tisolationLevel: IsolationLevel,\n\t\tfn: (trx: Transaction) => Promise<void>,\n\t): Promise<void>;\n\n\tabstract destroy(conn: TConn): Promise<void>;\n\t/**\n\t * Creates a new VitestPostgresTransactionIsolator instance.\n\t *\n\t * @param api - The Vitest test API (usually the `test` export from vitest)\n\t */\n\tconstructor(private readonly api: TestAPI) {}\n\n\t/**\n\t * Creates a wrapped version of Vitest's test API that provides transaction isolation.\n\t * Each test will run within a database transaction that is automatically rolled back.\n\t *\n\t * @param options - Configuration options for transaction wrapping\n\t * @returns A wrapped test API with transaction support\n\t *\n\t * @example\n\t * ```typescript\n\t * const isolatedTest = isolator.wrapVitestWithTransaction({\n\t * connection: db,\n\t * setup: async (trx) => {\n\t * await trx.insert('settings', { key: 'test', value: 'true' });\n\t * },\n\t * fixtures: {\n\t * factory: (trx) => new Factory(trx),\n\t * },\n\t * });\n\t *\n\t * isolatedTest('test with transaction', async ({ trx, factory }) => {\n\t * const user = await factory.insert('user', { name: 'Test' });\n\t * expect(user).toBeDefined();\n\t * });\n\t * ```\n\t */\n\twrapVitestWithTransaction<Extended extends Record<string, unknown> = {}>(\n\t\toptions: TransactionWrapperOptions<TConn, Transaction, Extended>,\n\t) {\n\t\tconst {\n\t\t\tconnection,\n\t\t\tsetup,\n\t\t\tisolationLevel = IsolationLevel.REPEATABLE_READ,\n\t\t\tfixtures,\n\t\t} = options;\n\n\t\t// Build fixture definitions for additional fixtures that depend on trx\n\t\tconst additionalFixtures: Record<string, unknown> = {};\n\t\tif (fixtures) {\n\t\t\tfor (const [key, creator] of Object.entries(fixtures)) {\n\t\t\t\tadditionalFixtures[key] = async (\n\t\t\t\t\t{ trx }: { trx: Transaction },\n\t\t\t\t\tuse: (value: unknown) => Promise<void>,\n\t\t\t\t) => {\n\t\t\t\t\tconst value = await (creator as (trx: Transaction) => unknown)(trx);\n\t\t\t\t\tawait use(value);\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\ttype CombinedFixtures = DatabaseFixtures<Transaction> & Extended;\n\n\t\t// Cast to bypass Vitest's strict fixture typing which can't infer\n\t\t// dynamically built fixture objects\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tconst api = this.api as TestAPI & {\n\t\t\textend: <T>(fixtures: any) => TestAPI<T>;\n\t\t};\n\n\t\treturn api.extend<CombinedFixtures>({\n\t\t\t// This fixture automatically provides a transaction to each test\n\t\t\t// biome-ignore lint/correctness/noEmptyPattern: this has to be like this to satisfy Biome\n\t\t\ttrx: async ({}: {}, use: (value: Transaction) => Promise<void>) => {\n\t\t\t\t// Create a custom error class for rollback\n\t\t\t\tclass TestRollback extends Error {\n\t\t\t\t\tconstructor() {\n\t\t\t\t\t\tsuper('Test rollback');\n\t\t\t\t\t\tthis.name = 'TestRollback';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet testError: Error | undefined;\n\t\t\t\tconst conn = await connection();\n\t\t\t\ttry {\n\t\t\t\t\tawait this.transact(conn, isolationLevel, async (transaction) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Provide the transaction to the test\n\t\t\t\t\t\t\tawait setup?.(transaction);\n\t\t\t\t\t\t\tawait use(transaction);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t// Capture any test errors\n\t\t\t\t\t\t\ttestError = error as Error;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Always throw to trigger rollback\n\t\t\t\t\t\tthrow new TestRollback();\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// Only rethrow if it's not our rollback error\n\t\t\t\t\tif (!(error instanceof TestRollback)) {\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the test had an error, throw it now\n\t\t\t\t\tif (testError) {\n\t\t\t\t\t\tthrow testError;\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tawait this.destroy(conn);\n\t\t\t\t}\n\t\t\t},\n\t\t\t...additionalFixtures,\n\t\t});\n\t}\n}\n\nexport type DatabaseConnectionFn<Conn> = () => Conn | Promise<Conn>;\nexport type DatabaseConnection<Conn> = DatabaseConnectionFn<Conn>;\n\n/**\n * Options for wrapping Vitest tests with database transaction isolation.\n */\nexport interface TransactionWrapperOptions<\n\tTConn,\n\tTransaction,\n\tExtended extends Record<string, unknown> = {},\n> {\n\t/** Function that creates or returns a database connection */\n\tconnection: DatabaseConnection<TConn>;\n\t/** Optional setup function to run within the transaction before each test */\n\tsetup?: (trx: Transaction) => Promise<void>;\n\t/** Transaction isolation level (defaults to REPEATABLE_READ) */\n\tisolationLevel?: IsolationLevel;\n\t/** Additional fixtures that depend on the transaction */\n\tfixtures?: FixtureCreators<Transaction, Extended>;\n}\n\n/**\n * Type for fixture creator functions that depend on the transaction.\n * Each function receives the transaction and returns the fixture value.\n */\nexport type FixtureCreators<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n> = {\n\t[K in keyof Extended]: (\n\t\ttrx: Transaction,\n\t) => Extended[K] | Promise<Extended[K]>;\n};\n\n/**\n * The test API returned by extendWithFixtures.\n * Provides access to both the transaction (trx) and all extended fixtures.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional fixtures provided\n * @template BaseTest - The base wrapped test type\n */\nexport type TestWithExtendedFixtures<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n\tBaseTest extends ReturnType<TestAPI['extend']> = ReturnType<\n\t\tTestAPI['extend']\n\t>,\n> = BaseTest & {\n\t<C extends object>(\n\t\tname: string,\n\t\tfn: (\n\t\t\tcontext: DatabaseFixtures<Transaction> & Extended & C,\n\t\t) => Promise<void>,\n\t): void;\n\t<C extends object>(\n\t\tname: string,\n\t\toptions: object,\n\t\tfn: (\n\t\t\tcontext: DatabaseFixtures<Transaction> & Extended & C,\n\t\t) => Promise<void>,\n\t): void;\n};\n\n/**\n * Extends a wrapped test API with additional fixtures that depend on the transaction.\n * This allows composing test context with factories, repositories, or other helpers.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional context to provide\n * @param wrappedTest - The base wrapped test from wrapVitestWithTransaction\n * @param fixtures - Object mapping fixture names to creator functions\n * @returns An extended test API with both trx and the additional fixtures\n *\n * @example\n * ```typescript\n * import { wrapVitestKyselyTransaction, extendWithFixtures } from '@geekmidas/testkit/kysely';\n *\n * // Create base wrapped test\n * const baseTest = wrapVitestKyselyTransaction(test, {\n * connection: db,\n * setup: createTestTables,\n * });\n *\n * // Extend with fixtures\n * const it = extendWithFixtures(baseTest, {\n * factory: (trx) => new KyselyFactory(builders, seeds, trx),\n * userRepo: (trx) => new UserRepository(trx),\n * });\n *\n * // Use in tests - trx and all fixtures are available\n * it('should create user with factory', async ({ trx, factory, userRepo }) => {\n * const user = await factory.insert('user', { name: 'Test' });\n * expect(user).toBeDefined();\n * });\n * ```\n */\nexport function extendWithFixtures<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tT extends ReturnType<TestAPI['extend']> = any,\n>(\n\twrappedTest: T,\n\tfixtures: FixtureCreators<Transaction, Extended>,\n): TestWithExtendedFixtures<Transaction, Extended, T> {\n\t// Build fixture definitions for Vitest's extend API\n\tconst fixtureDefinitions: Record<string, any> = {};\n\n\tfor (const [key, creator] of Object.entries(fixtures)) {\n\t\tfixtureDefinitions[key] = async (\n\t\t\t{ trx }: { trx: Transaction },\n\t\t\tuse: (value: unknown) => Promise<void>,\n\t\t) => {\n\t\t\tconst value = await (creator as (trx: Transaction) => unknown)(trx);\n\t\t\tawait use(value);\n\t\t};\n\t}\n\n\treturn (wrappedTest as any).extend(fixtureDefinitions);\n}\n"],"mappings":";;;;;;;AAgDA,IAAY,4DAAL;;;;;AAKN;;;;;AAKA;;;;;AAKA;;;;;AAKA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,IAAsB,oCAAtB,MAA4E;;;;;;CAsB3E,YAA6BA,KAAc;EAAd;CAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B7C,0BACCC,SACC;EACD,MAAM,EACL,YACA,OACA,iBAAiB,eAAe,iBAChC,UACA,GAAG;EAGJ,MAAMC,qBAA8C,CAAE;AACtD,MAAI,SACH,MAAK,MAAM,CAAC,KAAK,QAAQ,IAAI,OAAO,QAAQ,SAAS,CACpD,oBAAmB,OAAO,OACzB,EAAE,KAA2B,EAC7BC,QACI;GACJ,MAAM,QAAQ,MAAM,AAAC,QAA0C,IAAI;AACnE,SAAM,IAAI,MAAM;EAChB;EASH,MAAM,MAAM,KAAK;AAIjB,SAAO,IAAI,OAAyB;GAGnC,KAAK,OAAO,EAAM,EAAEC,QAA+C;IAElE,MAAM,qBAAqB,MAAM;KAChC,cAAc;AACb,YAAM,gBAAgB;AACtB,WAAK,OAAO;KACZ;IACD;IAED,IAAIC;IACJ,MAAM,OAAO,MAAM,YAAY;AAC/B,QAAI;AACH,WAAM,KAAK,SAAS,MAAM,gBAAgB,OAAO,gBAAgB;AAChE,UAAI;AAEH,aAAM,QAAQ,YAAY;AAC1B,aAAM,IAAI,YAAY;MACtB,SAAQ,OAAO;AAEf,mBAAY;MACZ;AAGD,YAAM,IAAI;KACV,EAAC;IACF,SAAQ,OAAO;AAEf,WAAM,iBAAiB,cACtB,OAAM;AAIP,SAAI,UACH,OAAM;IAEP,UAAS;AACT,WAAM,KAAK,QAAQ,KAAK;IACxB;GACD;GACD,GAAG;EACH,EAAC;CACF;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGD,SAAgB,mBAMfC,aACAC,UACqD;CAErD,MAAMC,qBAA0C,CAAE;AAElD,MAAK,MAAM,CAAC,KAAK,QAAQ,IAAI,OAAO,QAAQ,SAAS,CACpD,oBAAmB,OAAO,OACzB,EAAE,KAA2B,EAC7BL,QACI;EACJ,MAAM,QAAQ,MAAM,AAAC,QAA0C,IAAI;AACnE,QAAM,IAAI,MAAM;CAChB;AAGF,QAAO,AAAC,YAAoB,OAAO,mBAAmB;AACtD"}
@@ -1,4 +1,4 @@
1
- const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-CMfJXZP8.cjs');
1
+ const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-CtZaOUjH.cjs');
2
2
 
3
3
  exports.IsolationLevel = require_VitestTransactionIsolator.IsolationLevel;
4
4
  exports.VitestPostgresTransactionIsolator = require_VitestTransactionIsolator.VitestPostgresTransactionIsolator;
@@ -1,3 +1,3 @@
1
- import { IsolationLevel, VitestPostgresTransactionIsolator, extendWithFixtures } from "./VitestTransactionIsolator-DQ7tLqgV.mjs";
1
+ import { IsolationLevel, VitestPostgresTransactionIsolator, extendWithFixtures } from "./VitestTransactionIsolator-D6ZxLWys.mjs";
2
2
 
3
3
  export { IsolationLevel, VitestPostgresTransactionIsolator, extendWithFixtures };
@@ -1,4 +1,4 @@
1
- import * as better_auth_adapters6 from "better-auth/adapters";
1
+ import * as better_auth_adapters0 from "better-auth/adapters";
2
2
  import { DBAdapterDebugLogOption } from "better-auth/adapters";
3
3
 
4
4
  //#region src/better-auth.d.ts
@@ -7,7 +7,7 @@ interface MemoryAdapterConfig {
7
7
  usePlural?: boolean;
8
8
  initialData?: Record<string, any[]>;
9
9
  }
10
- declare const memoryAdapter: (config?: MemoryAdapterConfig, store?: Map<any, any>) => better_auth_adapters6.AdapterFactory & {
10
+ declare const memoryAdapter: (config?: MemoryAdapterConfig, store?: Map<any, any>) => better_auth_adapters0.AdapterFactory & {
11
11
  clear: () => void;
12
12
  getAllData: () => Record<string, any[]>;
13
13
  getStore: () => Map<any, any>;
@@ -1,4 +1,4 @@
1
- import * as better_auth_adapters0 from "better-auth/adapters";
1
+ import * as better_auth_adapters4 from "better-auth/adapters";
2
2
  import { DBAdapterDebugLogOption } from "better-auth/adapters";
3
3
 
4
4
  //#region src/better-auth.d.ts
@@ -7,7 +7,7 @@ interface MemoryAdapterConfig {
7
7
  usePlural?: boolean;
8
8
  initialData?: Record<string, any[]>;
9
9
  }
10
- declare const memoryAdapter: (config?: MemoryAdapterConfig, store?: Map<any, any>) => better_auth_adapters0.AdapterFactory & {
10
+ declare const memoryAdapter: (config?: MemoryAdapterConfig, store?: Map<any, any>) => better_auth_adapters4.AdapterFactory & {
11
11
  clear: () => void;
12
12
  getAllData: () => Record<string, any[]>;
13
13
  getStore: () => Map<any, any>;
@@ -1,7 +1,7 @@
1
- import * as vitest4 from "vitest";
1
+ import * as vitest3 from "vitest";
2
2
 
3
3
  //#region src/os/directory.d.ts
4
- declare const itWithDir: vitest4.TestAPI<{
4
+ declare const itWithDir: vitest3.TestAPI<{
5
5
  dir: string;
6
6
  }>;
7
7
  interface DirectoryFixtures {
@@ -10,4 +10,4 @@ interface DirectoryFixtures {
10
10
  //# sourceMappingURL=directory.d.ts.map
11
11
  //#endregion
12
12
  export { DirectoryFixtures, itWithDir };
13
- //# sourceMappingURL=directory-CYXmolu1.d.mts.map
13
+ //# sourceMappingURL=directory-DAVs0Yaq.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"directory-CYXmolu1.d.mts","names":[],"sources":["../src/os/directory.ts"],"sourcesContent":[],"mappings":";;;cAMa,WAeX,OAAA,CAfoB;;;AAAT,UAiBI,iBAAA,CAjBK;EAiBL,GAAA,EAAA,MAAA"}
1
+ {"version":3,"file":"directory-DAVs0Yaq.d.mts","names":[],"sources":["../src/os/directory.ts"],"sourcesContent":[],"mappings":";;;cAMa,WAeX,OAAA,CAfoB;;;AAAT,UAiBI,iBAAA,CAjBK;EAiBL,GAAA,EAAA,MAAA"}
@@ -1,4 +1,4 @@
1
- import * as _faker_js_faker1 from "@faker-js/faker";
1
+ import * as _faker_js_faker2 from "@faker-js/faker";
2
2
 
3
3
  //#region src/faker.d.ts
4
4
 
@@ -134,7 +134,7 @@ declare function coordinateOutsideRadius(center: Coordinate, minRadiusMeters: nu
134
134
  * const productPrice = faker.price();
135
135
  * ```
136
136
  */
137
- declare const faker$1: Readonly<_faker_js_faker1.Faker & {
137
+ declare const faker$1: Readonly<_faker_js_faker2.Faker & {
138
138
  timestamps: typeof timestamps;
139
139
  identifier: typeof identifier;
140
140
  sequence: typeof sequence;
@@ -163,4 +163,4 @@ type Timestamps = {
163
163
  type FakerFactory = typeof faker$1;
164
164
  //#endregion
165
165
  export { FakerFactory, Timestamps, coordinateInRadius, faker$1 as faker, identifier, resetAllSequences, resetSequence, sequence, timestamps };
166
- //# sourceMappingURL=faker-DHh7xs4u.d.mts.map
166
+ //# sourceMappingURL=faker-Br8MzXil.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"faker-DHh7xs4u.d.mts","names":[],"sources":["../src/faker.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkFA;AA2BA;AAmCA;AA2BA;AA0BA;AAEC;AAca;AASd;;;;AAGa;AA4BZ;;;;AAMY;AA2DA,iBA5OG,UAAA,CAAA,CAyPf,EAzP6B,UAyP7B;;;;;;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js_faker1 from "@faker-js/faker";
2
2
 
3
3
  //#region src/faker.d.ts
4
4
 
@@ -134,7 +134,7 @@ declare function coordinateOutsideRadius(center: Coordinate, minRadiusMeters: nu
134
134
  * const productPrice = faker.price();
135
135
  * ```
136
136
  */
137
- declare const faker: Readonly<_faker_js_faker5.Faker & {
137
+ declare const faker: Readonly<_faker_js_faker1.Faker & {
138
138
  timestamps: typeof timestamps;
139
139
  identifier: typeof identifier;
140
140
  sequence: typeof sequence;
@@ -163,4 +163,4 @@ type Timestamps = {
163
163
  type FakerFactory = typeof faker;
164
164
  //#endregion
165
165
  export { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps };
166
- //# sourceMappingURL=faker-zVCm31nU.d.cts.map
166
+ //# sourceMappingURL=faker-Cg76aFNO.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"faker-zVCm31nU.d.cts","names":[],"sources":["../src/faker.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkFA;AA2BA;AAmCA;AA2BA;AA0BA;AAEC;AAca;AASd;;;;AAGa;AA4BZ;;;;AAMY;AA2DA,iBA5OG,UAAA,CAAA,CAyPf,EAzP6B,UAyP7B;;;;;;;;;;;;AAbiB;AAmBlB;;AAEY,iBAtOI,UAAA,CAsOJ,MAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;AAEI;AAOhB;;;;;;;;;;;;;;;;;;iBA5MgB,QAAA;;;;;;;;;;;;;;;;;;;iBA2BA,aAAA;;;;;;;;;;;;;;;;;;iBA0BA,iBAAA,CAAA;;;;;;;;;;;;;iBAgBP,KAAA,CAAA;KAIJ,UAAA;;;;iBAKW,kBAAA,SACP,6BAEN;iBA8BM,uBAAA,SACA,+DAGN;;;;;;;;;;;;;;;;;;;;cA2DU,OAAK,SAajB,gBAAA,CAbiB,KAAA;qBAAA;;;;;;;;;;;;;;;KAmBN,UAAA;;aAEA;;aAEA;;;;;;KAOA,YAAA,UAAsB"}
1
+ {"version":3,"file":"faker-Cg76aFNO.d.cts","names":[],"sources":["../src/faker.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkFA;AA2BA;AAmCA;AA2BA;AA0BA;AAEC;AAca;AASd;;;;AAGa;AA4BZ;;;;AAMY;AA2DA,iBA5OG,UAAA,CAAA,CAyPf,EAzP6B,UAyP7B;;;;;;;;;;;;AAbiB;AAmBlB;;AAEY,iBAtOI,UAAA,CAsOJ,MAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;AAEI;AAOhB;;;;;;;;;;;;;;;;;;iBA5MgB,QAAA;;;;;;;;;;;;;;;;;;;iBA2BA,aAAA;;;;;;;;;;;;;;;;;;iBA0BA,iBAAA,CAAA;;;;;;;;;;;;;iBAgBP,KAAA,CAAA;KAIJ,UAAA;;;;iBAKW,kBAAA,SACP,6BAEN;iBA8BM,uBAAA,SACA,+DAGN;;;;;;;;;;;;;;;;;;;;cA2DU,OAAK,SAajB,gBAAA,CAbiB,KAAA;qBAAA;;;;;;;;;;;;;;;KAmBN,UAAA;;aAEA;;aAEA;;;;;;KAOA,YAAA,UAAsB"}
package/dist/faker.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps } from "./faker-zVCm31nU.cjs";
1
+ import { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps } from "./faker-Cg76aFNO.cjs";
2
2
  export { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps };
package/dist/faker.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps } from "./faker-DHh7xs4u.mjs";
1
+ import { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps } from "./faker-Br8MzXil.mjs";
2
2
  export { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps };
package/dist/kysely.cjs CHANGED
@@ -3,8 +3,8 @@ const require_faker = require('./faker-B14IEMIN.cjs');
3
3
  const require_KyselyFactory = require('./KyselyFactory-BFqVIn_0.cjs');
4
4
  require('./PostgresMigrator-M9jpzOvN.cjs');
5
5
  const require_PostgresKyselyMigrator = require('./PostgresKyselyMigrator-CqNs3qX8.cjs');
6
- const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-CMfJXZP8.cjs');
7
- const require_VitestKyselyTransactionIsolator = require('./VitestKyselyTransactionIsolator-D7RRXOBa.cjs');
6
+ const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-CtZaOUjH.cjs');
7
+ const require_VitestKyselyTransactionIsolator = require('./VitestKyselyTransactionIsolator-0CqOsuc9.cjs');
8
8
 
9
9
  //#region src/kysely.ts
10
10
  /**
package/dist/kysely.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { FakerFactory, faker } from "./faker-zVCm31nU.cjs";
2
- import { ExtractSeedAttrs, FactorySeed } from "./Factory-CUM2767q.cjs";
3
- import { KyselyFactory } from "./KyselyFactory-OMwcuAX_.cjs";
1
+ import { FakerFactory, faker } from "./faker-Cg76aFNO.cjs";
2
+ import { ExtractSeedAttrs, FactorySeed } from "./Factory-BOX312yd.cjs";
3
+ import { KyselyFactory } from "./KyselyFactory-Dy5zzV4B.cjs";
4
4
  import "./PostgresMigrator-CeYy-eHF.cjs";
5
5
  import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-CTNftoZK.cjs";
6
6
  import { DatabaseConnection, DatabaseFixtures, ExtendedDatabaseFixtures, FixtureCreators, IsolationLevel, TestWithExtendedFixtures, TransactionWrapperOptions } from "./VitestTransactionIsolator-CSroc7Df.cjs";
package/dist/kysely.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { FakerFactory, faker } from "./faker-DHh7xs4u.mjs";
2
- import { ExtractSeedAttrs, FactorySeed } from "./Factory-SFupxRC2.mjs";
3
- import { KyselyFactory } from "./KyselyFactory-vAxYodck.mjs";
1
+ import { FakerFactory, faker } from "./faker-Br8MzXil.mjs";
2
+ import { ExtractSeedAttrs, FactorySeed } from "./Factory-_w0_BN4J.mjs";
3
+ import { KyselyFactory } from "./KyselyFactory-BFxq2hz5.mjs";
4
4
  import "./PostgresMigrator-C_QQ6q35.mjs";
5
5
  import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-x0uvWs3U.mjs";
6
6
  import { DatabaseConnection, DatabaseFixtures, ExtendedDatabaseFixtures, FixtureCreators, IsolationLevel, TestWithExtendedFixtures, TransactionWrapperOptions } from "./VitestTransactionIsolator-BNWJqh9f.mjs";
package/dist/kysely.mjs CHANGED
@@ -3,8 +3,8 @@ import { faker } from "./faker-BGKYFoCT.mjs";
3
3
  import { KyselyFactory } from "./KyselyFactory-DMswpwji.mjs";
4
4
  import "./PostgresMigrator-DVAY04qN.mjs";
5
5
  import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-BIKd7G5C.mjs";
6
- import { IsolationLevel, extendWithFixtures } from "./VitestTransactionIsolator-DQ7tLqgV.mjs";
7
- import { VitestKyselyTransactionIsolator } from "./VitestKyselyTransactionIsolator-DceyIqr4.mjs";
6
+ import { IsolationLevel, extendWithFixtures } from "./VitestTransactionIsolator-D6ZxLWys.mjs";
7
+ import { VitestKyselyTransactionIsolator } from "./VitestKyselyTransactionIsolator-CfSMOFlN.mjs";
8
8
 
9
9
  //#region src/kysely.ts
10
10
  /**
@@ -3,8 +3,8 @@ const require_faker = require('./faker-B14IEMIN.cjs');
3
3
  const require_ObjectionFactory = require('./ObjectionFactory-BeFBYcan.cjs');
4
4
  require('./PostgresMigrator-M9jpzOvN.cjs');
5
5
  const require_PostgresObjectionMigrator = require('./PostgresObjectionMigrator-DSaPhwjY.cjs');
6
- const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-CMfJXZP8.cjs');
7
- const require_VitestObjectionTransactionIsolator = require('./VitestObjectionTransactionIsolator-CdLRrzNf.cjs');
6
+ const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-CtZaOUjH.cjs');
7
+ const require_VitestObjectionTransactionIsolator = require('./VitestObjectionTransactionIsolator-B5J9jjKq.cjs');
8
8
 
9
9
  //#region src/objection.ts
10
10
  /**
@@ -1,6 +1,6 @@
1
- import { FakerFactory, faker } from "./faker-zVCm31nU.cjs";
2
- import { ExtractSeedAttrs, FactorySeed } from "./Factory-CUM2767q.cjs";
3
- import { ObjectionFactory } from "./ObjectionFactory-DvmZVHhe.cjs";
1
+ import { FakerFactory, faker } from "./faker-Cg76aFNO.cjs";
2
+ import { ExtractSeedAttrs, FactorySeed } from "./Factory-BOX312yd.cjs";
3
+ import { ObjectionFactory } from "./ObjectionFactory-CD-WFuMJ.cjs";
4
4
  import "./PostgresMigrator-CeYy-eHF.cjs";
5
5
  import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-DHVC9h_P.cjs";
6
6
  import { DatabaseConnection, DatabaseFixtures, ExtendedDatabaseFixtures, FixtureCreators, IsolationLevel, TestWithExtendedFixtures, TransactionWrapperOptions } from "./VitestTransactionIsolator-CSroc7Df.cjs";
@@ -1,6 +1,6 @@
1
- import { FakerFactory, faker } from "./faker-DHh7xs4u.mjs";
2
- import { ExtractSeedAttrs, FactorySeed } from "./Factory-SFupxRC2.mjs";
3
- import { ObjectionFactory } from "./ObjectionFactory-BWjB49-i.mjs";
1
+ import { FakerFactory, faker } from "./faker-Br8MzXil.mjs";
2
+ import { ExtractSeedAttrs, FactorySeed } from "./Factory-_w0_BN4J.mjs";
3
+ import { ObjectionFactory } from "./ObjectionFactory-C4IsQ_wj.mjs";
4
4
  import "./PostgresMigrator-C_QQ6q35.mjs";
5
5
  import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-1j6YIB1c.mjs";
6
6
  import { DatabaseConnection, DatabaseFixtures, ExtendedDatabaseFixtures, FixtureCreators, IsolationLevel, TestWithExtendedFixtures, TransactionWrapperOptions } from "./VitestTransactionIsolator-BNWJqh9f.mjs";
@@ -3,8 +3,8 @@ import { faker } from "./faker-BGKYFoCT.mjs";
3
3
  import { ObjectionFactory } from "./ObjectionFactory-QCJ7u0Ql.mjs";
4
4
  import "./PostgresMigrator-DVAY04qN.mjs";
5
5
  import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-DjPKdUbm.mjs";
6
- import { IsolationLevel, extendWithFixtures } from "./VitestTransactionIsolator-DQ7tLqgV.mjs";
7
- import { VitestObjectionTransactionIsolator } from "./VitestObjectionTransactionIsolator-OF2osYY5.mjs";
6
+ import { IsolationLevel, extendWithFixtures } from "./VitestTransactionIsolator-D6ZxLWys.mjs";
7
+ import { VitestObjectionTransactionIsolator } from "./VitestObjectionTransactionIsolator-CNo40EdC.mjs";
8
8
 
9
9
  //#region src/objection.ts
10
10
  /**
@@ -1,2 +1,2 @@
1
- import { DirectoryFixtures, itWithDir } from "../directory-CYXmolu1.mjs";
1
+ import { DirectoryFixtures, itWithDir } from "../directory-DAVs0Yaq.mjs";
2
2
  export { DirectoryFixtures, itWithDir };
@@ -1,2 +1,2 @@
1
- import { itWithDir } from "../directory-CYXmolu1.mjs";
1
+ import { itWithDir } from "../directory-DAVs0Yaq.mjs";
2
2
  export { itWithDir };
package/package.json CHANGED
@@ -1,58 +1,108 @@
1
1
  {
2
2
  "name": "@geekmidas/testkit",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./objection": {
8
- "types": "./dist/objection.d.ts",
9
- "import": "./dist/objection.mjs",
10
- "require": "./dist/objection.cjs"
8
+ "import": {
9
+ "types": "./dist/objection.d.mts",
10
+ "default": "./dist/objection.mjs"
11
+ },
12
+ "require": {
13
+ "types": "./dist/objection.d.cts",
14
+ "default": "./dist/objection.cjs"
15
+ }
11
16
  },
12
17
  "./timer": {
13
- "types": "./dist/timer.d.ts",
14
- "import": "./dist/timer.mjs",
15
- "require": "./dist/timer.cjs"
18
+ "import": {
19
+ "types": "./dist/timer.d.mts",
20
+ "default": "./dist/timer.mjs"
21
+ },
22
+ "require": {
23
+ "types": "./dist/timer.d.cts",
24
+ "default": "./dist/timer.cjs"
25
+ }
16
26
  },
17
27
  "./kysely": {
18
- "types": "./dist/kysely.d.ts",
19
- "import": "./dist/kysely.mjs",
20
- "require": "./dist/kysely.cjs"
28
+ "import": {
29
+ "types": "./dist/kysely.d.mts",
30
+ "default": "./dist/kysely.mjs"
31
+ },
32
+ "require": {
33
+ "types": "./dist/kysely.d.cts",
34
+ "default": "./dist/kysely.cjs"
35
+ }
21
36
  },
22
37
  "./os": {
23
- "types": "./dist/os/index.d.ts",
24
- "import": "./dist/os/index.mjs",
25
- "require": "./dist/os/index.cjs"
38
+ "import": {
39
+ "types": "./dist/os/index.d.mts",
40
+ "default": "./dist/os/index.mjs"
41
+ },
42
+ "require": {
43
+ "types": "./dist/os/index.d.cts",
44
+ "default": "./dist/os/index.cjs"
45
+ }
26
46
  },
27
47
  "./faker": {
28
- "types": "./dist/faker.d.ts",
29
- "import": "./dist/faker.mjs",
30
- "require": "./dist/faker.cjs"
48
+ "import": {
49
+ "types": "./dist/faker.d.mts",
50
+ "default": "./dist/faker.mjs"
51
+ },
52
+ "require": {
53
+ "types": "./dist/faker.d.cts",
54
+ "default": "./dist/faker.cjs"
55
+ }
31
56
  },
32
57
  "./aws": {
33
- "types": "./dist/aws.d.ts",
34
- "import": "./dist/aws.mjs",
35
- "require": "./dist/aws.cjs"
58
+ "import": {
59
+ "types": "./dist/aws.d.mts",
60
+ "default": "./dist/aws.mjs"
61
+ },
62
+ "require": {
63
+ "types": "./dist/aws.d.cts",
64
+ "default": "./dist/aws.cjs"
65
+ }
36
66
  },
37
67
  "./logger": {
38
- "types": "./dist/logger.d.ts",
39
- "import": "./dist/logger.mjs",
40
- "require": "./dist/logger.cjs"
68
+ "import": {
69
+ "types": "./dist/logger.d.mts",
70
+ "default": "./dist/logger.mjs"
71
+ },
72
+ "require": {
73
+ "types": "./dist/logger.d.cts",
74
+ "default": "./dist/logger.cjs"
75
+ }
41
76
  },
42
77
  "./better-auth": {
43
- "types": "./dist/better-auth.d.ts",
44
- "import": "./dist/better-auth.mjs",
45
- "require": "./dist/better-auth.cjs"
78
+ "import": {
79
+ "types": "./dist/better-auth.d.mts",
80
+ "default": "./dist/better-auth.mjs"
81
+ },
82
+ "require": {
83
+ "types": "./dist/better-auth.d.cts",
84
+ "default": "./dist/better-auth.cjs"
85
+ }
46
86
  },
47
87
  "./benchmark": {
48
- "types": "./dist/benchmark.d.ts",
49
- "import": "./dist/benchmark.mjs",
50
- "require": "./dist/benchmark.cjs"
88
+ "import": {
89
+ "types": "./dist/benchmark.d.mts",
90
+ "default": "./dist/benchmark.mjs"
91
+ },
92
+ "require": {
93
+ "types": "./dist/benchmark.d.cts",
94
+ "default": "./dist/benchmark.cjs"
95
+ }
51
96
  },
52
97
  "./postgres": {
53
- "types": "./dist/initScript.d.ts",
54
- "import": "./dist/initScript.mjs",
55
- "require": "./dist/initScript.cjs"
98
+ "import": {
99
+ "types": "./dist/initScript.d.mts",
100
+ "default": "./dist/initScript.mjs"
101
+ },
102
+ "require": {
103
+ "types": "./dist/initScript.d.cts",
104
+ "default": "./dist/initScript.cjs"
105
+ }
56
106
  }
57
107
  },
58
108
  "dependencies": {
@@ -60,8 +110,8 @@
60
110
  },
61
111
  "devDependencies": {
62
112
  "@types/pg": "~8.15.4",
63
- "@geekmidas/envkit": "^1.0.3",
64
- "@geekmidas/logger": "^1.0.0"
113
+ "@geekmidas/envkit": "^1.0.7",
114
+ "@geekmidas/logger": "^1.0.2"
65
115
  },
66
116
  "repository": {
67
117
  "type": "git",
@@ -80,8 +130,8 @@
80
130
  "vitest": "~3.2.4",
81
131
  "@types/aws-lambda": ">=8.10.92",
82
132
  "better-auth": ">=1.3.34",
83
- "@geekmidas/envkit": "^1.0.3",
84
- "@geekmidas/logger": "^1.0.0"
133
+ "@geekmidas/envkit": "^1.0.7",
134
+ "@geekmidas/logger": "^1.0.2"
85
135
  },
86
136
  "peerDependenciesMeta": {
87
137
  "@geekmidas/envkit": {
@@ -174,9 +174,11 @@ export abstract class VitestPostgresTransactionIsolator<TConn, Transaction> {
174
174
  // Cast to bypass Vitest's strict fixture typing which can't infer
175
175
  // dynamically built fixture objects
176
176
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
177
- const extendFn = this.api.extend as <T>(fixtures: any) => TestAPI<T>;
177
+ const api = this.api as TestAPI & {
178
+ extend: <T>(fixtures: any) => TestAPI<T>;
179
+ };
178
180
 
179
- return extendFn<CombinedFixtures>({
181
+ return api.extend<CombinedFixtures>({
180
182
  // This fixture automatically provides a transaction to each test
181
183
  // biome-ignore lint/correctness/noEmptyPattern: this has to be like this to satisfy Biome
182
184
  trx: async ({}: {}, use: (value: Transaction) => Promise<void>) => {
@@ -18,10 +18,6 @@ class TestPostgresMigrator extends PostgresMigrator {
18
18
  public migrateError?: Error;
19
19
  public customMigrations: Array<() => Promise<void>> = [];
20
20
 
21
- constructor(uri: string, afterCreate?: (uri: string) => Promise<void>) {
22
- super(uri, afterCreate);
23
- }
24
-
25
21
  async migrate(): Promise<void> {
26
22
  this.migrateCalled = true;
27
23
  if (this.migrateError) {
@@ -1 +0,0 @@
1
- {"version":3,"file":"VitestTransactionIsolator-CMfJXZP8.cjs","names":["api: TestAPI","options: TransactionWrapperOptions<TConn, Transaction, Extended>","additionalFixtures: Record<string, unknown>","use: (value: unknown) => Promise<void>","use: (value: Transaction) => Promise<void>","testError: Error | undefined","wrappedTest: T","fixtures: FixtureCreators<Transaction, Extended>","fixtureDefinitions: Record<string, any>"],"sources":["../src/VitestTransactionIsolator.ts"],"sourcesContent":["import type { TestAPI } from 'vitest';\n\n/**\n * Type definition for test fixtures that provide transaction access.\n * Used with Vitest's test.extend() API to inject transactions into tests.\n *\n * @template Transaction - The transaction type specific to the database driver\n * @template Extended - Additional context properties provided by the extend function\n */\nexport interface DatabaseFixtures<Transaction, _Extended = object> {\n\t/**\n\t * The database transaction available to the test.\n\t * All database operations should use this transaction to ensure proper rollback.\n\t */\n\ttrx: Transaction;\n}\n\n/**\n * Combined fixtures type that merges the base transaction fixture with extended context.\n */\nexport type ExtendedDatabaseFixtures<\n\tTransaction,\n\tExtended = object,\n> = DatabaseFixtures<Transaction> & Extended;\n\n/**\n * Function type for extending test context with additional properties.\n * Receives the transaction and returns additional context to be merged with { trx }.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional context to provide\n *\n * @example\n * ```typescript\n * const extendContext: ExtendContextFn<Transaction<DB>, { factory: KyselyFactory }> =\n * (trx) => ({ factory: new KyselyFactory(builders, seeds, trx) });\n * ```\n */\nexport type ExtendContextFn<Transaction, Extended> = (\n\ttrx: Transaction,\n) => Extended | Promise<Extended>;\n\n/**\n * PostgreSQL transaction isolation levels.\n * Controls the visibility of concurrent transactions.\n *\n * @see https://www.postgresql.org/docs/current/transaction-iso.html\n */\nexport enum IsolationLevel {\n\t/**\n\t * Lowest isolation level. Allows dirty reads.\n\t * Not recommended for testing.\n\t */\n\tREAD_UNCOMMITTED = 'READ UNCOMMITTED',\n\t/**\n\t * Default PostgreSQL isolation level.\n\t * Prevents dirty reads but allows non-repeatable reads.\n\t */\n\tREAD_COMMITTED = 'READ COMMITTED',\n\t/**\n\t * Prevents dirty reads and non-repeatable reads.\n\t * Recommended for most test scenarios.\n\t */\n\tREPEATABLE_READ = 'REPEATABLE READ',\n\t/**\n\t * Highest isolation level. Prevents all phenomena.\n\t * May cause performance overhead in tests.\n\t */\n\tSERIALIZABLE = 'SERIALIZABLE',\n}\n\n/**\n * Abstract base class for implementing database transaction isolation in Vitest tests.\n * Provides automatic transaction rollback after each test to maintain test isolation.\n * Subclasses must implement the transact() method for their specific database driver.\n *\n * @template TConn - The database connection type\n * @template Transaction - The transaction type\n *\n * @example\n * ```typescript\n * // Implement for your database driver\n * class MyDatabaseIsolator extends VitestPostgresTransactionIsolator<MyDB, MyTx> {\n * async transact(conn: MyDB, level: IsolationLevel, fn: (tx: MyTx) => Promise<void>) {\n * await conn.transaction(level, fn);\n * }\n * }\n *\n * // Use in tests\n * const isolator = new MyDatabaseIsolator(test);\n * const isolatedTest = isolator.wrapVitestWithTransaction(db);\n *\n * isolatedTest('should create user', async ({ trx }) => {\n * await trx.insert('users', { name: 'Test' });\n * // Data is automatically rolled back after test\n * });\n * ```\n */\nexport abstract class VitestPostgresTransactionIsolator<TConn, Transaction> {\n\t/**\n\t * Abstract method to create a transaction with the specified isolation level.\n\t * Must be implemented by subclasses for specific database drivers.\n\t *\n\t * @param conn - The database connection\n\t * @param isolationLevel - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t */\n\tabstract transact(\n\t\tconn: TConn,\n\t\tisolationLevel: IsolationLevel,\n\t\tfn: (trx: Transaction) => Promise<void>,\n\t): Promise<void>;\n\n\tabstract destroy(conn: TConn): Promise<void>;\n\t/**\n\t * Creates a new VitestPostgresTransactionIsolator instance.\n\t *\n\t * @param api - The Vitest test API (usually the `test` export from vitest)\n\t */\n\tconstructor(private readonly api: TestAPI) {}\n\n\t/**\n\t * Creates a wrapped version of Vitest's test API that provides transaction isolation.\n\t * Each test will run within a database transaction that is automatically rolled back.\n\t *\n\t * @param options - Configuration options for transaction wrapping\n\t * @returns A wrapped test API with transaction support\n\t *\n\t * @example\n\t * ```typescript\n\t * const isolatedTest = isolator.wrapVitestWithTransaction({\n\t * connection: db,\n\t * setup: async (trx) => {\n\t * await trx.insert('settings', { key: 'test', value: 'true' });\n\t * },\n\t * fixtures: {\n\t * factory: (trx) => new Factory(trx),\n\t * },\n\t * });\n\t *\n\t * isolatedTest('test with transaction', async ({ trx, factory }) => {\n\t * const user = await factory.insert('user', { name: 'Test' });\n\t * expect(user).toBeDefined();\n\t * });\n\t * ```\n\t */\n\twrapVitestWithTransaction<Extended extends Record<string, unknown> = {}>(\n\t\toptions: TransactionWrapperOptions<TConn, Transaction, Extended>,\n\t) {\n\t\tconst {\n\t\t\tconnection,\n\t\t\tsetup,\n\t\t\tisolationLevel = IsolationLevel.REPEATABLE_READ,\n\t\t\tfixtures,\n\t\t} = options;\n\n\t\t// Build fixture definitions for additional fixtures that depend on trx\n\t\tconst additionalFixtures: Record<string, unknown> = {};\n\t\tif (fixtures) {\n\t\t\tfor (const [key, creator] of Object.entries(fixtures)) {\n\t\t\t\tadditionalFixtures[key] = async (\n\t\t\t\t\t{ trx }: { trx: Transaction },\n\t\t\t\t\tuse: (value: unknown) => Promise<void>,\n\t\t\t\t) => {\n\t\t\t\t\tconst value = await (creator as (trx: Transaction) => unknown)(trx);\n\t\t\t\t\tawait use(value);\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\ttype CombinedFixtures = DatabaseFixtures<Transaction> & Extended;\n\n\t\t// Cast to bypass Vitest's strict fixture typing which can't infer\n\t\t// dynamically built fixture objects\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tconst extendFn = this.api.extend as <T>(fixtures: any) => TestAPI<T>;\n\n\t\treturn extendFn<CombinedFixtures>({\n\t\t\t// This fixture automatically provides a transaction to each test\n\t\t\t// biome-ignore lint/correctness/noEmptyPattern: this has to be like this to satisfy Biome\n\t\t\ttrx: async ({}: {}, use: (value: Transaction) => Promise<void>) => {\n\t\t\t\t// Create a custom error class for rollback\n\t\t\t\tclass TestRollback extends Error {\n\t\t\t\t\tconstructor() {\n\t\t\t\t\t\tsuper('Test rollback');\n\t\t\t\t\t\tthis.name = 'TestRollback';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet testError: Error | undefined;\n\t\t\t\tconst conn = await connection();\n\t\t\t\ttry {\n\t\t\t\t\tawait this.transact(conn, isolationLevel, async (transaction) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Provide the transaction to the test\n\t\t\t\t\t\t\tawait setup?.(transaction);\n\t\t\t\t\t\t\tawait use(transaction);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t// Capture any test errors\n\t\t\t\t\t\t\ttestError = error as Error;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Always throw to trigger rollback\n\t\t\t\t\t\tthrow new TestRollback();\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// Only rethrow if it's not our rollback error\n\t\t\t\t\tif (!(error instanceof TestRollback)) {\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the test had an error, throw it now\n\t\t\t\t\tif (testError) {\n\t\t\t\t\t\tthrow testError;\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tawait this.destroy(conn);\n\t\t\t\t}\n\t\t\t},\n\t\t\t...additionalFixtures,\n\t\t});\n\t}\n}\n\nexport type DatabaseConnectionFn<Conn> = () => Conn | Promise<Conn>;\nexport type DatabaseConnection<Conn> = DatabaseConnectionFn<Conn>;\n\n/**\n * Options for wrapping Vitest tests with database transaction isolation.\n */\nexport interface TransactionWrapperOptions<\n\tTConn,\n\tTransaction,\n\tExtended extends Record<string, unknown> = {},\n> {\n\t/** Function that creates or returns a database connection */\n\tconnection: DatabaseConnection<TConn>;\n\t/** Optional setup function to run within the transaction before each test */\n\tsetup?: (trx: Transaction) => Promise<void>;\n\t/** Transaction isolation level (defaults to REPEATABLE_READ) */\n\tisolationLevel?: IsolationLevel;\n\t/** Additional fixtures that depend on the transaction */\n\tfixtures?: FixtureCreators<Transaction, Extended>;\n}\n\n/**\n * Type for fixture creator functions that depend on the transaction.\n * Each function receives the transaction and returns the fixture value.\n */\nexport type FixtureCreators<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n> = {\n\t[K in keyof Extended]: (\n\t\ttrx: Transaction,\n\t) => Extended[K] | Promise<Extended[K]>;\n};\n\n/**\n * The test API returned by extendWithFixtures.\n * Provides access to both the transaction (trx) and all extended fixtures.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional fixtures provided\n * @template BaseTest - The base wrapped test type\n */\nexport type TestWithExtendedFixtures<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n\tBaseTest extends ReturnType<TestAPI['extend']> = ReturnType<\n\t\tTestAPI['extend']\n\t>,\n> = BaseTest & {\n\t<C extends object>(\n\t\tname: string,\n\t\tfn: (\n\t\t\tcontext: DatabaseFixtures<Transaction> & Extended & C,\n\t\t) => Promise<void>,\n\t): void;\n\t<C extends object>(\n\t\tname: string,\n\t\toptions: object,\n\t\tfn: (\n\t\t\tcontext: DatabaseFixtures<Transaction> & Extended & C,\n\t\t) => Promise<void>,\n\t): void;\n};\n\n/**\n * Extends a wrapped test API with additional fixtures that depend on the transaction.\n * This allows composing test context with factories, repositories, or other helpers.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional context to provide\n * @param wrappedTest - The base wrapped test from wrapVitestWithTransaction\n * @param fixtures - Object mapping fixture names to creator functions\n * @returns An extended test API with both trx and the additional fixtures\n *\n * @example\n * ```typescript\n * import { wrapVitestKyselyTransaction, extendWithFixtures } from '@geekmidas/testkit/kysely';\n *\n * // Create base wrapped test\n * const baseTest = wrapVitestKyselyTransaction(test, {\n * connection: db,\n * setup: createTestTables,\n * });\n *\n * // Extend with fixtures\n * const it = extendWithFixtures(baseTest, {\n * factory: (trx) => new KyselyFactory(builders, seeds, trx),\n * userRepo: (trx) => new UserRepository(trx),\n * });\n *\n * // Use in tests - trx and all fixtures are available\n * it('should create user with factory', async ({ trx, factory, userRepo }) => {\n * const user = await factory.insert('user', { name: 'Test' });\n * expect(user).toBeDefined();\n * });\n * ```\n */\nexport function extendWithFixtures<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tT extends ReturnType<TestAPI['extend']> = any,\n>(\n\twrappedTest: T,\n\tfixtures: FixtureCreators<Transaction, Extended>,\n): TestWithExtendedFixtures<Transaction, Extended, T> {\n\t// Build fixture definitions for Vitest's extend API\n\tconst fixtureDefinitions: Record<string, any> = {};\n\n\tfor (const [key, creator] of Object.entries(fixtures)) {\n\t\tfixtureDefinitions[key] = async (\n\t\t\t{ trx }: { trx: Transaction },\n\t\t\tuse: (value: unknown) => Promise<void>,\n\t\t) => {\n\t\t\tconst value = await (creator as (trx: Transaction) => unknown)(trx);\n\t\t\tawait use(value);\n\t\t};\n\t}\n\n\treturn (wrappedTest as any).extend(fixtureDefinitions);\n}\n"],"mappings":";;;;;;;;AAgDA,IAAY,4DAAL;;;;;AAKN;;;;;AAKA;;;;;AAKA;;;;;AAKA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,IAAsB,oCAAtB,MAA4E;;;;;;CAsB3E,YAA6BA,KAAc;EAAd;CAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B7C,0BACCC,SACC;EACD,MAAM,EACL,YACA,OACA,iBAAiB,eAAe,iBAChC,UACA,GAAG;EAGJ,MAAMC,qBAA8C,CAAE;AACtD,MAAI,SACH,MAAK,MAAM,CAAC,KAAK,QAAQ,IAAI,OAAO,QAAQ,SAAS,CACpD,oBAAmB,OAAO,OACzB,EAAE,KAA2B,EAC7BC,QACI;GACJ,MAAM,QAAQ,MAAM,AAAC,QAA0C,IAAI;AACnE,SAAM,IAAI,MAAM;EAChB;EASH,MAAM,WAAW,KAAK,IAAI;AAE1B,SAAO,SAA2B;GAGjC,KAAK,OAAO,EAAM,EAAEC,QAA+C;IAElE,MAAM,qBAAqB,MAAM;KAChC,cAAc;AACb,YAAM,gBAAgB;AACtB,WAAK,OAAO;KACZ;IACD;IAED,IAAIC;IACJ,MAAM,OAAO,MAAM,YAAY;AAC/B,QAAI;AACH,WAAM,KAAK,SAAS,MAAM,gBAAgB,OAAO,gBAAgB;AAChE,UAAI;AAEH,aAAM,QAAQ,YAAY;AAC1B,aAAM,IAAI,YAAY;MACtB,SAAQ,OAAO;AAEf,mBAAY;MACZ;AAGD,YAAM,IAAI;KACV,EAAC;IACF,SAAQ,OAAO;AAEf,WAAM,iBAAiB,cACtB,OAAM;AAIP,SAAI,UACH,OAAM;IAEP,UAAS;AACT,WAAM,KAAK,QAAQ,KAAK;IACxB;GACD;GACD,GAAG;EACH,EAAC;CACF;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGD,SAAgB,mBAMfC,aACAC,UACqD;CAErD,MAAMC,qBAA0C,CAAE;AAElD,MAAK,MAAM,CAAC,KAAK,QAAQ,IAAI,OAAO,QAAQ,SAAS,CACpD,oBAAmB,OAAO,OACzB,EAAE,KAA2B,EAC7BL,QACI;EACJ,MAAM,QAAQ,MAAM,AAAC,QAA0C,IAAI;AACnE,QAAM,IAAI,MAAM;CAChB;AAGF,QAAO,AAAC,YAAoB,OAAO,mBAAmB;AACtD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"VitestTransactionIsolator-DQ7tLqgV.mjs","names":["api: TestAPI","options: TransactionWrapperOptions<TConn, Transaction, Extended>","additionalFixtures: Record<string, unknown>","use: (value: unknown) => Promise<void>","use: (value: Transaction) => Promise<void>","testError: Error | undefined","wrappedTest: T","fixtures: FixtureCreators<Transaction, Extended>","fixtureDefinitions: Record<string, any>"],"sources":["../src/VitestTransactionIsolator.ts"],"sourcesContent":["import type { TestAPI } from 'vitest';\n\n/**\n * Type definition for test fixtures that provide transaction access.\n * Used with Vitest's test.extend() API to inject transactions into tests.\n *\n * @template Transaction - The transaction type specific to the database driver\n * @template Extended - Additional context properties provided by the extend function\n */\nexport interface DatabaseFixtures<Transaction, _Extended = object> {\n\t/**\n\t * The database transaction available to the test.\n\t * All database operations should use this transaction to ensure proper rollback.\n\t */\n\ttrx: Transaction;\n}\n\n/**\n * Combined fixtures type that merges the base transaction fixture with extended context.\n */\nexport type ExtendedDatabaseFixtures<\n\tTransaction,\n\tExtended = object,\n> = DatabaseFixtures<Transaction> & Extended;\n\n/**\n * Function type for extending test context with additional properties.\n * Receives the transaction and returns additional context to be merged with { trx }.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional context to provide\n *\n * @example\n * ```typescript\n * const extendContext: ExtendContextFn<Transaction<DB>, { factory: KyselyFactory }> =\n * (trx) => ({ factory: new KyselyFactory(builders, seeds, trx) });\n * ```\n */\nexport type ExtendContextFn<Transaction, Extended> = (\n\ttrx: Transaction,\n) => Extended | Promise<Extended>;\n\n/**\n * PostgreSQL transaction isolation levels.\n * Controls the visibility of concurrent transactions.\n *\n * @see https://www.postgresql.org/docs/current/transaction-iso.html\n */\nexport enum IsolationLevel {\n\t/**\n\t * Lowest isolation level. Allows dirty reads.\n\t * Not recommended for testing.\n\t */\n\tREAD_UNCOMMITTED = 'READ UNCOMMITTED',\n\t/**\n\t * Default PostgreSQL isolation level.\n\t * Prevents dirty reads but allows non-repeatable reads.\n\t */\n\tREAD_COMMITTED = 'READ COMMITTED',\n\t/**\n\t * Prevents dirty reads and non-repeatable reads.\n\t * Recommended for most test scenarios.\n\t */\n\tREPEATABLE_READ = 'REPEATABLE READ',\n\t/**\n\t * Highest isolation level. Prevents all phenomena.\n\t * May cause performance overhead in tests.\n\t */\n\tSERIALIZABLE = 'SERIALIZABLE',\n}\n\n/**\n * Abstract base class for implementing database transaction isolation in Vitest tests.\n * Provides automatic transaction rollback after each test to maintain test isolation.\n * Subclasses must implement the transact() method for their specific database driver.\n *\n * @template TConn - The database connection type\n * @template Transaction - The transaction type\n *\n * @example\n * ```typescript\n * // Implement for your database driver\n * class MyDatabaseIsolator extends VitestPostgresTransactionIsolator<MyDB, MyTx> {\n * async transact(conn: MyDB, level: IsolationLevel, fn: (tx: MyTx) => Promise<void>) {\n * await conn.transaction(level, fn);\n * }\n * }\n *\n * // Use in tests\n * const isolator = new MyDatabaseIsolator(test);\n * const isolatedTest = isolator.wrapVitestWithTransaction(db);\n *\n * isolatedTest('should create user', async ({ trx }) => {\n * await trx.insert('users', { name: 'Test' });\n * // Data is automatically rolled back after test\n * });\n * ```\n */\nexport abstract class VitestPostgresTransactionIsolator<TConn, Transaction> {\n\t/**\n\t * Abstract method to create a transaction with the specified isolation level.\n\t * Must be implemented by subclasses for specific database drivers.\n\t *\n\t * @param conn - The database connection\n\t * @param isolationLevel - The transaction isolation level\n\t * @param fn - The function to execute within the transaction\n\t * @returns Promise that resolves when the transaction completes\n\t */\n\tabstract transact(\n\t\tconn: TConn,\n\t\tisolationLevel: IsolationLevel,\n\t\tfn: (trx: Transaction) => Promise<void>,\n\t): Promise<void>;\n\n\tabstract destroy(conn: TConn): Promise<void>;\n\t/**\n\t * Creates a new VitestPostgresTransactionIsolator instance.\n\t *\n\t * @param api - The Vitest test API (usually the `test` export from vitest)\n\t */\n\tconstructor(private readonly api: TestAPI) {}\n\n\t/**\n\t * Creates a wrapped version of Vitest's test API that provides transaction isolation.\n\t * Each test will run within a database transaction that is automatically rolled back.\n\t *\n\t * @param options - Configuration options for transaction wrapping\n\t * @returns A wrapped test API with transaction support\n\t *\n\t * @example\n\t * ```typescript\n\t * const isolatedTest = isolator.wrapVitestWithTransaction({\n\t * connection: db,\n\t * setup: async (trx) => {\n\t * await trx.insert('settings', { key: 'test', value: 'true' });\n\t * },\n\t * fixtures: {\n\t * factory: (trx) => new Factory(trx),\n\t * },\n\t * });\n\t *\n\t * isolatedTest('test with transaction', async ({ trx, factory }) => {\n\t * const user = await factory.insert('user', { name: 'Test' });\n\t * expect(user).toBeDefined();\n\t * });\n\t * ```\n\t */\n\twrapVitestWithTransaction<Extended extends Record<string, unknown> = {}>(\n\t\toptions: TransactionWrapperOptions<TConn, Transaction, Extended>,\n\t) {\n\t\tconst {\n\t\t\tconnection,\n\t\t\tsetup,\n\t\t\tisolationLevel = IsolationLevel.REPEATABLE_READ,\n\t\t\tfixtures,\n\t\t} = options;\n\n\t\t// Build fixture definitions for additional fixtures that depend on trx\n\t\tconst additionalFixtures: Record<string, unknown> = {};\n\t\tif (fixtures) {\n\t\t\tfor (const [key, creator] of Object.entries(fixtures)) {\n\t\t\t\tadditionalFixtures[key] = async (\n\t\t\t\t\t{ trx }: { trx: Transaction },\n\t\t\t\t\tuse: (value: unknown) => Promise<void>,\n\t\t\t\t) => {\n\t\t\t\t\tconst value = await (creator as (trx: Transaction) => unknown)(trx);\n\t\t\t\t\tawait use(value);\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\ttype CombinedFixtures = DatabaseFixtures<Transaction> & Extended;\n\n\t\t// Cast to bypass Vitest's strict fixture typing which can't infer\n\t\t// dynamically built fixture objects\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tconst extendFn = this.api.extend as <T>(fixtures: any) => TestAPI<T>;\n\n\t\treturn extendFn<CombinedFixtures>({\n\t\t\t// This fixture automatically provides a transaction to each test\n\t\t\t// biome-ignore lint/correctness/noEmptyPattern: this has to be like this to satisfy Biome\n\t\t\ttrx: async ({}: {}, use: (value: Transaction) => Promise<void>) => {\n\t\t\t\t// Create a custom error class for rollback\n\t\t\t\tclass TestRollback extends Error {\n\t\t\t\t\tconstructor() {\n\t\t\t\t\t\tsuper('Test rollback');\n\t\t\t\t\t\tthis.name = 'TestRollback';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet testError: Error | undefined;\n\t\t\t\tconst conn = await connection();\n\t\t\t\ttry {\n\t\t\t\t\tawait this.transact(conn, isolationLevel, async (transaction) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Provide the transaction to the test\n\t\t\t\t\t\t\tawait setup?.(transaction);\n\t\t\t\t\t\t\tawait use(transaction);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t// Capture any test errors\n\t\t\t\t\t\t\ttestError = error as Error;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Always throw to trigger rollback\n\t\t\t\t\t\tthrow new TestRollback();\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// Only rethrow if it's not our rollback error\n\t\t\t\t\tif (!(error instanceof TestRollback)) {\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the test had an error, throw it now\n\t\t\t\t\tif (testError) {\n\t\t\t\t\t\tthrow testError;\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tawait this.destroy(conn);\n\t\t\t\t}\n\t\t\t},\n\t\t\t...additionalFixtures,\n\t\t});\n\t}\n}\n\nexport type DatabaseConnectionFn<Conn> = () => Conn | Promise<Conn>;\nexport type DatabaseConnection<Conn> = DatabaseConnectionFn<Conn>;\n\n/**\n * Options for wrapping Vitest tests with database transaction isolation.\n */\nexport interface TransactionWrapperOptions<\n\tTConn,\n\tTransaction,\n\tExtended extends Record<string, unknown> = {},\n> {\n\t/** Function that creates or returns a database connection */\n\tconnection: DatabaseConnection<TConn>;\n\t/** Optional setup function to run within the transaction before each test */\n\tsetup?: (trx: Transaction) => Promise<void>;\n\t/** Transaction isolation level (defaults to REPEATABLE_READ) */\n\tisolationLevel?: IsolationLevel;\n\t/** Additional fixtures that depend on the transaction */\n\tfixtures?: FixtureCreators<Transaction, Extended>;\n}\n\n/**\n * Type for fixture creator functions that depend on the transaction.\n * Each function receives the transaction and returns the fixture value.\n */\nexport type FixtureCreators<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n> = {\n\t[K in keyof Extended]: (\n\t\ttrx: Transaction,\n\t) => Extended[K] | Promise<Extended[K]>;\n};\n\n/**\n * The test API returned by extendWithFixtures.\n * Provides access to both the transaction (trx) and all extended fixtures.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional fixtures provided\n * @template BaseTest - The base wrapped test type\n */\nexport type TestWithExtendedFixtures<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n\tBaseTest extends ReturnType<TestAPI['extend']> = ReturnType<\n\t\tTestAPI['extend']\n\t>,\n> = BaseTest & {\n\t<C extends object>(\n\t\tname: string,\n\t\tfn: (\n\t\t\tcontext: DatabaseFixtures<Transaction> & Extended & C,\n\t\t) => Promise<void>,\n\t): void;\n\t<C extends object>(\n\t\tname: string,\n\t\toptions: object,\n\t\tfn: (\n\t\t\tcontext: DatabaseFixtures<Transaction> & Extended & C,\n\t\t) => Promise<void>,\n\t): void;\n};\n\n/**\n * Extends a wrapped test API with additional fixtures that depend on the transaction.\n * This allows composing test context with factories, repositories, or other helpers.\n *\n * @template Transaction - The transaction type\n * @template Extended - The type of additional context to provide\n * @param wrappedTest - The base wrapped test from wrapVitestWithTransaction\n * @param fixtures - Object mapping fixture names to creator functions\n * @returns An extended test API with both trx and the additional fixtures\n *\n * @example\n * ```typescript\n * import { wrapVitestKyselyTransaction, extendWithFixtures } from '@geekmidas/testkit/kysely';\n *\n * // Create base wrapped test\n * const baseTest = wrapVitestKyselyTransaction(test, {\n * connection: db,\n * setup: createTestTables,\n * });\n *\n * // Extend with fixtures\n * const it = extendWithFixtures(baseTest, {\n * factory: (trx) => new KyselyFactory(builders, seeds, trx),\n * userRepo: (trx) => new UserRepository(trx),\n * });\n *\n * // Use in tests - trx and all fixtures are available\n * it('should create user with factory', async ({ trx, factory, userRepo }) => {\n * const user = await factory.insert('user', { name: 'Test' });\n * expect(user).toBeDefined();\n * });\n * ```\n */\nexport function extendWithFixtures<\n\tTransaction,\n\tExtended extends Record<string, unknown>,\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tT extends ReturnType<TestAPI['extend']> = any,\n>(\n\twrappedTest: T,\n\tfixtures: FixtureCreators<Transaction, Extended>,\n): TestWithExtendedFixtures<Transaction, Extended, T> {\n\t// Build fixture definitions for Vitest's extend API\n\tconst fixtureDefinitions: Record<string, any> = {};\n\n\tfor (const [key, creator] of Object.entries(fixtures)) {\n\t\tfixtureDefinitions[key] = async (\n\t\t\t{ trx }: { trx: Transaction },\n\t\t\tuse: (value: unknown) => Promise<void>,\n\t\t) => {\n\t\t\tconst value = await (creator as (trx: Transaction) => unknown)(trx);\n\t\t\tawait use(value);\n\t\t};\n\t}\n\n\treturn (wrappedTest as any).extend(fixtureDefinitions);\n}\n"],"mappings":";;;;;;;AAgDA,IAAY,4DAAL;;;;;AAKN;;;;;AAKA;;;;;AAKA;;;;;AAKA;;AACA;;;;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