@geekmidas/testkit 0.0.14 → 0.0.16

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 (183) hide show
  1. package/dist/{Factory-D7P3bKKb.d.mts → Factory-BZ8uMoXl.d.cts} +3 -2
  2. package/dist/{Factory-pNV7ZQ7-.d.cts → Factory-Cmr3s3-s.d.mts} +3 -2
  3. package/dist/Factory-WMhTNZ9S.cjs +2 -1
  4. package/dist/Factory-WMhTNZ9S.cjs.map +1 -0
  5. package/dist/Factory-z2m01hMj.mjs +2 -1
  6. package/dist/Factory-z2m01hMj.mjs.map +1 -0
  7. package/dist/Factory.d.cts +2 -2
  8. package/dist/Factory.d.mts +2 -2
  9. package/dist/KyselyFactory-BcYkC0t2.mjs +2 -1
  10. package/dist/KyselyFactory-BcYkC0t2.mjs.map +1 -0
  11. package/dist/KyselyFactory-Cf0o2YxO.cjs +2 -1
  12. package/dist/KyselyFactory-Cf0o2YxO.cjs.map +1 -0
  13. package/dist/{KyselyFactory-72P98y5I.d.mts → KyselyFactory-Cx3sezwH.d.mts} +4 -3
  14. package/dist/{KyselyFactory-DLBrYWxU.d.cts → KyselyFactory-DRQ83r0o.d.cts} +4 -3
  15. package/dist/KyselyFactory.d.cts +3 -3
  16. package/dist/KyselyFactory.d.mts +3 -3
  17. package/dist/ObjectionFactory-8hebmnai.mjs +2 -1
  18. package/dist/ObjectionFactory-8hebmnai.mjs.map +1 -0
  19. package/dist/{ObjectionFactory-B40NQWSe.d.mts → ObjectionFactory-C-59Hjwj.d.mts} +4 -3
  20. package/dist/{ObjectionFactory-D3l1VuyX.d.cts → ObjectionFactory-C4X78k0B.d.cts} +4 -3
  21. package/dist/ObjectionFactory-CDriunkS.cjs +2 -1
  22. package/dist/ObjectionFactory-CDriunkS.cjs.map +1 -0
  23. package/dist/ObjectionFactory.d.cts +3 -3
  24. package/dist/ObjectionFactory.d.mts +3 -3
  25. package/dist/{PostgresKyselyMigrator-_6yHZigp.d.mts → PostgresKyselyMigrator-CIx3AFSR.d.mts} +3 -2
  26. package/dist/PostgresKyselyMigrator-CQ3aUoy_.d.cts +2 -1
  27. package/dist/PostgresKyselyMigrator-CfytARcA.cjs +2 -1
  28. package/dist/PostgresKyselyMigrator-CfytARcA.cjs.map +1 -0
  29. package/dist/{PostgresKyselyMigrator-Bdhl251C.mjs → PostgresKyselyMigrator-upT-hmrz.mjs} +3 -2
  30. package/dist/PostgresKyselyMigrator-upT-hmrz.mjs.map +1 -0
  31. package/dist/PostgresKyselyMigrator.d.mts +2 -2
  32. package/dist/PostgresKyselyMigrator.mjs +2 -2
  33. package/dist/PostgresMigrator-D5UkK1_K.d.cts +2 -1
  34. package/dist/PostgresMigrator-DFcNdCvD.cjs +2 -1
  35. package/dist/PostgresMigrator-DFcNdCvD.cjs.map +1 -0
  36. package/dist/{PostgresMigrator-BlvuQl7d.d.mts → PostgresMigrator-DQaRxoaY.d.mts} +2 -1
  37. package/dist/{PostgresMigrator-DxPC_gGu.mjs → PostgresMigrator-DbuJGAVy.mjs} +4 -3
  38. package/dist/PostgresMigrator-DbuJGAVy.mjs.map +1 -0
  39. package/dist/PostgresMigrator.d.mts +1 -1
  40. package/dist/PostgresMigrator.mjs +1 -1
  41. package/dist/PostgresObjectionMigrator-BG6ymgnt.cjs +2 -1
  42. package/dist/PostgresObjectionMigrator-BG6ymgnt.cjs.map +1 -0
  43. package/dist/PostgresObjectionMigrator-CZHHcCOv.d.cts +2 -1
  44. package/dist/{PostgresObjectionMigrator-G4h5FLvU.mjs → PostgresObjectionMigrator-DPj2pOpX.mjs} +3 -2
  45. package/dist/PostgresObjectionMigrator-DPj2pOpX.mjs.map +1 -0
  46. package/dist/{PostgresObjectionMigrator-C69n7vzr.d.mts → PostgresObjectionMigrator-D_hCcrQu.d.mts} +3 -2
  47. package/dist/PostgresObjectionMigrator.d.mts +2 -2
  48. package/dist/PostgresObjectionMigrator.mjs +2 -2
  49. package/dist/{VitestKyselyTransactionIsolator-Dq4Oeh-Y.mjs → VitestKyselyTransactionIsolator-BxjlD1YM.mjs} +3 -4
  50. package/dist/VitestKyselyTransactionIsolator-BxjlD1YM.mjs.map +1 -0
  51. package/dist/{VitestKyselyTransactionIsolator-CnxpE9cH.d.mts → VitestKyselyTransactionIsolator-COCVfvfr.d.mts} +3 -2
  52. package/dist/{VitestKyselyTransactionIsolator-Dqy3qNoJ.cjs → VitestKyselyTransactionIsolator-Cst3vFjb.cjs} +3 -4
  53. package/dist/VitestKyselyTransactionIsolator-Cst3vFjb.cjs.map +1 -0
  54. package/dist/VitestKyselyTransactionIsolator-DYUYVEh9.d.cts +2 -1
  55. package/dist/VitestKyselyTransactionIsolator.cjs +1 -1
  56. package/dist/VitestKyselyTransactionIsolator.d.mts +2 -2
  57. package/dist/VitestKyselyTransactionIsolator.mjs +1 -1
  58. package/dist/{VitestObjectionTransactionIsolator-DVtJG2F3.mjs → VitestObjectionTransactionIsolator-BU-jXEhz.mjs} +3 -4
  59. package/dist/VitestObjectionTransactionIsolator-BU-jXEhz.mjs.map +1 -0
  60. package/dist/VitestObjectionTransactionIsolator-CJ4ds5Qv.d.cts +2 -1
  61. package/dist/{VitestObjectionTransactionIsolator-LP4B0cqW.cjs → VitestObjectionTransactionIsolator-DzeF4UAq.cjs} +3 -4
  62. package/dist/VitestObjectionTransactionIsolator-DzeF4UAq.cjs.map +1 -0
  63. package/dist/{VitestObjectionTransactionIsolator-DIM79dCq.d.mts → VitestObjectionTransactionIsolator-b973r9O1.d.mts} +3 -2
  64. package/dist/VitestObjectionTransactionIsolator.cjs +1 -1
  65. package/dist/VitestObjectionTransactionIsolator.d.mts +2 -2
  66. package/dist/VitestObjectionTransactionIsolator.mjs +1 -1
  67. package/dist/VitestTransactionIsolator-BQ5FpLtC.cjs +2 -1
  68. package/dist/VitestTransactionIsolator-BQ5FpLtC.cjs.map +1 -0
  69. package/dist/{VitestTransactionIsolator-zdyiS_SY.d.mts → VitestTransactionIsolator-CsfJBxcb.d.mts} +2 -1
  70. package/dist/VitestTransactionIsolator-CskiiJbW.mjs +2 -1
  71. package/dist/VitestTransactionIsolator-CskiiJbW.mjs.map +1 -0
  72. package/dist/VitestTransactionIsolator-DdLNODZg.d.cts +2 -1
  73. package/dist/VitestTransactionIsolator.d.mts +1 -1
  74. package/dist/aws.cjs +126 -0
  75. package/dist/aws.cjs.map +1 -0
  76. package/dist/aws.d.cts +22 -0
  77. package/dist/aws.d.mts +22 -0
  78. package/dist/aws.mjs +123 -0
  79. package/dist/aws.mjs.map +1 -0
  80. package/dist/directory-B-Ozljzk.mjs +22 -0
  81. package/dist/directory-B-Ozljzk.mjs.map +1 -0
  82. package/dist/directory-B4oYx02C.d.mts +12 -0
  83. package/dist/directory-BUcnztHI.d.cts +12 -0
  84. package/dist/directory-BVC8g7cX.cjs +28 -0
  85. package/dist/directory-BVC8g7cX.cjs.map +1 -0
  86. package/dist/faker-B14IEMIN.cjs +2 -1
  87. package/dist/faker-B14IEMIN.cjs.map +1 -0
  88. package/dist/faker-BGKYFoCT.mjs +2 -1
  89. package/dist/faker-BGKYFoCT.mjs.map +1 -0
  90. package/dist/{faker-BSH1EMtg.d.cts → faker-Cg76aFNO.d.cts} +4 -3
  91. package/dist/{faker-C-Iuk_R1.d.mts → faker-DHh7xs4u.d.mts} +4 -3
  92. package/dist/faker.d.cts +1 -1
  93. package/dist/faker.d.mts +1 -1
  94. package/dist/helpers.cjs +48 -2
  95. package/dist/helpers.cjs.map +1 -0
  96. package/dist/helpers.d.cts +2 -1
  97. package/dist/helpers.d.mts +2 -1
  98. package/dist/helpers.mjs +47 -2
  99. package/dist/helpers.mjs.map +1 -0
  100. package/dist/kysely.cjs +66 -3
  101. package/dist/kysely.cjs.map +1 -0
  102. package/dist/kysely.d.cts +5 -4
  103. package/dist/kysely.d.mts +9 -8
  104. package/dist/kysely.mjs +68 -5
  105. package/dist/kysely.mjs.map +1 -0
  106. package/dist/logger.cjs +23 -0
  107. package/dist/logger.cjs.map +1 -0
  108. package/dist/logger.d.cts +11 -0
  109. package/dist/logger.d.mts +11 -0
  110. package/dist/logger.mjs +22 -0
  111. package/dist/logger.mjs.map +1 -0
  112. package/dist/objection.cjs +81 -3
  113. package/dist/objection.cjs.map +1 -0
  114. package/dist/objection.d.cts +5 -4
  115. package/dist/objection.d.mts +9 -8
  116. package/dist/objection.mjs +83 -5
  117. package/dist/objection.mjs.map +1 -0
  118. package/dist/os/directory.cjs +3 -0
  119. package/dist/os/directory.d.cts +2 -0
  120. package/dist/os/directory.d.mts +2 -0
  121. package/dist/os/directory.mjs +3 -0
  122. package/dist/os/index.cjs +3 -0
  123. package/dist/os/index.d.cts +2 -0
  124. package/dist/os/index.d.mts +2 -0
  125. package/dist/os/index.mjs +3 -0
  126. package/dist/timer.cjs +9 -0
  127. package/dist/timer.cjs.map +1 -0
  128. package/dist/timer.d.cts +5 -0
  129. package/dist/timer.d.mts +5 -0
  130. package/dist/timer.mjs +8 -0
  131. package/dist/timer.mjs.map +1 -0
  132. package/package.json +25 -3
  133. package/src/VitestKyselyTransactionIsolator.ts +2 -2
  134. package/src/VitestObjectionTransactionIsolator.ts +1 -3
  135. package/src/aws.ts +131 -0
  136. package/src/logger.ts +18 -0
  137. package/src/os/directory.ts +21 -0
  138. package/src/os/index.ts +1 -0
  139. package/src/timer.ts +3 -0
  140. package/dist/__tests__/Factory.spec.cjs +0 -139
  141. package/dist/__tests__/Factory.spec.d.cts +0 -1
  142. package/dist/__tests__/Factory.spec.d.mts +0 -1
  143. package/dist/__tests__/Factory.spec.mjs +0 -138
  144. package/dist/__tests__/KyselyFactory.spec.cjs +0 -235
  145. package/dist/__tests__/KyselyFactory.spec.d.cts +0 -1
  146. package/dist/__tests__/KyselyFactory.spec.d.mts +0 -1
  147. package/dist/__tests__/KyselyFactory.spec.mjs +0 -234
  148. package/dist/__tests__/ObjectionFactory.spec.cjs +0 -340
  149. package/dist/__tests__/ObjectionFactory.spec.d.cts +0 -1
  150. package/dist/__tests__/ObjectionFactory.spec.d.mts +0 -1
  151. package/dist/__tests__/ObjectionFactory.spec.mjs +0 -339
  152. package/dist/__tests__/PostgresKyselyMigrator.spec.cjs +0 -397
  153. package/dist/__tests__/PostgresKyselyMigrator.spec.d.cts +0 -1
  154. package/dist/__tests__/PostgresKyselyMigrator.spec.d.mts +0 -1
  155. package/dist/__tests__/PostgresKyselyMigrator.spec.mjs +0 -396
  156. package/dist/__tests__/PostgresMigrator.spec.cjs +0 -256
  157. package/dist/__tests__/PostgresMigrator.spec.d.cts +0 -1
  158. package/dist/__tests__/PostgresMigrator.spec.d.mts +0 -1
  159. package/dist/__tests__/PostgresMigrator.spec.mjs +0 -255
  160. package/dist/__tests__/PostgresObjectionMigrator.spec.cjs +0 -432
  161. package/dist/__tests__/PostgresObjectionMigrator.spec.d.cts +0 -1
  162. package/dist/__tests__/PostgresObjectionMigrator.spec.d.mts +0 -1
  163. package/dist/__tests__/PostgresObjectionMigrator.spec.mjs +0 -431
  164. package/dist/__tests__/VitestObjectionTransactionIsolator.spec.cjs +0 -122
  165. package/dist/__tests__/VitestObjectionTransactionIsolator.spec.d.cts +0 -1
  166. package/dist/__tests__/VitestObjectionTransactionIsolator.spec.d.mts +0 -1
  167. package/dist/__tests__/VitestObjectionTransactionIsolator.spec.mjs +0 -121
  168. package/dist/__tests__/faker.spec.cjs +0 -115
  169. package/dist/__tests__/faker.spec.d.cts +0 -1
  170. package/dist/__tests__/faker.spec.d.mts +0 -1
  171. package/dist/__tests__/faker.spec.mjs +0 -114
  172. package/dist/__tests__/integration.spec.cjs +0 -282
  173. package/dist/__tests__/integration.spec.d.cts +0 -1
  174. package/dist/__tests__/integration.spec.d.mts +0 -1
  175. package/dist/__tests__/integration.spec.mjs +0 -281
  176. package/dist/helpers-B4TXg3Wp.mjs +0 -86
  177. package/dist/helpers-Bf0nXhbu.cjs +0 -116
  178. package/dist/helpers-BuPmgzyQ.mjs +0 -47
  179. package/dist/helpers-nEUtQ7eo.cjs +0 -53
  180. package/dist/kysely-BsDbvw3r.mjs +0 -67
  181. package/dist/kysely-CP1iJMvq.cjs +0 -72
  182. package/dist/objection-BEPk9h-g.mjs +0 -82
  183. package/dist/objection-Di7JSist.cjs +0 -87
package/dist/kysely.mjs CHANGED
@@ -1,10 +1,73 @@
1
1
  import "./Factory-z2m01hMj.mjs";
2
2
  import "./faker-BGKYFoCT.mjs";
3
3
  import { KyselyFactory } from "./KyselyFactory-BcYkC0t2.mjs";
4
- import "./PostgresMigrator-DxPC_gGu.mjs";
5
- import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-Bdhl251C.mjs";
4
+ import "./PostgresMigrator-DbuJGAVy.mjs";
5
+ import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-upT-hmrz.mjs";
6
6
  import { IsolationLevel } from "./VitestTransactionIsolator-CskiiJbW.mjs";
7
- import { VitestKyselyTransactionIsolator } from "./VitestKyselyTransactionIsolator-Dq4Oeh-Y.mjs";
8
- import { wrapVitestKyselyTransaction } from "./kysely-BsDbvw3r.mjs";
7
+ import { VitestKyselyTransactionIsolator } from "./VitestKyselyTransactionIsolator-BxjlD1YM.mjs";
9
8
 
10
- export { IsolationLevel, KyselyFactory, PostgresKyselyMigrator, VitestKyselyTransactionIsolator, wrapVitestKyselyTransaction };
9
+ //#region src/kysely.ts
10
+ /**
11
+ * Creates a wrapped Vitest test API with automatic transaction rollback for Kysely.
12
+ * Each test runs in an isolated database transaction that is rolled back after completion.
13
+ * This ensures tests don't affect each other's data and run faster than truncating tables.
14
+ *
15
+ * @template Database - The database schema type
16
+ * @param api - The Vitest test API (usually `test` from vitest)
17
+ * @param db - The Kysely database instance
18
+ * @param setup - Optional setup function to run before each test in the transaction
19
+ * @param level - Transaction isolation level (defaults to REPEATABLE_READ)
20
+ * @returns A wrapped test API that provides transaction isolation
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * import { test } from 'vitest';
25
+ * import { wrapVitestKyselyTransaction } from '@geekmidas/testkit/kysely';
26
+ * import { db } from './database';
27
+ *
28
+ * // Create isolated test with automatic rollback
29
+ * const isolatedTest = wrapVitestKyselyTransaction(test, db);
30
+ *
31
+ * // Use in tests - each test gets its own transaction
32
+ * isolatedTest('should create user', async ({ trx }) => {
33
+ * const user = await trx
34
+ * .insertInto('users')
35
+ * .values({ name: 'Test User', email: 'test@example.com' })
36
+ * .returningAll()
37
+ * .executeTakeFirst();
38
+ *
39
+ * expect(user).toBeDefined();
40
+ * // User is automatically rolled back after test
41
+ * });
42
+ *
43
+ * // With setup function for common test data
44
+ * const testWithSetup = wrapVitestKyselyTransaction(
45
+ * test,
46
+ * db,
47
+ * async (trx) => {
48
+ * // Create common test data
49
+ * await trx.insertInto('settings')
50
+ * .values({ key: 'test_mode', value: 'true' })
51
+ * .execute();
52
+ * }
53
+ * );
54
+ *
55
+ * testWithSetup('should have test settings', async ({ trx }) => {
56
+ * const setting = await trx
57
+ * .selectFrom('settings')
58
+ * .where('key', '=', 'test_mode')
59
+ * .selectAll()
60
+ * .executeTakeFirst();
61
+ *
62
+ * expect(setting?.value).toBe('true');
63
+ * });
64
+ * ```
65
+ */
66
+ function wrapVitestKyselyTransaction(api, connection, setup, level = IsolationLevel.REPEATABLE_READ) {
67
+ const wrapper = new VitestKyselyTransactionIsolator(api);
68
+ return wrapper.wrapVitestWithTransaction(connection, setup, level);
69
+ }
70
+
71
+ //#endregion
72
+ export { IsolationLevel, KyselyFactory, PostgresKyselyMigrator, VitestKyselyTransactionIsolator, wrapVitestKyselyTransaction };
73
+ //# sourceMappingURL=kysely.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kysely.mjs","names":["api: TestAPI","connection: DatabaseConnection<Kysely<Database>>","setup?: (trx: Transaction<Database>) => Promise<void>","level: IsolationLevel"],"sources":["../src/kysely.ts"],"sourcesContent":["import type { Kysely, Transaction } from 'kysely';\nimport type { TestAPI } from 'vitest';\nimport { VitestKyselyTransactionIsolator } from './VitestKyselyTransactionIsolator';\nimport {\n type DatabaseConnection,\n IsolationLevel,\n} from './VitestTransactionIsolator';\n\n/**\n * Kysely-specific exports for test utilities.\n * Provides factories, migrators, and transaction isolators for Kysely ORM.\n */\n\nexport { KyselyFactory } from './KyselyFactory';\nexport { PostgresKyselyMigrator } from './PostgresKyselyMigrator';\nexport { VitestKyselyTransactionIsolator } from './VitestKyselyTransactionIsolator';\nexport { IsolationLevel } from './VitestTransactionIsolator';\n\n/**\n * Creates a wrapped Vitest test API with automatic transaction rollback for Kysely.\n * Each test runs in an isolated database transaction that is rolled back after completion.\n * This ensures tests don't affect each other's data and run faster than truncating tables.\n *\n * @template Database - The database schema type\n * @param api - The Vitest test API (usually `test` from vitest)\n * @param db - The Kysely database instance\n * @param setup - Optional setup function to run before each test in the transaction\n * @param level - Transaction isolation level (defaults to REPEATABLE_READ)\n * @returns A wrapped test API that provides transaction isolation\n *\n * @example\n * ```typescript\n * import { test } from 'vitest';\n * import { wrapVitestKyselyTransaction } from '@geekmidas/testkit/kysely';\n * import { db } from './database';\n *\n * // Create isolated test with automatic rollback\n * const isolatedTest = wrapVitestKyselyTransaction(test, db);\n *\n * // Use in tests - each test gets its own transaction\n * isolatedTest('should create user', async ({ trx }) => {\n * const user = await trx\n * .insertInto('users')\n * .values({ name: 'Test User', email: 'test@example.com' })\n * .returningAll()\n * .executeTakeFirst();\n *\n * expect(user).toBeDefined();\n * // User is automatically rolled back after test\n * });\n *\n * // With setup function for common test data\n * const testWithSetup = wrapVitestKyselyTransaction(\n * test,\n * db,\n * async (trx) => {\n * // Create common test data\n * await trx.insertInto('settings')\n * .values({ key: 'test_mode', value: 'true' })\n * .execute();\n * }\n * );\n *\n * testWithSetup('should have test settings', async ({ trx }) => {\n * const setting = await trx\n * .selectFrom('settings')\n * .where('key', '=', 'test_mode')\n * .selectAll()\n * .executeTakeFirst();\n *\n * expect(setting?.value).toBe('true');\n * });\n * ```\n */\nexport function wrapVitestKyselyTransaction<Database>(\n api: TestAPI,\n connection: DatabaseConnection<Kysely<Database>>,\n setup?: (trx: Transaction<Database>) => Promise<void>,\n level: IsolationLevel = IsolationLevel.REPEATABLE_READ,\n) {\n const wrapper = new VitestKyselyTransactionIsolator<Database>(api);\n\n return wrapper.wrapVitestWithTransaction(connection, setup, level);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,SAAgB,4BACdA,KACAC,YACAC,OACAC,QAAwB,eAAe,iBACvC;CACA,MAAM,UAAU,IAAI,gCAA0C;AAE9D,QAAO,QAAQ,0BAA0B,YAAY,OAAO,MAAM;AACnE"}
@@ -0,0 +1,23 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ const vitest = require_chunk.__toESM(require("vitest"));
3
+
4
+ //#region src/logger.ts
5
+ /**
6
+ * Creates a mock Logger for testing
7
+ */
8
+ function createMockLogger() {
9
+ const logger = {
10
+ debug: vitest.vi.fn(),
11
+ info: vitest.vi.fn(),
12
+ warn: vitest.vi.fn(),
13
+ error: vitest.vi.fn(),
14
+ fatal: vitest.vi.fn(),
15
+ trace: vitest.vi.fn(),
16
+ child: vitest.vi.fn(() => logger)
17
+ };
18
+ return logger;
19
+ }
20
+
21
+ //#endregion
22
+ exports.createMockLogger = createMockLogger;
23
+ //# sourceMappingURL=logger.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.cjs","names":["logger: Logger"],"sources":["../src/logger.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport { vi } from 'vitest';\n\n/**\n * Creates a mock Logger for testing\n */\nexport function createMockLogger(): Logger {\n const logger: Logger = {\n debug: vi.fn(),\n info: vi.fn(),\n warn: vi.fn(),\n error: vi.fn(),\n fatal: vi.fn(),\n trace: vi.fn(),\n child: vi.fn(() => logger),\n };\n return logger;\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,mBAA2B;CACzC,MAAMA,SAAiB;EACrB,OAAO,UAAG,IAAI;EACd,MAAM,UAAG,IAAI;EACb,MAAM,UAAG,IAAI;EACb,OAAO,UAAG,IAAI;EACd,OAAO,UAAG,IAAI;EACd,OAAO,UAAG,IAAI;EACd,OAAO,UAAG,GAAG,MAAM,OAAO;CAC3B;AACD,QAAO;AACR"}
@@ -0,0 +1,11 @@
1
+ import { Logger } from "@geekmidas/logger";
2
+
3
+ //#region src/logger.d.ts
4
+
5
+ /**
6
+ * Creates a mock Logger for testing
7
+ */
8
+ declare function createMockLogger(): Logger;
9
+ //#endregion
10
+ export { createMockLogger };
11
+ //# sourceMappingURL=logger.d.cts.map
@@ -0,0 +1,11 @@
1
+ import { Logger } from "@geekmidas/logger";
2
+
3
+ //#region src/logger.d.ts
4
+
5
+ /**
6
+ * Creates a mock Logger for testing
7
+ */
8
+ declare function createMockLogger(): Logger;
9
+ //#endregion
10
+ export { createMockLogger };
11
+ //# sourceMappingURL=logger.d.mts.map
@@ -0,0 +1,22 @@
1
+ import { vi } from "vitest";
2
+
3
+ //#region src/logger.ts
4
+ /**
5
+ * Creates a mock Logger for testing
6
+ */
7
+ function createMockLogger() {
8
+ const logger = {
9
+ debug: vi.fn(),
10
+ info: vi.fn(),
11
+ warn: vi.fn(),
12
+ error: vi.fn(),
13
+ fatal: vi.fn(),
14
+ trace: vi.fn(),
15
+ child: vi.fn(() => logger)
16
+ };
17
+ return logger;
18
+ }
19
+
20
+ //#endregion
21
+ export { createMockLogger };
22
+ //# sourceMappingURL=logger.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.mjs","names":["logger: Logger"],"sources":["../src/logger.ts"],"sourcesContent":["import type { Logger } from '@geekmidas/logger';\nimport { vi } from 'vitest';\n\n/**\n * Creates a mock Logger for testing\n */\nexport function createMockLogger(): Logger {\n const logger: Logger = {\n debug: vi.fn(),\n info: vi.fn(),\n warn: vi.fn(),\n error: vi.fn(),\n fatal: vi.fn(),\n trace: vi.fn(),\n child: vi.fn(() => logger),\n };\n return logger;\n}\n"],"mappings":";;;;;;AAMA,SAAgB,mBAA2B;CACzC,MAAMA,SAAiB;EACrB,OAAO,GAAG,IAAI;EACd,MAAM,GAAG,IAAI;EACb,MAAM,GAAG,IAAI;EACb,OAAO,GAAG,IAAI;EACd,OAAO,GAAG,IAAI;EACd,OAAO,GAAG,IAAI;EACd,OAAO,GAAG,GAAG,MAAM,OAAO;CAC3B;AACD,QAAO;AACR"}
@@ -4,11 +4,89 @@ const require_ObjectionFactory = require('./ObjectionFactory-CDriunkS.cjs');
4
4
  require('./PostgresMigrator-DFcNdCvD.cjs');
