From bc59e0b899e2781646c7db00fa9f3d477663ffab Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Sun, 6 Mar 2022 19:54:21 +0100 Subject: [PATCH] Configure jest for es6 js files --- .babelrc | 5 +++++ jest.config.js | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .babelrc create mode 100644 jest.config.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..a29ac99 --- /dev/null +++ b/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + "@babel/preset-env" + ] +} diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..ee58b86 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,10 @@ +module.exports = { + verbose: true, + rootDir: './', + testURL: 'http://localhost/', + testMatch: ['**/jest/**/*.test.js'], + "transform": { + "^.+\\.js$": "babel-jest", + }, + testEnvironment: 'jsdom' +};