Skip to content

Commit

Permalink
remove babel stuff that was added in #15657
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthachatterjee committed Jul 12, 2019
1 parent 5e5b434 commit 1ad1371
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 115 deletions.
5 changes: 1 addition & 4 deletions jest-transformer.js
@@ -1,5 +1,2 @@
const babelPreset = require(`babel-preset-gatsby-package`)()
module.exports = require(`babel-jest`).createTransformer({
...babelPreset,
plugins: [...babelPreset.plugins, `babel-plugin-dynamic-import-node`],
})
module.exports = require(`babel-jest`).createTransformer(babelPreset)
38 changes: 19 additions & 19 deletions jest.config.js
@@ -1,24 +1,24 @@
const path = require(`path`)
const glob = require(`glob`)
const fs = require(`fs`)
const path = require(`path`);
const glob = require(`glob`);
const fs = require(`fs`);

const pkgs = glob.sync(`./packages/*`).map(p => p.replace(/^\./, `<rootDir>`))
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 reGatsby = /gatsby$/;
const gatsbyDir = pkgs.find(p => reGatsby.exec(p));
const gatsbyBuildDirs = [`dist`].map(dir => path.join(gatsbyDir, dir));
const builtTestsDirs = pkgs
.filter(p => fs.existsSync(path.join(p, `src`)))
.map(p => path.join(p, `__tests__`))
const distDirs = pkgs.map(p => path.join(p, `dist`))
.map(p => path.join(p, `__tests__`));
const distDirs = pkgs.map(p => path.join(p, `dist`));
const ignoreDirs = [`<rootDir>/packages/gatsby-dev-cli/verdaccio`].concat(
gatsbyBuildDirs,
builtTestsDirs,
distDirs
)
);

const coverageDirs = pkgs.map(p => path.join(p, `src/**/*.js`))
const useCoverage = !!process.env.GENERATE_JEST_REPORT
const coverageDirs = pkgs.map(p => path.join(p, `src/**/*.js`));
const useCoverage = !!process.env.GENERATE_JEST_REPORT;

module.exports = {
notify: true,
Expand All @@ -31,14 +31,14 @@ module.exports = {
`<rootDir>/www/`,
`<rootDir>/dist/`,
`<rootDir>/node_modules/`,
`__tests__/fixtures`,
`__tests__/fixtures`
],
transform: {
"^.+\\.js$": `<rootDir>/jest-transformer.js`,
"^.+\\.tsx?$": `<rootDir>/node_modules/ts-jest/preprocessor.js`,
"^.+\\.tsx?$": `<rootDir>/node_modules/ts-jest/preprocessor.js`
},
moduleNameMapper: {
"^highlight.js$": `<rootDir>/node_modules/highlight.js/lib/index.js`,
"^highlight.js$": `<rootDir>/node_modules/highlight.js/lib/index.js`
},
snapshotSerializers: [`jest-serializer-path`],
collectCoverage: useCoverage,
Expand All @@ -48,11 +48,11 @@ module.exports = {
lines: 45,
statements: 44,
functions: 42,
branches: 43,
},
branches: 43
}
},
collectCoverageFrom: coverageDirs,
reporters: [`default`].concat(useCoverage ? `jest-junit` : []),
testEnvironment: `jest-environment-jsdom-fourteen`,
moduleFileExtensions: [`js`, `jsx`, `ts`, `tsx`, `json`],
}
moduleFileExtensions: [`js`, `jsx`, `ts`, `tsx`, `json`]
};
92 changes: 0 additions & 92 deletions packages/gatsby-remark-graphviz/__tests__/index.js

This file was deleted.

0 comments on commit 1ad1371

Please sign in to comment.