5
5
  const require_PostgresObjectionMigrator = require('./PostgresObjectionMigrator-BG6ymgnt.cjs');
6
6
  const require_VitestTransactionIsolator = require('./VitestTransactionIsolator-BQ5FpLtC.cjs');
7
- const require_VitestObjectionTransactionIsolator = require('./VitestObjectionTransactionIsolator-LP4B0cqW.cjs');
8
- const require_objection = require('./objection-Di7JSist.cjs');
7
+ const require_VitestObjectionTransactionIsolator = require('./VitestObjectionTransactionIsolator-DzeF4UAq.cjs');
9
8
 
9
+ //#region src/objection.ts
10
+ /**
11
+ * Creates a wrapped Vitest test API with automatic transaction rollback for Objection.js.
12
+ * Each test runs in an isolated database transaction that is rolled back after completion.
13
+ * This ensures tests don't affect each other's data and run faster than truncating tables.
14
+ *
15
+ * @param api - The Vitest test API (usually `test` from vitest)
16
+ * @param conn - The Knex database connection instance
17
+ * @param setup - Optional setup function to run before each test in the transaction
18
+ * @param level - Transaction isolation level (defaults to REPEATABLE_READ)
19
+ * @returns A wrapped test API that provides transaction isolation
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * import { test } from 'vitest';
24
+ * import { wrapVitestObjectionTransaction } from '@geekmidas/testkit/objection';
25
+ * import { knex } from './database';
26
+ * import { User, Post } from './models';
27
+ *
28
+ * // Create isolated test with automatic rollback
29
+ * const isolatedTest = wrapVitestObjectionTransaction(test, knex);
30
+ *
31
+ * // Use in tests - each test gets its own transaction
32
+ * isolatedTest('should create user', async ({ trx }) => {
33
+ * const user = await User.query(trx)
34
+ * .insert({ name: 'Test User', email: 'test@example.com' });
35
+ *
36
+ * expect(user).toBeDefined();
37
+ * // User is automatically rolled back after test
38
+ * });
39
+ *
40
+ * // With setup function for common test data
41
+ * const testWithSetup = wrapVitestObjectionTransaction(
42
+ * test,
43
+ * knex,
44
+ * async (trx) => {
45
+ * // Create common test data
46
+ * await knex('settings')
47
+ * .transacting(trx)
48
+ * .insert({ key: 'test_mode', value: 'true' });
49
+ * }
50
+ * );
51
+ *
52
+ * testWithSetup('should have test settings', async ({ trx }) => {
53
+ * const setting = await knex('settings')
54
+ * .transacting(trx)
55
+ * .where('key', 'test_mode')
56
+ * .first();
57
+ *
58
+ * expect(setting?.value).toBe('true');
59
+ * });
60
+ *
61
+ * // Example with factory and transaction
62
+ * const isolatedTest = wrapVitestObjectionTransaction(test, knex);
63
+ * const factory = new ObjectionFactory(builders, seeds, knex);
64
+ *
65
+ * isolatedTest('creates related data', async ({ trx }) => {
66
+ * // Factory can use the transaction
67
+ * const user = await User.query(trx).insert({ name: 'Author' });
68
+ * const posts = await Post.query(trx).insert([
69
+ * { title: 'Post 1', userId: user.id },
70
+ * { title: 'Post 2', userId: user.id }
71
+ * ]);
72
+ *
73
+ * const userWithPosts = await User.query(trx)
74
+ * .findById(user.id)
75
+ * .withGraphFetched('posts');
76
+ *
77
+ * expect(userWithPosts.posts).toHaveLength(2);
78
+ * });
79
+ * ```
80
+ */
81
+ function wrapVitestObjectionTransaction(api, conn, setup, level = require_VitestTransactionIsolator.IsolationLevel.REPEATABLE_READ) {
82
+ const wrapper = new require_VitestObjectionTransactionIsolator.VitestObjectionTransactionIsolator(api);
83
+ return wrapper.wrapVitestWithTransaction(conn, setup, level);
84
+ }
85
+
86
+ //#endregion
10
87
  exports.IsolationLevel = require_VitestTransactionIsolator.IsolationLevel;
