Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install Babel to use it with jest & add its config
in order to suppoort ECMAScript Modules in Jest tests.
- Loading branch information
1 parent
b804831
commit 51c8ac0
Showing
4 changed files
with
2,123 additions
and
464 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,12 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: 'current' | ||
} | ||
} | ||
] | ||
] | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
testRegex: '.spec.ts$' | ||
testRegex: '.spec.ts$', | ||
transform: { | ||
'^.+\\.jsx?$': 'babel-jest' | ||
} | ||
}; |
Oops, something went wrong.