File tree Expand file tree Collapse file tree
services/libs/test-kit/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export async function openTestWorkerDatabase(): Promise<{
5353
5454/**
5555 * Truncates all public tables in the worker database.
56- * @throws {Error } If executed against a non-test database database name.
56+ * @throws {Error } If executed against a non-test database name.
5757 */
5858export async function resetTestDatabase ( qx : QueryExecutor ) : Promise < void > {
5959 const { name } = await qx . selectOne ( 'SELECT current_database() AS name' )
@@ -147,6 +147,10 @@ function getTestPostgres(): TestPostgres {
147147
148148 const port = Number ( DB_PORT )
149149
150+ if ( ! Number . isInteger ( port ) || port <= 0 || port > 65535 ) {
151+ throw new Error ( `Expected valid DB_PORT (got ${ DB_PORT } )` )
152+ }
153+
150154 if ( ! [ 'localhost' , '127.0.0.1' , '::1' ] . includes ( host ) ) {
151155 throw new Error ( `Expected local DB_HOST (got ${ host } )` )
152156 }
You can’t perform that action at this time.
0 commit comments