11
88
  exports.ObjectionFactory = require_ObjectionFactory.ObjectionFactory;
12
89
  exports.PostgresObjectionMigrator = require_PostgresObjectionMigrator.PostgresObjectionMigrator;
13
90
  exports.VitestObjectionTransactionIsolator = require_VitestObjectionTransactionIsolator.VitestObjectionTransactionIsolator;
14
- exports.wrapVitestObjectionTransaction = require_objection.wrapVitestObjectionTransaction;
91
+ exports.wrapVitestObjectionTransaction = wrapVitestObjectionTransaction;
92
+ //# sourceMappingURL=objection.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objection.cjs","names":["api: TestAPI","conn: DatabaseConnection<Knex>","setup?: (trx: Knex.Transaction) => Promise<void>","level: IsolationLevel","IsolationLevel","VitestObjectionTransactionIsolator"],"sources":["../src/objection.ts"],"sourcesContent":["import type { Knex } from 'knex';\nimport type { TestAPI } from 'vitest';\nimport { VitestObjectionTransactionIsolator } from './VitestObjectionTransactionIsolator';\nimport {\n type DatabaseConnection,\n IsolationLevel,\n} from './VitestTransactionIsolator';\n\n/**\n * Objection.js-specific exports for test utilities.\n * Provides factory implementation for creating test data with Objection.js ORM\n * and transaction isolation for test suites.\n */\n\nexport { ObjectionFactory } from './ObjectionFactory';\nexport { VitestObjectionTransactionIsolator } from './VitestObjectionTransactionIsolator';\nexport { IsolationLevel } from './VitestTransactionIsolator';\nexport { PostgresObjectionMigrator } from './PostgresObjectionMigrator';\n\n/**\n * Creates a wrapped Vitest test API with automatic transaction rollback for Objection.js.\n * Each test runs in an isolated database transaction that is rolled back after completion.\n * This ensures tests don't affect each other's data and run faster than truncating tables.\n *\n * @param api - The Vitest test API (usually `test` from vitest)\n * @param conn - The Knex database connection instance\n * @param setup - Optional setup function to run before each test in the transaction\n * @param level - Transaction isolation level (defaults to REPEATABLE_READ)\n * @returns A wrapped test API that provides transaction isolation\n *\n * @example\n * ```typescript\n * import { test } from 'vitest';\n * import { wrapVitestObjectionTransaction } from '@geekmidas/testkit/objection';\n * import { knex } from './database';\n * import { User, Post } from './models';\n *\n * // Create isolated test with automatic rollback\n * const isolatedTest = wrapVitestObjectionTransaction(test, knex);\n *\n * // Use in tests - each test gets its own transaction\n * isolatedTest('should create user', async ({ trx }) => {\n * const user = await User.query(trx)\n * .insert({ name: 'Test User', email: 'test@example.com' });\n *\n * expect(user).toBeDefined();\n * // User is automatically rolled back after test\n * });\n *\n * // With setup function for common test data\n * const testWithSetup = wrapVitestObjectionTransaction(\n * test,\n * knex,\n * async (trx) => {\n * // Create common test data\n * await knex('settings')\n * .transacting(trx)\n * .insert({ key: 'test_mode', value: 'true' });\n * }\n * );\n *\n * testWithSetup('should have test settings', async ({ trx }) => {\n * const setting = await knex('settings')\n * .transacting(trx)\n * .where('key', 'test_mode')\n * .first();\n *\n * expect(setting?.value).toBe('true');\n * });\n *\n * // Example with factory and transaction\n * const isolatedTest = wrapVitestObjectionTransaction(test, knex);\n * const factory = new ObjectionFactory(builders, seeds, knex);\n *\n * isolatedTest('creates related data', async ({ trx }) => {\n * // Factory can use the transaction\n * const user = await User.query(trx).insert({ name: 'Author' });\n * const posts = await Post.query(trx).insert([\n * { title: 'Post 1', userId: user.id },\n * { title: 'Post 2', userId: user.id }\n * ]);\n *\n * const userWithPosts = await User.query(trx)\n * .findById(user.id)\n * .withGraphFetched('posts');\n *\n * expect(userWithPosts.posts).toHaveLength(2);\n * });\n * ```\n */\nexport function wrapVitestObjectionTransaction(\n api: TestAPI,\n conn: DatabaseConnection<Knex>,\n setup?: (trx: Knex.Transaction) => Promise<void>,\n level: IsolationLevel = IsolationLevel.REPEATABLE_READ,\n) {\n const wrapper = new VitestObjectionTransactionIsolator(api);\n\n return wrapper.wrapVitestWithTransaction(conn, setup, level);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,SAAgB,+BACdA,KACAC,MACAC,OACAC,QAAwBC,iDAAe,iBACvC;CACA,MAAM,UAAU,IAAIC,8EAAmC;AAEvD,QAAO,QAAQ,0BAA0B,MAAM,OAAO,MAAM;AAC7D"}
@@ -1,6 +1,6 @@
1
- import "./faker-BSH1EMtg.cjs";
2
- import "./Factory-pNV7ZQ7-.cjs";
3
- import { ObjectionFactory } from "./ObjectionFactory-D3l1VuyX.cjs";
1
+ import "./faker-Cg76aFNO.cjs";
2
+ import "./Factory-BZ8uMoXl.cjs";
3
+ import { ObjectionFactory } from "./ObjectionFactory-C4X78k0B.cjs";
4
4
  import "./PostgresMigrator-D5UkK1_K.cjs";
