-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: monorepo root - bump to babel@7 and jest@23
- bump to babel@7 - bump to jest@23 - move jest config from package.json to `jest.config.js` - use custom babel-jest transform options to be sure babel works correctly with `.babelrc` in monorepo
- Loading branch information
Showing
3 changed files
with
35 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const babelJest = require('babel-jest'); | ||
|
||
module.exports = babelJest.createTransformer({ | ||
// NOTE: babel 7 uses different approach with .babelrc file loading | ||
// so force it to look .babelrc on every monorepo package | ||
// https://babeljs.io/docs/en/next/config-files#6x-vs-7x-babelrc-loading | ||
// https://babeljs.io/docs/en/next/options#babelrcroots | ||
babelrcRoots: [ | ||
// Keep the root as a root | ||
'.', | ||
|
||
// Also consider monorepo packages "root" and load their .babelrc files. | ||
'./packages/*', | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
testEnvironment: 'node', | ||
transform: { | ||
'\\.js$': '<rootDir>/config/jest/babelTransform.js', | ||
}, | ||
testPathIgnorePatterns: [ | ||
'/node_modules/', | ||
'/packages/okidoc-md/lib/', | ||
'/packages/okidoc-site/site/', | ||
'/fixtures/', | ||
], | ||
collectCoverageFrom: [ | ||
'packages/okidoc-md/src/buildDocumentationSource/**/*.js', | ||
'packages/okidoc-md/src/buildMarkdown/**/*.js', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters