File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ module.exports = {
33 preset : 'ts-jest' ,
44 testEnvironment : 'node' ,
55 testMatch : [ '**/?(*.)+(spec|test).ts?(x)' ] ,
6+ setupFiles : [ './test/setup.js' ] , // Path to your setup file
67} ;
Original file line number Diff line number Diff line change 33 * License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
44 */
55
6- // see packages/database/pool/pool.ts for where this name is also hard coded:
7- process . env . PGDATABASE = "smc_ephemeral_testing_database" ;
8-
96import getPool , { initEphemeralDatabase } from "@cocalc/database/pool" ;
107import { uuid } from "@cocalc/util/misc" ;
118import { bulk_delete } from "./bulk-delete" ;
129
1310beforeAll ( async ( ) => {
14- await initEphemeralDatabase ( { reset : true } ) ;
11+ await initEphemeralDatabase ( { } ) ;
1512} , 15000 ) ;
1613
1714afterAll ( async ( ) => {
Original file line number Diff line number Diff line change 1414 * The quota function uses a deep copy operation on all its arguments to avoid this.
1515 */
1616
17- // see packages/database/pool/pool.ts for where this name is also hard coded:
18- process . env . PGDATABASE = "smc_ephemeral_testing_database" ;
1917
2018import { isEqual } from "lodash" ;
2119
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