5
5
  import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-CZHHcCOv.cjs";
6
6
  import { DatabaseConnection, IsolationLevel } from "./VitestTransactionIsolator-DdLNODZg.cjs";
@@ -85,4 +85,5 @@ declare function wrapVitestObjectionTransaction(api: TestAPI, conn: DatabaseConn
85
85
  trx: Knex.Transaction<any, any[]>;
86
86
  }>;
87
87
  //#endregion
88
- export { IsolationLevel, ObjectionFactory, PostgresObjectionMigrator, VitestObjectionTransactionIsolator, wrapVitestObjectionTransaction };
88
+ export { IsolationLevel, ObjectionFactory, PostgresObjectionMigrator, VitestObjectionTransactionIsolator, wrapVitestObjectionTransaction };
89
+ //# sourceMappingURL=objection.d.cts.map
@@ -1,10 +1,10 @@
1
- import "./faker-C-Iuk_R1.mjs";
2
- import "./Factory-D7P3bKKb.mjs";
3
- import { ObjectionFactory } from "./ObjectionFactory-B40NQWSe.mjs";
4
- import "./PostgresMigrator-BlvuQl7d.mjs";
5
- import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-C69n7vzr.mjs";
6
- import { DatabaseConnection, IsolationLevel } from "./VitestTransactionIsolator-zdyiS_SY.mjs";
7
- import { VitestObjectionTransactionIsolator } from "./VitestObjectionTransactionIsolator-DIM79dCq.mjs";
1
+ import "./faker-DHh7xs4u.mjs";
2
+ import "./Factory-Cmr3s3-s.mjs";
3
+ import { ObjectionFactory } from "./ObjectionFactory-C-59Hjwj.mjs";
4
+ import "./PostgresMigrator-DQaRxoaY.mjs";
5
+ import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-D_hCcrQu.mjs";
6
+ import { DatabaseConnection, IsolationLevel } from "./VitestTransactionIsolator-CsfJBxcb.mjs";
7
+ import { VitestObjectionTransactionIsolator } from "./VitestObjectionTransactionIsolator-b973r9O1.mjs";
8
8
  import { TestAPI } from "vitest";
