From 542bfff96183a4e8c76c87dcafd070674120c57c Mon Sep 17 00:00:00 2001 From: Simone Torrisi Date: Tue, 12 Nov 2019 18:45:08 +0100 Subject: [PATCH] tests configuration update --- jest.config.js | 1 + package.json | 2 +- src/setupTests.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index aa7a4ecf2..04ffb8c2a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,6 +5,7 @@ module.exports = { moduleNameMapper: { '\\.(css|less)$': '/__mocks__/styleMock.js' }, + setupFilesAfterEnv: ['/src/setupTests.js'], transform: { '^.+\\.(js|jsx)?$': 'babel-jest', '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': diff --git a/package.json b/package.json index deae96aec..722217fa8 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "start:local-api": "env-cmd --fallback ./.env.localhost npm run build-scripts", "start:prod-api": "env-cmd --fallback ./.env.production npm run build-scripts", "build": "env-cmd --fallback ./.env.production npm run build-css && npm run copy-monaco && react-scripts --max_old_space_size=4096 build", - "test": "eslint --fix src && react-scripts test --env=jsdom --watchAll=false --coverage", + "test": "jest --no-cache -w 2 --watchAll=false --coverage", "test:unit": "jest -c jest.config.unit.js", "test:integration": "jest -c jest.config.integration.js", "eject": "react-scripts eject", diff --git a/src/setupTests.js b/src/setupTests.js index 69e0e8ce4..ccf147b6b 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -1,3 +1,4 @@ +import 'regenerator-runtime/runtime' import { configure } from 'enzyme' import Adapter from 'enzyme-adapter-react-16' import 'jest-enzyme'