Configure jest for es6 js files

This commit is contained in:
Claudio Zizza
2022-03-06 19:54:21 +01:00
parent 85196821a4
commit bc59e0b899
2 changed files with 15 additions and 0 deletions

5
.babelrc Normal file
View File

@@ -0,0 +1,5 @@
{
"presets": [
"@babel/preset-env"
]
}

10
jest.config.js Normal file
View File

@@ -0,0 +1,10 @@
module.exports = {
verbose: true,
rootDir: './',
testURL: 'http://localhost/',
testMatch: ['**/jest/**/*.test.js'],
"transform": {
"^.+\\.js$": "babel-jest",
},
testEnvironment: 'jsdom'
};