9
9
  import { Knex } from "knex";
10
10
 
@@ -85,4 +85,5 @@ declare function wrapVitestObjectionTransaction(api: TestAPI, conn: DatabaseConn
85
85
  trx: Knex.Transaction<any, any[]>;
86
86
  }>;
87
87
  //#endregion
88
- export { IsolationLevel, ObjectionFactory, PostgresObjectionMigrator, VitestObjectionTransactionIsolator, wrapVitestObjectionTransaction };
88
+ export { IsolationLevel, ObjectionFactory, PostgresObjectionMigrator, VitestObjectionTransactionIsolator, wrapVitestObjectionTransaction };
89
+ //# sourceMappingURL=objection.d.mts.map
@@ -1,10 +1,88 @@
1
1
  import "./Factory-z2m01hMj.mjs";
2
2
  import "./faker-BGKYFoCT.mjs";
3
3
  import { ObjectionFactory } from "./ObjectionFactory-8hebmnai.mjs";
4
- import "./PostgresMigrator-DxPC_gGu.mjs";
5
- import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-G4h5FLvU.mjs";
4
+ import "./PostgresMigrator-DbuJGAVy.mjs";
5
+ import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-DPj2pOpX.mjs";
6
6
  import { IsolationLevel } from "./VitestTransactionIsolator-CskiiJbW.mjs";
7
- import { VitestObjectionTransactionIsolator } from "./VitestObjectionTransactionIsolator-DVtJG2F3.mjs";
8
- import { wrapVitestObjectionTransaction } from "./objection-BEPk9h-g.mjs";
7
+ import { VitestObjectionTransactionIsolator } from "./VitestObjectionTransactionIsolator-BU-jXEhz.mjs";
9
8
 
