-
Notifications
You must be signed in to change notification settings - Fork 10.3k
/
jest.config.js
33 lines (29 loc) · 1001 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
32
33
const path = require(`path`)
const glob = require(`glob`)
const pkgs = glob.sync(`./packages/*`).map(p => p.replace(/^\./, `<rootDir>`))
const reGatsby = /gatsby$/
const gatsbyDir = pkgs.find(p => reGatsby.exec(p))
const gatsbyBuildDirs = [`dist`].map(dir => path.join(gatsbyDir, dir))
const builtTestsDirs = pkgs.map(p => path.join(p, `__tests__`))
const ignoreDirs = [].concat(gatsbyBuildDirs, builtTestsDirs)
module.exports = {
notify: true,
verbose: true,
roots: pkgs,
modulePathIgnorePatterns: ignoreDirs,
coveragePathIgnorePatterns: ignoreDirs,
testPathIgnorePatterns: [
`/examples/`,
`/www/`,
`/dist/`,
`/node_modules/`,
`__tests__/fixtures`,
],
transform: { '^.+\\.js$': `<rootDir>/jest-transformer.js` },
moduleNameMapper: {
"^highlight.js$": `<rootDir>/node_modules/highlight.js/lib/index.js`,
},
// TODO: Remove this once https://github.com/facebook/jest/pull/6792 is released.
// Probably in Jest 23.4.3
testURL: `http://localhost`,
}