@@ -4,9 +4,6 @@ const { readFile } = require('fs');
4
4
const pgConnectionString = require ( 'pg-connection-string' ) ;
5
5
const { createPostGraphileSchema } = require ( 'postgraphile-core' ) ;
6
6
7
- // This test suite can be flaky. Increase it’s timeout.
8
- jasmine . DEFAULT_TIMEOUT_INTERVAL = 1000 * 20 ;
9
-
10
7
function readFilePromise ( filename , encoding ) {
11
8
return new Promise ( ( resolve , reject ) => {
12
9
readFile ( filename , encoding , ( err , res ) => {
@@ -37,6 +34,7 @@ const withPgClient = async (url, fn) => {
37
34
await client . release ( ) ;
38
35
} catch ( e ) {
39
36
console . error ( 'Error releasing pgClient' , e ) ;
37
+ throw e ;
40
38
}
41
39
await pgPool . end ( ) ;
42
40
}
@@ -86,7 +84,7 @@ const withPrepopulatedDb = async (fn) => {
86
84
}
87
85
} ;
88
86
89
- withPrepopulatedDb . setup = ( done ) => {
87
+ withPrepopulatedDb . setup = async ( ) => {
90
88
if ( prepopulatedDBKeepalive ) {
91
89
throw new Error ( "There's already a prepopulated DB running" ) ;
92
90
}
@@ -104,10 +102,9 @@ withPrepopulatedDb.setup = (done) => {
104
102
prepopulatedDBKeepalive . vars = await populateDatabase ( client ) ;
105
103
} catch ( e ) {
106
104
console . error ( 'FAILED TO PREPOPULATE DB!' , e . message ) ; // eslint-disable-line no-console
107
- return done ( e ) ;
105
+ throw e ;
108
106
}
109
107
await client . query ( 'SAVEPOINT pristine;' ) ;
110
- done ( ) ;
111
108
return prepopulatedDBKeepalive ;
112
109
} ) ;
113
110
} ;
0 commit comments