File tree 4 files changed +9
-6
lines changed
4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ module.exports = {
3
3
preset : 'ts-jest' ,
4
4
testEnvironment : 'node' ,
5
5
testMatch : [ '**/?(*.)+(spec|test).ts?(x)' ] ,
6
+ setupFiles : [ './test/setup.js' ] , // Path to your setup file
6
7
} ;
Original file line number Diff line number Diff line change 3
3
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
4
4
*/
5
5
6
- // see packages/database/pool/pool.ts for where this name is also hard coded:
7
- process . env . PGDATABASE = "smc_ephemeral_testing_database" ;
8
-
9
6
import getPool , { initEphemeralDatabase } from "@cocalc/database/pool" ;
10
7
import { uuid } from "@cocalc/util/misc" ;
11
8
import { bulk_delete } from "./bulk-delete" ;
12
9
13
10
beforeAll ( async ( ) => {
14
- await initEphemeralDatabase ( { reset : true } ) ;
11
+ await initEphemeralDatabase ( { } ) ;
15
12
} , 15000 ) ;
16
13
17
14
afterAll ( async ( ) => {
Original file line number Diff line number Diff line change 14
14
* The quota function uses a deep copy operation on all its arguments to avoid this.
15
15
*/
16
16
17
- // see packages/database/pool/pool.ts for where this name is also hard coded:
18
- process . env . PGDATABASE = "smc_ephemeral_testing_database" ;
19
17
20
18
import { isEqual } from "lodash" ;
21
19
Original file line number Diff line number Diff line change
1
+ // test/setup.js
2
+
3
+ // see packages/database/pool/pool.ts for where this name is also hard coded:
4
+ process . env . PGDATABASE = "smc_ephemeral_testing_database" ;
5
+
6
+ // checked for in some code to behave differently while running unit tests.
7
+ process . env . COCALC_TEST_MODE = true ;
You can’t perform that action at this time.
0 commit comments