@@ -35,6 +35,7 @@ process.noDeprecation = true;
35
35
const cache = require ( '../lib/cache' ) . default ;
36
36
const defaults = require ( '../lib/defaults' ) . default ;
37
37
const ParseServer = require ( '../lib/index' ) . ParseServer ;
38
+ const loadAdapter = require ( '../lib/Adapters/AdapterLoader' ) . loadAdapter ;
38
39
const path = require ( 'path' ) ;
39
40
const TestUtils = require ( '../lib/TestUtils' ) ;
40
41
const GridFSBucketAdapter = require ( '../lib/Adapters/Files/GridFSBucketAdapter' )
@@ -53,7 +54,10 @@ let databaseAdapter;
53
54
let databaseURI ;
54
55
// need to bind for mocking mocha
55
56
56
- if ( process . env . PARSE_SERVER_TEST_DB === 'postgres' ) {
57
+ if ( process . env . PARSE_SERVER_DATABASE_ADAPTER ) {
58
+ databaseAdapter = JSON . parse ( process . env . PARSE_SERVER_DATABASE_ADAPTER ) ;
59
+ databaseAdapter = loadAdapter ( databaseAdapter ) ;
60
+ } else if ( process . env . PARSE_SERVER_TEST_DB === 'postgres' ) {
57
61
databaseURI = process . env . PARSE_SERVER_TEST_DATABASE_URI || postgresURI ;
58
62
databaseAdapter = new PostgresStorageAdapter ( {
59
63
uri : databaseURI ,
@@ -433,8 +437,8 @@ try {
433
437
// Fetch test exclusion list
434
438
testExclusionList = require ( './testExclusionList.json' ) ;
435
439
console . log ( `Using test exclusion list with ${ testExclusionList . length } entries` ) ;
436
- } catch ( error ) {
437
- if ( error . code !== 'MODULE_NOT_FOUND' ) {
440
+ } catch ( error ) {
441
+ if ( error . code !== 'MODULE_NOT_FOUND' ) {
438
442
throw error ;
439
443
}
440
444
}
@@ -444,10 +448,8 @@ global.it_id = (id, func) => {
444
448
if ( testExclusionList . includes ( id ) ) {
445
449
return xit ;
446
450
} else {
447
- if ( func === undefined )
448
- return it ;
449
- else
450
- return func ;
451
+ if ( func === undefined ) return it ;
452
+ else return func ;
451
453
}
452
454
} ;
453
455
0 commit comments