-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1336 from a-peltier/migrate-tests-to-jest
Migrate tests to jest runner
- Loading branch information
Showing
56 changed files
with
2,465 additions
and
3,293 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
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,10 @@ | ||
/*eslint-env node*/ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
testMatch: ['**/?(*-)+(test|tests).[tj]s?(x)'], | ||
transform: { | ||
'^.+\\.js$': path.resolve(__dirname, './jestBabelTransform.js') | ||
}, | ||
setupFilesAfterEnv: ['./jest.setup.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/*eslint-env node*/ | ||
import jsdom from 'jsdom'; | ||
import Enzyme from 'enzyme'; | ||
|
||
import Adapter from 'enzyme-adapter-react-16'; | ||
Enzyme.configure({adapter: new Adapter()}); | ||
|
||
global.document = jsdom.jsdom('<body></body>'); | ||
global.window = document.defaultView; | ||
Object.keys(document.defaultView).forEach(function mapProperties(property) { | ||
if (typeof global[property] === 'undefined') { | ||
global[property] = document.defaultView[property]; | ||
} | ||
}); | ||
|
||
global.navigator = { | ||
userAgent: 'node.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/*eslint-env node*/ | ||
const babelJest = require('babel-jest'); | ||
|
||
// see https://github.com/facebook/jest/issues/7359#issuecomment-471509996 | ||
module.exports = babelJest.createTransformer({ | ||
rootMode: 'upward' | ||
}); |
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
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
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
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
Oops, something went wrong.