Skip to content

Commit

Permalink
jest: ignore built __tests__ (#6089)
Browse files Browse the repository at this point in the history
* jest: ignore built __tests__

currently used version of @babel/cli seems to not honor `--ignore` on windows, so __tests__ dirs are getting built, this should temporary hack, should fix some of the tests failing on appveyor

* jest: ignore gatsby built dist and cache-dir dirs
  • Loading branch information
pieh authored and m-allanson committed Jun 22, 2018
1 parent 63aa0f3 commit e01d0c1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ const glob = require(`glob`)

const pkgs = glob.sync(`./packages/*`).map(p => p.replace(/^\./, `<rootDir>`))

const distDirs = pkgs.map(p => path.join(p, `dist`))
const reGatsby = /gatsby$/
const gatsbyDir = pkgs.find(p => reGatsby.exec(p))
const gatsbyBuildDirs = [`dist`, `cache-dir`].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: distDirs,
coveragePathIgnorePatterns: distDirs,
modulePathIgnorePatterns: ignoreDirs,
coveragePathIgnorePatterns: ignoreDirs,
testPathIgnorePatterns: [
`/examples/`,
`/www/`,
Expand Down

0 comments on commit e01d0c1

Please sign in to comment.