-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.config.js
28 lines (25 loc) · 808 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
// Setup nock to disable all external calls
const nock = require('nock')
nock.disableNetConnect()
// By default, debug messages are written to the console which can make the test output confusing
// Instead, bind to stdout and hide all debug messages
const processStdoutWrite = process.stdout.write.bind(process.stdout)
process.stdout.write = (str, encoding, cb) => {
return false
}
const processStderrWrite = process.stderr.write.bind(process.stderr)
process.stderr.write = (str, encoding, cb) => {
if (str.match(/Hello/)) return false
processStderrWrite(str, encoding, cb)
}
module.exports = {
clearMocks: true,
preset: 'ts-jest',
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.ts$': 'ts-jest',
},
verbose: true,
}