10
- export { IsolationLevel, ObjectionFactory, PostgresObjectionMigrator, VitestObjectionTransactionIsolator, wrapVitestObjectionTransaction };
9
+ //#region src/objection.ts
10
+ /**
11
+ * Creates a wrapped Vitest test API with automatic transaction rollback for Objection.js.
12
+ * Each test runs in an isolated database transaction that is rolled back after completion.
13
+ * This ensures tests don't affect each other's data and run faster than truncating tables.
14
+ *
15
+ * @param api - The Vitest test API (usually `test` from vitest)
16
+ * @param conn - The Knex database connection instance
17
+ * @param setup - Optional setup function to run before each test in the transaction
18
+ * @param level - Transaction isolation level (defaults to REPEATABLE_READ)
19
+ * @returns A wrapped test API that provides transaction isolation
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * import { test } from 'vitest';
24
+ * import { wrapVitestObjectionTransaction } from '@geekmidas/testkit/objection';
25
+ * import { knex } from './database';
26
+ * import { User, Post } from './models';
27
+ *
28
+ * // Create isolated test with automatic rollback
29
+ * const isolatedTest = wrapVitestObjectionTransaction(test, knex);
30
+ *
31
+ * // Use in tests - each test gets its own transaction
32
+ * isolatedTest('should create user', async ({ trx }) => {
33
+ * const user = await User.query(trx)
34
+ * .insert({ name: 'Test User', email: 'test@example.com' });
35
+ *
36
+ * expect(user).toBeDefined();
37
+ * // User is automatically rolled back after test
38
+ * });
39
+ *
40
+ * // With setup function for common test data
41
+ * const testWithSetup = wrapVitestObjectionTransaction(
42
+ * test,
43
+ * knex,
44
+ * async (trx) => {
45
+ * // Create common test data
46
+ * await knex('settings')
47
+ * .transacting(trx)
48
+ * .insert({ key: 'test_mode', value: 'true' });
49
+ * }
50
+ * );
51
+ *
52
+ * testWithSetup('should have test settings', async ({ trx }) => {
53
+ * const setting = await knex('settings')
54
+ * .transacting(trx)
55
+ * .where('key', 'test_mode')
56
+ * .first();
57
+ *
58
+ * expect(setting?.value).toBe('true');
59
+ * });
60
+ *
61
+ * // Example with factory and transaction
62
+ * const isolatedTest = wrapVitestObjectionTransaction(test, knex);
63
+ * const factory = new ObjectionFactory(builders, seeds, knex);
64
+ *
65
+ * isolatedTest('creates related data', async ({ trx }) => {
66
+ * // Factory can use the transaction
67
+ * const user = await User.query(trx).insert({ name: 'Author' });
68
+ * const posts = await Post.query(trx).insert([
69
+ * { title: 'Post 1', userId: user.id },
70
+ * { title: 'Post 2', userId: user.id }
71
+ * ]);
72
+ *
73
+ * const userWithPosts = await User.query(trx)
74
+ * .findById(user.id)
75
+ * .withGraphFetched('posts');
76
+ *
77
+ * expect(userWithPosts.posts).toHaveLength(2);
78
+ * });
79
+ * ```
80
+ */
81
+ function wrapVitestObjectionTransaction(api, conn, setup, level = IsolationLevel.REPEATABLE_READ) {
82
+ const wrapper = new VitestObjectionTransactionIsolator(api);
83
+ return wrapper.wrapVitestWithTransaction(conn, setup, level);
84
+ }
85
+
86
+ //#endregion
87
+ export { IsolationLevel, ObjectionFactory, PostgresObjectionMigrator, VitestObjectionTransactionIsolator, wrapVitestObjectionTransaction };
88
+ //# sourceMappingURL=objection.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objection.mjs","names":["api: TestAPI","conn: DatabaseConnection<Knex>","setup?: (trx: Knex.Transaction) => Promise<void>","level: IsolationLevel"],"sources":["../src/objection.ts"],"sourcesContent":["import type { Knex } from 'knex';\nimport type { TestAPI } from 'vitest';\nimport { VitestObjectionTransactionIsolator } from './VitestObjectionTransactionIsolator';\nimport {\n type DatabaseConnection,\n IsolationLevel,\n} from './VitestTransactionIsolator';\n\n/**\n * Objection.js-specific exports for test utilities.\n * Provides factory implementation for creating test data with Objection.js ORM\n * and transaction isolation for test suites.\n */\n\nexport { ObjectionFactory } from './ObjectionFactory';\nexport { VitestObjectionTransactionIsolator } from './VitestObjectionTransactionIsolator';\nexport { IsolationLevel } from './VitestTransactionIsolator';\nexport { PostgresObjectionMigrator } from './PostgresObjectionMigrator';\n\n/**\n * Creates a wrapped Vitest test API with automatic transaction rollback for Objection.js.\n * Each test runs in an isolated database transaction that is rolled back after completion.\n * This ensures tests don't affect each other's data and run faster than truncating tables.\n *\n * @param api - The Vitest test API (usually `test` from vitest)\n * @param conn - The Knex database connection instance\n * @param setup - Optional setup function to run before each test in the transaction\n * @param level - Transaction isolation level (defaults to REPEATABLE_READ)\n * @returns A wrapped test API that provides transaction isolation\n *\n * @example\n * ```typescript\n * import { test } from 'vitest';\n * import { wrapVitestObjectionTransaction } from '@geekmidas/testkit/objection';\n * import { knex } from './database';\n * import { User, Post } from './models';\n *\n * // Create isolated test with automatic rollback\n * const isolatedTest = wrapVitestObjectionTransaction(test, knex);\n *\n * // Use in tests - each test gets its own transaction\n * isolatedTest('should create user', async ({ trx }) => {\n * const user = await User.query(trx)\n * .insert({ name: 'Test User', email: 'test@example.com' });\n *\n * expect(user).toBeDefined();\n * // User is automatically rolled back after test\n * });\n *\n * // With setup function for common test data\n * const testWithSetup = wrapVitestObjectionTransaction(\n * test,\n * knex,\n * async (trx) => {\n * // Create common test data\n * await knex('settings')\n * .transacting(trx)\n * .insert({ key: 'test_mode', value: 'true' });\n * }\n * );\n *\n * testWithSetup('should have test settings', async ({ trx }) => {\n * const setting = await knex('settings')\n * .transacting(trx)\n * .where('key', 'test_mode')\n * .first();\n *\n * expect(setting?.value).toBe('true');\n * });\n *\n * // Example with factory and transaction\n * const isolatedTest = wrapVitestObjectionTransaction(test, knex);\n * const factory = new ObjectionFactory(builders, seeds, knex);\n *\n * isolatedTest('creates related data', async ({ trx }) => {\n * // Factory can use the transaction\n * const user = await User.query(trx).insert({ name: 'Author' });\n * const posts = await Post.query(trx).insert([\n * { title: 'Post 1', userId: user.id },\n * { title: 'Post 2', userId: user.id }\n * ]);\n *\n * const userWithPosts = await User.query(trx)\n * .findById(user.id)\n * .withGraphFetched('posts');\n *\n * expect(userWithPosts.posts).toHaveLength(2);\n * });\n * ```\n */\nexport function wrapVitestObjectionTransaction(\n api: TestAPI,\n conn: DatabaseConnection<Knex>,\n setup?: (trx: Knex.Transaction) => Promise<void>,\n level: IsolationLevel = IsolationLevel.REPEATABLE_READ,\n) {\n const wrapper = new VitestObjectionTransactionIsolator(api);\n\n return wrapper.wrapVitestWithTransaction(conn, setup, level);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,SAAgB,+BACdA,KACAC,MACAC,OACAC,QAAwB,eAAe,iBACvC;CACA,MAAM,UAAU,IAAI,mCAAmC;AAEvD,QAAO,QAAQ,0BAA0B,MAAM,OAAO,MAAM;AAC7D"}
@@ -0,0 +1,3 @@
1
+ const require_directory = require('../directory-BVC8g7cX.cjs');
2
+
3
+ exports.itWithDir = require_directory.itWithDir;
@@ -0,0 +1,2 @@
1
+ import { DirectoryFixtures, itWithDir } from "../directory-BUcnztHI.cjs";
2
+ export { DirectoryFixtures, itWithDir };
@@ -0,0 +1,2 @@
1
+ import { DirectoryFixtures, itWithDir } from "../directory-B4oYx02C.mjs";
2
+ export { DirectoryFixtures, itWithDir };
@@ -0,0 +1,3 @@
1
+ import { itWithDir } from "../directory-B-Ozljzk.mjs";
2
+
3
+ export { itWithDir };
@@ -0,0 +1,3 @@
1
+ const require_directory = require('../directory-BVC8g7cX.cjs');
2
+
3
+ exports.itWithDir = require_directory.itWithDir;
@@ -0,0 +1,2 @@
1
+ import { itWithDir } from "../directory-BUcnztHI.cjs";
2
+ export { itWithDir };
@@ -0,0 +1,2 @@
1
+ import { itWithDir } from "../directory-B4oYx02C.mjs";
2
+ export { itWithDir };
@@ -0,0 +1,3 @@
1
+ import { itWithDir } from "../directory-B-Ozljzk.mjs";
2
+
3
+ export { itWithDir };
package/dist/timer.cjs ADDED
@@ -0,0 +1,9 @@
1
+
2
+ //#region src/timer.ts
3
+ function waitFor(ms) {
4
+ return new Promise((resolve) => setTimeout(resolve, ms));
5
+ }
6
+
7
+ //#endregion
8
+ exports.waitFor = waitFor;
9
+ //# sourceMappingURL=timer.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timer.cjs","names":["ms: number"],"sources":["../src/timer.ts"],"sourcesContent":["export function waitFor(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"mappings":";;AAAA,SAAgB,QAAQA,IAAY;AAClC,QAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAG;AACxD"}
@@ -0,0 +1,5 @@
1
+ //#region src/timer.d.ts
2
+ declare function waitFor(ms: number): Promise<unknown>;
3
+ //#endregion
4
+ export { waitFor };
5
+ //# sourceMappingURL=timer.d.cts.map
@@ -0,0 +1,5 @@
1
+ //#region src/timer.d.ts
2
+ declare function waitFor(ms: number): Promise<unknown>;
3
+ //#endregion
4
+ export { waitFor };
5
+ //# sourceMappingURL=timer.d.mts.map
package/dist/timer.mjs ADDED
@@ -0,0 +1,8 @@
1
+ //#region src/timer.ts
2
+ function waitFor(ms) {
3
+ return new Promise((resolve) => setTimeout(resolve, ms));
4
+ }
5
+
6
+ //#endregion
7
+ export { waitFor };
8
+ //# sourceMappingURL=timer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timer.mjs","names":["ms: number"],"sources":["../src/timer.ts"],"sourcesContent":["export function waitFor(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"mappings":";AAAA,SAAgB,QAAQA,IAAY;AAClC,QAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAG;AACxD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/testkit",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -9,19 +9,40 @@
9
9
  "import": "./dist/objection.mjs",
