neon-testing 1.0.0 → 1.0.2

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 (3) hide show
  1. package/README.md +13 -13
  2. package/index.ts +3 -5
  3. package/package.json +13 -13
package/README.md CHANGED
@@ -1,10 +1,14 @@
1
1
  # Neon testing
2
2
 
3
- A Vitest utility for running database tests with isolated [Neon](https://neon.com/) branches. Each test file gets its own dedicated PostgreSQL database (Neon branch), ensuring clean, parallel, and reproducible tests.
3
+ A Vitest utility for automated integration tests with [Neon](https://neon.com/).
4
+
5
+ Each test file runs against its own isolated PostgreSQL database (Neon branch), ensuring clean, parallel, and reproducible testing of code that relies on a database. Because it uses a real database, you can test code logic that depends on database features such as transaction rollbacks, unique constraints, and more.
6
+
7
+ Using an actual clone of your production database for integration testing lets you verify functionality that mocks cannot.
4
8
 
5
9
  ## Features
6
10
 
7
- - 🔄 **Isolated test environments** - Each test file runs against its own Neon branch
11
+ - 🔄 **Isolated test environments** - Each test file runs against its own Postgres database with your actual schema and constraints
8
12
  - 🧹 **Automatic cleanup** - Neon test branches are created and destroyed automatically
9
13
  - 🛡️ **TypeScript native** - No JavaScript support
10
14
  - 🎯 **ESM only** - No CommonJS support
@@ -25,7 +29,7 @@ A Vitest utility for running database tests with isolated [Neon](https://neon.co
25
29
 
26
30
  ### Install
27
31
 
28
- ```bash
32
+ ```sh
29
33
  bun add -d neon-testing
30
34
  ```
31
35
 
@@ -124,22 +128,18 @@ Tests within a single test file share the same database instance (Neon branch),
124
128
 
125
129
  This works because Vitest runs test files in parallel, but tests within each test file run one at a time.
126
130
 
127
- ## License
128
-
129
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
130
-
131
131
  ## Contributing
132
132
 
133
133
  Contributions are welcome! Please open issues or pull requests on [GitHub](https://github.com/starmode-base/neon-testing/pulls).
134
134
 
135
- ## Support
135
+ ## License
136
136
 
137
- For questions or support, open an issue on [GitHub](https://github.com/starmode-base/neon-testing/issues).
137
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
138
138
 
139
- ## Commercial support
139
+ ## Need expert help?
140
140
 
141
- Need professional help with database testing, AI integration, or modern web development?
141
+ Hi, I'm [@lirbank](https://github.com/lirbank). I take on a few consulting projects each year where I help companies build, unblock, and ship. Here's what I do:
142
142
 
143
- **[STΛR MODΞ](https://www.starmode.dev/)** - I run this AI development studio with data scientist and ML/AI expert Spencer Smith. We specialize in building AI-first applications, advanced AI workflows, and agentic networks. We help companies build reliable AI solutions.
143
+ **[STΛR MODΞ](https://www.starmode.dev/)** A boutique AI development studio I run with AI/ML expert and data scientist [@spencer-g-smith](https://github.com/spencer-g-smith). We help companies build accurate AI solutions: AI-first apps, advanced workflows, and agentic systems.
144
144
 
145
- **[Mikael Lirbank](https://www.lirbank.com/)** - My individual consulting practice for web application development, test automation, code quality, and technical architecture.
145
+ **[Mikael Lirbank](https://www.lirbank.com/)** My solo practice, focused on web app development, test automation, code quality, and technical architecture. I'm friendly and happy to help with the hard stuff.
package/index.ts CHANGED
@@ -17,7 +17,7 @@ import { afterAll, beforeAll } from "vitest";
17
17
  */
18
18
  function createConnectionUri(
19
19
  connectionParameters: ConnectionDetails,
20
- type: "pooler" | "direct"
20
+ type: "pooler" | "direct",
21
21
  ) {
22
22
  const { role, password, host, pooler_host, database } =
23
23
  connectionParameters.connection_parameters;
@@ -77,7 +77,7 @@ export function makeNeonTesting(factoryOptions: NeonTestingOptions) {
77
77
  if (isTestBranch) {
78
78
  await apiClient.deleteProjectBranch(
79
79
  factoryOptions.projectId,
80
- branch.id
80
+ branch.id,
81
81
  );
82
82
  }
83
83
  }
@@ -85,7 +85,7 @@ export function makeNeonTesting(factoryOptions: NeonTestingOptions) {
85
85
 
86
86
  const testDbSetup = (
87
87
  /** Override any factory options except apiKey */
88
- overrides?: NeonTestingOverrides
88
+ overrides?: NeonTestingOverrides,
89
89
  ) => {
90
90
  // Merge factory options with overrides
91
91
  const options = { ...factoryOptions, ...overrides };
@@ -140,8 +140,6 @@ export function makeNeonTesting(factoryOptions: NeonTestingOptions) {
140
140
  afterAll(async () => {
141
141
  await deleteBranch();
142
142
  process.env.DATABASE_URL = undefined;
143
-
144
- // await deleteAllTestBranches();
145
143
  });
146
144
  };
147
145
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "neon-testing",
3
- "version": "1.0.0",
4
- "description": "A Vitest utility for running database tests with isolated Neon branches",
3
+ "version": "1.0.2",
4
+ "description": "A Vitest utility for automated integration tests with Neon",
5
5
  "keywords": [
6
6
  "neon",
7
7
  "postgres",
@@ -16,28 +16,28 @@
16
16
  "bugs": "https://github.com/starmode-base/neon-testing/issues",
17
17
  "module": "index.ts",
18
18
  "type": "module",
19
+ "files": [
20
+ "index.ts"
21
+ ],
19
22
  "scripts": {
20
23
  "test": "vitest",
21
24
  "format": "prettier --write .",
22
- "release": "bun publish && git tag v$(bun -p \"require('./package.json').version\") && git push --tags"
25
+ "release": "bun publish",
26
+ "prepublishOnly": "git diff-index --quiet HEAD || (echo 'Error: You have uncommitted changes' && exit 1) && tsc && vitest run && prettier --check .",
27
+ "postpublish": "git tag v$(bun -p \"require('./package.json').version\") && git push --tags"
23
28
  },
24
29
  "dependencies": {
25
- "@neondatabase/api-client": "^2.0.0"
30
+ "@neondatabase/api-client": "^2.1.0"
26
31
  },
27
32
  "peerDependencies": {
28
- "typescript": "^5",
29
- "vitest": "^3"
33
+ "typescript": "^5.8.3",
34
+ "vitest": "^3.2.4"
30
35
  },
31
36
  "devDependencies": {
32
37
  "@neondatabase/serverless": "^1.0.1",
33
38
  "dotenv": "^16.5.0",
34
- "pg": "^8.16.0",
39
+ "pg": "^8.16.2",
35
40
  "postgres": "^3.4.7",
36
41
  "prettier": "^3.5.3"
37
- },
38
- "files": [
39
- "index.ts",
40
- "README.md",
41
- "LICENSE"
42
- ]
42
+ }
43
43
  }