Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthachatterjee committed Jul 12, 2019
1 parent 73db465 commit 62a29dd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
5 changes: 4 additions & 1 deletion jest-transformer.js
@@ -1,2 +1,5 @@
const babelPreset = require(`babel-preset-gatsby-package`)()
module.exports = require(`babel-jest`).createTransformer(babelPreset)
module.exports = require(`babel-jest`).createTransformer({
...babelPreset,
plugins: [...babelPreset.plugins, `babel-plugin-dynamic-import-node`],
})
4 changes: 1 addition & 3 deletions jest.config.js
Expand Up @@ -35,9 +35,7 @@ module.exports = {
],
// gatsby-image includes a dynamic import in the IE polyfill
// that Node doesn't understand and needs `babel-plugin-dynamic-import-node`
// transformIgnorePatterns: [
// `/node_modules\/(?!gatsby-image\/withIEPolyfill).*/`,
// ],
// transformIgnorePatterns: [`/node_modules/`],
transform: { "^.+\\.js$": `<rootDir>/jest-transformer.js` },
moduleNameMapper: {
"^highlight.js$": `<rootDir>/node_modules/highlight.js/lib/index.js`,
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -5,6 +5,7 @@
"@babel/runtime": "^7.0.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.0.0",
"babel-plugin-dynamic-import-node": "^2.3.0",
"chokidar": "^1.7.0",
"cross-env": "^5.1.4",
"eslint": "^5.16.0",
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Expand Up @@ -4277,6 +4277,13 @@ babel-plugin-dynamic-import-node@^1.2.0:
dependencies:
babel-plugin-syntax-dynamic-import "^6.18.0"

babel-plugin-dynamic-import-node@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f"
integrity sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==
dependencies:
object.assign "^4.1.0"

babel-plugin-emotion@^10.0.7:
version "10.0.7"
resolved "https://registry.yarnpkg.com/babel-plugin-emotion/-/babel-plugin-emotion-10.0.7.tgz#3634ada6dee762140f27db07387feaec8d2cb619"
Expand Down Expand Up @@ -15891,7 +15898,7 @@ object-visit@^1.0.0:
dependencies:
isobject "^3.0.0"

object.assign@^4.0.4:
object.assign@^4.0.4, object.assign@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da"
integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==
Expand Down

0 comments on commit 62a29dd

Please sign in to comment.