10
10
  "require": "./dist/objection.cjs"
11
11
  },
12
+ "./timer": {
13
+ "types": "./dist/timer.d.ts",
14
+ "import": "./dist/timer.mjs",
15
+ "require": "./dist/timer.cjs"
16
+ },
12
17
  "./kysely": {
13
18
  "types": "./dist/kysely.d.ts",
14
19
  "import": "./dist/kysely.mjs",
15
20
  "require": "./dist/kysely.cjs"
16
21
  },
22
+ "./os": {
23
+ "types": "./dist/os/index.d.ts",
24
+ "import": "./dist/os/index.mjs",
25
+ "require": "./dist/os/index.cjs"
26
+ },
17
27
  "./faker": {
18
28
  "types": "./dist/faker.d.ts",
19
29
  "import": "./dist/faker.mjs",
20
30
  "require": "./dist/faker.cjs"
31
+ },
32
+ "./aws": {
33
+ "types": "./dist/aws.d.ts",
34
+ "import": "./dist/aws.mjs",
35
+ "require": "./dist/aws.cjs"
36
+ },
37
+ "./logger": {
38
+ "types": "./dist/logger.d.ts",
39
+ "import": "./dist/logger.mjs",
40
+ "require": "./dist/logger.cjs"
21
41
  }
22
42
  },
23
43
  "dependencies": {
24
- "@faker-js/faker": "~9.9.0"
44
+ "@faker-js/faker": "~9.9.0",
45
+ "@geekmidas/logger": "0.0.1"
25
46
  },
26
47
  "devDependencies": {
27
48
  "@types/pg": "~8.15.4"
@@ -37,6 +58,7 @@
37
58
  "objection": "~3.1.5",
38
59
  "db-errors": "~0.2.3",
39
60
  "vitest": "~3.2.4",
40
- "@geekmidas/envkit": "0.0.6"
61
+ "@types/aws-lambda": ">=8.10.92",
62
+ "@geekmidas/envkit": "0.0.7"
41
63
  }
42
64
  }
@@ -47,8 +47,8 @@ export class VitestKyselyTransactionIsolator<
47
47
  Kysely<Database>,
48
48
  Transaction<Database>
49
49
  > {
50
- destroy(conn: Kysely<Database>): Promise<void> {
51
- return conn.destroy();
50
+ async destroy(conn: Kysely<Database>): Promise<void> {
51
+ // return conn.destroy();
52
52
  }
53
53
  /**
54
54
  * Creates a Kysely transaction with the specified isolation level.
@@ -36,9 +36,7 @@ export class VitestObjectionTransactionIsolator extends VitestPostgresTransactio
36
36
  Knex,
37
37
  Knex.Transaction
38
38
  > {
39
- destroy(conn: Knex<any, any[]>): Promise<void> {
40
- return conn.destroy();
41
- }
39
+ async destroy(conn: Knex<any, any[]>): Promise<void> {}
42
40
  /**
43
41
  * Creates a Knex transaction with the specified isolation level.
44
42
  * Implements the abstract transact method from VitestPostgresTransactionIsolator.