@byline/db-postgres 2.2.2 → 2.2.3
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/dist/lib/test-db.js +3 -3
- package/dist/lib/test-helper.js +2 -2
- package/package.json +4 -4
package/dist/lib/test-db.js
CHANGED
|
@@ -33,7 +33,7 @@ const MIGRATIONS_FOLDER = path.resolve(__dirname, '../../src/database/migrations
|
|
|
33
33
|
*/
|
|
34
34
|
export function assertTestDatabase(connectionString) {
|
|
35
35
|
if (!connectionString) {
|
|
36
|
-
throw new Error('
|
|
36
|
+
throw new Error('BYLINE_DB_POSTGRES_CONNECTION_STRING is not set. Copy .env.test.example to .env.test.');
|
|
37
37
|
}
|
|
38
38
|
let dbName;
|
|
39
39
|
try {
|
|
@@ -41,12 +41,12 @@ export function assertTestDatabase(connectionString) {
|
|
|
41
41
|
dbName = url.pathname.replace(/^\//, '');
|
|
42
42
|
}
|
|
43
43
|
catch (err) {
|
|
44
|
-
throw new Error(`
|
|
44
|
+
throw new Error(`BYLINE_DB_POSTGRES_CONNECTION_STRING is not a valid URL: ${err.message}`);
|
|
45
45
|
}
|
|
46
46
|
if (!dbName.endsWith('_test')) {
|
|
47
47
|
throw new Error(`Refusing to run tests against database '${dbName}'. ` +
|
|
48
48
|
`Integration tests require a database whose name ends in '_test'. ` +
|
|
49
|
-
`Update
|
|
49
|
+
`Update BYLINE_DB_POSTGRES_CONNECTION_STRING in .env.test.`);
|
|
50
50
|
}
|
|
51
51
|
return dbName;
|
|
52
52
|
}
|
package/dist/lib/test-helper.js
CHANGED
|
@@ -10,9 +10,9 @@ let commandBuilders;
|
|
|
10
10
|
let queryBuilders;
|
|
11
11
|
export function setupTestDB(collections = []) {
|
|
12
12
|
if (!pool) {
|
|
13
|
-
assertTestDatabase(process.env.
|
|
13
|
+
assertTestDatabase(process.env.BYLINE_DB_POSTGRES_CONNECTION_STRING);
|
|
14
14
|
pool = new pg.Pool({
|
|
15
|
-
connectionString: process.env.
|
|
15
|
+
connectionString: process.env.BYLINE_DB_POSTGRES_CONNECTION_STRING,
|
|
16
16
|
// node:test runs each test file in its own process. Even though
|
|
17
17
|
// tests target a dedicated `byline_test` database, a pool-per-file
|
|
18
18
|
// of 20 connections × N files can still pressure Postgres's default
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@byline/db-postgres",
|
|
3
3
|
"private": false,
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
|
-
"version": "2.2.
|
|
5
|
+
"version": "2.2.3",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.9.0"
|
|
8
8
|
},
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"pg": "^8.20.0",
|
|
58
58
|
"uuid": "^14.0.0",
|
|
59
59
|
"zod": "^4.4.3",
|
|
60
|
-
"@byline/admin": "2.2.
|
|
61
|
-
"@byline/
|
|
62
|
-
"@byline/
|
|
60
|
+
"@byline/admin": "2.2.3",
|
|
61
|
+
"@byline/core": "2.2.3",
|
|
62
|
+
"@byline/auth": "2.2.3"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@biomejs/biome": "2.4.15",
|