-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dependencies, .babelrc and config files to make tests work on web…
…storm
- Loading branch information
Showing
6 changed files
with
126 additions
and
163 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,14 @@ | ||
{ | ||
"presets": ["@babel/preset-react"], | ||
"plugins": [ | ||
"@babel/plugin-proposal-class-properties", | ||
"@babel/plugin-proposal-object-rest-spread", | ||
"@babel/plugin-syntax-dynamic-import", | ||
["@babel/plugin-proposal-decorators", { "legacy": true }] | ||
], | ||
"env": { | ||
"test": { | ||
"presets": ["@babel/preset-env", "@babel/preset-react"] | ||
} | ||
} | ||
} |
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,14 @@ | ||
'use strict'; | ||
|
||
// This is a custom Jest transformer turning style imports into empty objects. | ||
// http://facebook.github.io/jest/docs/en/webpack.html | ||
|
||
module.exports = { | ||
process() { | ||
return 'module.exports = {};'; | ||
}, | ||
getCacheKey() { | ||
// The output is always the same. | ||
return 'cssTransform'; | ||
}, | ||
}; |
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,12 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
|
||
// This is a custom Jest transformer turning file imports into filenames. | ||
// http://facebook.github.io/jest/docs/en/webpack.html | ||
|
||
module.exports = { | ||
process(src, filename) { | ||
return `module.exports = ${JSON.stringify(path.basename(filename))};`; | ||
}, | ||
}; |
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,11 @@ | ||
module.exports = { | ||
testMatch: [ | ||
'<rootDir>/src/**/__tests__/**/*.js?(x)', | ||
'<rootDir>/src/**/?(*.)(spec|test).js?(x)' | ||
], | ||
transform: { | ||
'^.+\\.(js|jsx|mjs)$': '<rootDir>/node_modules/babel-jest', | ||
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js', | ||
'^(?!.*\\.(js|jsx|css|json)$)': '<rootDir>/config/jest/fileTransform.js' | ||
} | ||
} |
Oops, something went wrong.