neon-testing 2.1.1 → 2.1.2-beta.1

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.
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![Integration tests](https://github.com/starmode-base/neon-testing/actions/workflows/test.yml/badge.svg)](https://github.com/starmode-base/neon-testing/actions/workflows/test.yml)
4
4
  [![npm version](https://img.shields.io/npm/v/neon-testing)](https://www.npmjs.com/package/neon-testing)
5
5
  [![GitHub release](https://img.shields.io/github/v/release/starmode-base/neon-testing)](https://github.com/starmode-base/neon-testing/releases)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue)](LICENSE)
6
7
 
7
8
  A [Vitest](https://vitest.dev/) utility for seamless integration tests with [Neon Postgres](https://neon.com/). <!-- A [STΛR MODΞ](https://starmode.dev) open-source project. -->
8
9
 
@@ -80,9 +81,9 @@ test("database operations", async () => {
80
81
  First, add the Vite plugin to clear any existing `DATABASE_URL` environment variable before tests run, ensuring tests use isolated test databases.
81
82
 
82
83
  ```ts
83
- // vitest.config.ts or vite.config.ts
84
+ // vitest.config.ts
84
85
  import { defineConfig } from "vitest/config";
85
- import { neonTesting } from "neon-testing/utils";
86
+ import { neonTesting } from "neon-testing/vite";
86
87
 
87
88
  export default defineConfig({
88
89
  plugins: [neonTesting()],
@@ -0,0 +1,2 @@
1
+ export declare function neonTesting(): void;
2
+ //# sourceMappingURL=browser-empty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-empty.d.ts","sourceRoot":"","sources":["../browser-empty.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,SAE1B"}
@@ -0,0 +1,4 @@
1
+ export function neonTesting() {
2
+ throw new Error("neon-testing/vite is Node-only (Vite/Vitest context).");
3
+ }
4
+ //# sourceMappingURL=browser-empty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-empty.js","sourceRoot":"","sources":["../browser-empty.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW;IACzB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;AAC3E,CAAC"}
package/dist/index.js CHANGED
@@ -104,7 +104,7 @@ export function makeNeonTesting(factoryOptions) {
104
104
  }
105
105
  beforeAll(async () => {
106
106
  process.env.DATABASE_URL = await withRetry(createBranch, {
107
- maxRetries: 5,
107
+ maxRetries: 8,
108
108
  baseDelayMs: 1000,
109
109
  });
110
110
  if (options.autoCloseWebSockets) {
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,8 @@
1
+ import { neonTesting as neonTestingVite } from "./vite-plugin.js";
1
2
  export { lazySingleton } from "./singleton.js";
2
- export { neonTesting } from "./vite-plugin.js";
3
+ /**
4
+ * @deprecated Import the Vite plugin from "neon-testing/vite" instead. This
5
+ * export will be removed in the next major version.
6
+ */
7
+ export declare const neonTesting: typeof neonTestingVite;
3
8
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,WAAW,wBAAkB,CAAC"}
package/dist/utils.js CHANGED
@@ -1,3 +1,8 @@
1
+ import { neonTesting as neonTestingVite } from "./vite-plugin.js";
1
2
  export { lazySingleton } from "./singleton.js";
2
- export { neonTesting } from "./vite-plugin.js";
3
+ /**
4
+ * @deprecated Import the Vite plugin from "neon-testing/vite" instead. This
5
+ * export will be removed in the next major version.
6
+ */
7
+ export const neonTesting = neonTestingVite;
3
8
  //# sourceMappingURL=utils.js.map
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC"}
@@ -1,4 +1,7 @@
1
1
  import type { Plugin } from "vite";
2
+ /**
3
+ * Neon Testing Vite plugin
4
+ */
2
5
  export declare function neonTesting(options?: {
3
6
  /**
4
7
  * Enable debug logging.
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../vite-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,wBAAgB,WAAW,CACzB,OAAO,GAAE;IACP;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACZ,GACL,MAAM,CAyBR"}
1
+ {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../vite-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC;;GAEG;AACH,wBAAgB,WAAW,CACzB,OAAO,GAAE;IACP;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACZ,GACL,MAAM,CAyBR"}
@@ -1,4 +1,7 @@
1
1
  import { fileURLToPath } from "node:url";
2
+ /**
3
+ * Neon Testing Vite plugin
4
+ */
2
5
  export function neonTesting(options = {}) {
3
6
  return {
4
7
  name: "neon-testing-plugin",
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin.js","sourceRoot":"","sources":["../vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,UAAU,WAAW,CACzB,UAOI,EAAE;IAEN,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,wEAAwE;QACxE,iCAAiC;QACjC,OAAO,EAAE,MAAM;QACf,MAAM,CAAC,IAAI;YACT,MAAM,SAAS,GAAG,aAAa,CAC7B,IAAI,GAAG,CAAC,mBAAmB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAC9C,CAAC;YAEF,OAAO;gBACL,IAAI,EAAE;oBACJ,mEAAmE;oBACnE,UAAU,EAAE,KAAK,CAAC,IAAI,CACpB,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,CACvD;oBACD,GAAG,EAAE;wBACH,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG;wBACjB,kBAAkB,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;qBACrD;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"vite-plugin.js","sourceRoot":"","sources":["../vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,UAOI,EAAE;IAEN,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,wEAAwE;QACxE,iCAAiC;QACjC,OAAO,EAAE,MAAM;QACf,MAAM,CAAC,IAAI;YACT,MAAM,SAAS,GAAG,aAAa,CAC7B,IAAI,GAAG,CAAC,mBAAmB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAC9C,CAAC;YAEF,OAAO;gBACL,IAAI,EAAE;oBACJ,mEAAmE;oBACnE,UAAU,EAAE,KAAK,CAAC,IAAI,CACpB,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,CACvD;oBACD,GAAG,EAAE;wBACH,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG;wBACjB,kBAAkB,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;qBACrD;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neon-testing",
3
- "version": "2.1.1",
3
+ "version": "2.1.2-beta.1",
4
4
  "description": "A Vitest utility for seamless integration tests with Neon Postgres",
5
5
  "keywords": [
6
6
  "neon",
@@ -22,12 +22,17 @@
22
22
  "./utils": {
23
23
  "types": "./dist/utils.d.ts",
24
24
  "import": "./dist/utils.js"
25
+ },
26
+ "./vite": {
27
+ "types": "./dist/vite-plugin.d.ts",
28
+ "import": "./dist/vite-plugin.js"
25
29
  }
26
30
  },
27
31
  "files": [
28
32
  "dist"
29
33
  ],
30
34
  "scripts": {
35
+ "dev": "tsc --watch",
31
36
  "build": "rm -rf dist && tsc",
32
37
  "test": "vitest",
33
38
  "format": "prettier --write .",
@@ -46,7 +51,7 @@
46
51
  },
47
52
  "devDependencies": {
48
53
  "@neondatabase/serverless": "^1.0.1",
49
- "dotenv": "^17.2.1",
54
+ "dotenv": "^17.2.2",
50
55
  "drizzle-orm": "^0.44.5",
51
56
  "pg": "^8.16.3",
52
57
  "postgres": "^3.4.7",
@@ -54,5 +59,8 @@
54
59
  "typescript": "^5.9.2",
55
60
  "vite-tsconfig-paths": "^5.1.4",
56
61
  "vitest": "^3.2.4"
62
+ },
63
+ "browser": {
64
+ "./dist/vite-plugin.js": "./dist/browser-empty.js"
57
65
  }
58
66
  }