-
Notifications
You must be signed in to change notification settings - Fork 142
/
Copy pathjest.config.js
31 lines (29 loc) · 997 Bytes
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const bail = (s) => {
throw new Error(s)
}
// until we find a way to avoid `punycode` we suppress the warnings in tests
process.env.NODE_NO_WARNINGS = '1'
module.exports = {
collectCoverage: true,
preset: 'ts-jest',
forceExit: true,
testEnvironment: 'node',
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/.yalc', 'util.ts'],
transformIgnorePatterns: ['!node_modules/'],
globals: {
__DATABASE__: {
host: process.env.POSTGRES_TEST_HOST || bail('POSTGRES_TEST_HOST is not defined'),
port: parseInt(process.env.POSTGRES_TEST_PORT || '5432'),
username:
process.env.POSTGRES_TEST_USERNAME ||
bail('POSTGRES_TEST_USERNAME is not defined'),
password:
process.env.POSTGRES_TEST_PASSWORD ||
bail('POSTGRES_TEST_PASSWORD is not defined'),
database:
process.env.POSTGRES_TEST_DATABASE ||
bail('POSTGRES_TEST_DATABASE is not defined'),
},
__LOG_LEVEL__: process.env.LOG_LEVEL || 'info',
},
}