From 31f9856477a509122ca63216cd3aa2e158f8da21 Mon Sep 17 00:00:00 2001 From: Rasmus Porsager Date: Tue, 10 Oct 2023 15:56:35 +0200 Subject: [PATCH] Clear roles on test bootstrap --- tests/bootstrap.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/bootstrap.js b/tests/bootstrap.js index 0070c7b7..f877543a 100644 --- a/tests/bootstrap.js +++ b/tests/bootstrap.js @@ -1,15 +1,19 @@ import { spawnSync } from 'child_process' +exec('dropdb', ['postgres_js_test']) + exec('psql', ['-c', 'alter system set ssl=on']) +exec('psql', ['-c', 'drop user postgres_js_test']) exec('psql', ['-c', 'create user postgres_js_test']) exec('psql', ['-c', 'alter system set password_encryption=md5']) exec('psql', ['-c', 'select pg_reload_conf()']) +exec('psql', ['-c', 'drop user if exists postgres_js_test_md5']) exec('psql', ['-c', 'create user postgres_js_test_md5 with password \'postgres_js_test_md5\'']) exec('psql', ['-c', 'alter system set password_encryption=\'scram-sha-256\'']) exec('psql', ['-c', 'select pg_reload_conf()']) +exec('psql', ['-c', 'drop user if exists postgres_js_test_scram']) exec('psql', ['-c', 'create user postgres_js_test_scram with password \'postgres_js_test_scram\'']) -exec('dropdb', ['postgres_js_test']) exec('createdb', ['postgres_js_test']) exec('psql', ['-c', 'grant all on database postgres_js_test to postgres_js_test']) exec('psql', ['-c', 'alter database postgres_js_test owner to postgres_js_test'])