From 986761b4db10d1c0021a8de75033abed6e84a540 Mon Sep 17 00:00:00 2001 From: Yury Orlov Date: Tue, 20 Mar 2018 16:04:08 +0300 Subject: [PATCH] chore: extract jest config (#863) --- packages/dx-react-core/jest.config.js | 7 ++++++ packages/dx-react-core/package.json | 5 ---- packages/dx-react-demos/jest.config.js | 25 +++++++++++++++++++ packages/dx-react-demos/package.json | 23 ----------------- .../dx-react-grid-bootstrap3/jest.config.js | 7 ++++++ .../dx-react-grid-bootstrap3/package.json | 5 ---- .../dx-react-grid-bootstrap4/jest.config.js | 10 ++++++++ .../dx-react-grid-bootstrap4/package.json | 8 ------ .../dx-react-grid-material-ui/jest.config.js | 7 ++++++ .../dx-react-grid-material-ui/package.json | 5 ---- packages/dx-react-grid/jest.config.js | 7 ++++++ packages/dx-react-grid/package.json | 5 ---- packages/dx-vue-core/jest.config.js | 7 ++++++ packages/dx-vue-core/package.json | 5 ---- packages/dx-vue-demos/jest.config.js | 10 ++++++++ packages/dx-vue-demos/package.json | 8 ------ 16 files changed, 80 insertions(+), 64 deletions(-) create mode 100644 packages/dx-react-core/jest.config.js create mode 100644 packages/dx-react-demos/jest.config.js create mode 100644 packages/dx-react-grid-bootstrap3/jest.config.js create mode 100644 packages/dx-react-grid-bootstrap4/jest.config.js create mode 100644 packages/dx-react-grid-material-ui/jest.config.js create mode 100644 packages/dx-react-grid/jest.config.js create mode 100644 packages/dx-vue-core/jest.config.js create mode 100644 packages/dx-vue-demos/jest.config.js diff --git a/packages/dx-react-core/jest.config.js b/packages/dx-react-core/jest.config.js new file mode 100644 index 0000000000..17c5fac207 --- /dev/null +++ b/packages/dx-react-core/jest.config.js @@ -0,0 +1,7 @@ +const path = require('path'); + +module.exports = { + setupFiles: [ + path.join(__dirname, './setup-enzyme.js'), + ], +}; diff --git a/packages/dx-react-core/package.json b/packages/dx-react-core/package.json index e6f410a0b2..d388fb374c 100644 --- a/packages/dx-react-core/package.json +++ b/packages/dx-react-core/package.json @@ -39,11 +39,6 @@ "lint": "eslint \"src/**\"", "lint:fix": "yarn run lint -- --fix" }, - "jest": { - "setupFiles": [ - "/setup-enzyme.js" - ] - }, "devDependencies": { "@devexpress/dx-testing": "1.1.0", "babel-core": "^6.26.0", diff --git a/packages/dx-react-demos/jest.config.js b/packages/dx-react-demos/jest.config.js new file mode 100644 index 0000000000..ae65c8ebb3 --- /dev/null +++ b/packages/dx-react-demos/jest.config.js @@ -0,0 +1,25 @@ +const path = require('path'); + +module.exports = { + transform: { + '^.+\\.jsx?$': 'babel-jest', + '^.+\\.tsx?$': 'ts-jest', + }, + moduleNameMapper: { + '\\.css$': path.join(__dirname, './css-stub.js'), + }, + moduleFileExtensions: [ + 'js', + 'json', + 'jsx', + 'node', + 'ts', + 'tsx', + ], + testMatch: [ + '**/*.test.(ts|tsx|js|jsx)', + ], + setupFiles: [ + path.join(__dirname, './setup-enzyme.js'), + ], +}; diff --git a/packages/dx-react-demos/package.json b/packages/dx-react-demos/package.json index 0d8ea22bd4..f672a93377 100644 --- a/packages/dx-react-demos/package.json +++ b/packages/dx-react-demos/package.json @@ -21,29 +21,6 @@ "lint": "eslint \"src/**/*.{js,jsx}\"", "lint:fix": "yarn run lint -- --fix" }, - "jest": { - "transform": { - "^.+\\.jsx?$": "babel-jest", - "^.+\\.tsx?$": "ts-jest" - }, - "moduleNameMapper": { - "\\.css$": "/css-stub.js" - }, - "moduleFileExtensions": [ - "js", - "json", - "jsx", - "node", - "ts", - "tsx" - ], - "setupFiles": [ - "/setup-enzyme.js" - ], - "testMatch": [ - "**/*.test.(ts|tsx|js|jsx)" - ] - }, "dependencies": { "@devexpress/dx-demo-shell": "1.1.0", "@devexpress/dx-react-core": "1.1.0", diff --git a/packages/dx-react-grid-bootstrap3/jest.config.js b/packages/dx-react-grid-bootstrap3/jest.config.js new file mode 100644 index 0000000000..17c5fac207 --- /dev/null +++ b/packages/dx-react-grid-bootstrap3/jest.config.js @@ -0,0 +1,7 @@ +const path = require('path'); + +module.exports = { + setupFiles: [ + path.join(__dirname, './setup-enzyme.js'), + ], +}; diff --git a/packages/dx-react-grid-bootstrap3/package.json b/packages/dx-react-grid-bootstrap3/package.json index 8ecb97cfb3..a8aaffc785 100644 --- a/packages/dx-react-grid-bootstrap3/package.json +++ b/packages/dx-react-grid-bootstrap3/package.json @@ -42,11 +42,6 @@ "lint": "eslint \"src/**\"", "lint:fix": "yarn run lint -- --fix" }, - "jest": { - "setupFiles": [ - "/setup-enzyme.js" - ] - }, "devDependencies": { "@devexpress/dx-grid-core": "1.1.0", "@devexpress/dx-react-core": "1.1.0", diff --git a/packages/dx-react-grid-bootstrap4/jest.config.js b/packages/dx-react-grid-bootstrap4/jest.config.js new file mode 100644 index 0000000000..d3ed3ee51d --- /dev/null +++ b/packages/dx-react-grid-bootstrap4/jest.config.js @@ -0,0 +1,10 @@ +const path = require('path'); + +module.exports = { + moduleNameMapper: { + '.css$': path.join(__dirname, './css-stub.js'), + }, + setupFiles: [ + path.join(__dirname, './setup-enzyme.js'), + ], +}; diff --git a/packages/dx-react-grid-bootstrap4/package.json b/packages/dx-react-grid-bootstrap4/package.json index e53a568490..d320e85e2e 100644 --- a/packages/dx-react-grid-bootstrap4/package.json +++ b/packages/dx-react-grid-bootstrap4/package.json @@ -43,14 +43,6 @@ "lint": "eslint \"src/**\"", "lint:fix": "yarn run lint -- --fix" }, - "jest": { - "moduleNameMapper": { - "\\.css$": "/css-stub.js" - }, - "setupFiles": [ - "/setup-enzyme.js" - ] - }, "devDependencies": { "@devexpress/dx-grid-core": "1.1.0", "@devexpress/dx-react-core": "1.1.0", diff --git a/packages/dx-react-grid-material-ui/jest.config.js b/packages/dx-react-grid-material-ui/jest.config.js new file mode 100644 index 0000000000..17c5fac207 --- /dev/null +++ b/packages/dx-react-grid-material-ui/jest.config.js @@ -0,0 +1,7 @@ +const path = require('path'); + +module.exports = { + setupFiles: [ + path.join(__dirname, './setup-enzyme.js'), + ], +}; diff --git a/packages/dx-react-grid-material-ui/package.json b/packages/dx-react-grid-material-ui/package.json index cc2929cbd4..16d9572b82 100644 --- a/packages/dx-react-grid-material-ui/package.json +++ b/packages/dx-react-grid-material-ui/package.json @@ -42,11 +42,6 @@ "lint": "eslint \"src/**\"", "lint:fix": "yarn run lint -- --fix" }, - "jest": { - "setupFiles": [ - "/setup-enzyme.js" - ] - }, "devDependencies": { "@devexpress/dx-grid-core": "1.1.0", "@devexpress/dx-react-core": "1.1.0", diff --git a/packages/dx-react-grid/jest.config.js b/packages/dx-react-grid/jest.config.js new file mode 100644 index 0000000000..17c5fac207 --- /dev/null +++ b/packages/dx-react-grid/jest.config.js @@ -0,0 +1,7 @@ +const path = require('path'); + +module.exports = { + setupFiles: [ + path.join(__dirname, './setup-enzyme.js'), + ], +}; diff --git a/packages/dx-react-grid/package.json b/packages/dx-react-grid/package.json index 839461907e..abb8cd842a 100644 --- a/packages/dx-react-grid/package.json +++ b/packages/dx-react-grid/package.json @@ -41,11 +41,6 @@ "lint": "eslint \"src/**\"", "lint:fix": "yarn run lint -- --fix" }, - "jest": { - "setupFiles": [ - "/setup-enzyme.js" - ] - }, "devDependencies": { "@devexpress/dx-core": "1.1.0", "@devexpress/dx-react-core": "1.1.0", diff --git a/packages/dx-vue-core/jest.config.js b/packages/dx-vue-core/jest.config.js new file mode 100644 index 0000000000..9cf90eb782 --- /dev/null +++ b/packages/dx-vue-core/jest.config.js @@ -0,0 +1,7 @@ +const path = require('path'); + +module.exports = { + setupFiles: [ + path.join(__dirname, './setup-vue.js'), + ], +}; diff --git a/packages/dx-vue-core/package.json b/packages/dx-vue-core/package.json index cec884de16..cba53b6550 100644 --- a/packages/dx-vue-core/package.json +++ b/packages/dx-vue-core/package.json @@ -36,11 +36,6 @@ "lint": "eslint \"src/**\"", "lint:fix": "yarn run lint -- --fix" }, - "jest": { - "setupFiles": [ - "/setup-vue.js" - ] - }, "devDependencies": { "@devexpress/dx-testing": "1.1.0", "@vue/test-utils": "^1.0.0-beta.12", diff --git a/packages/dx-vue-demos/jest.config.js b/packages/dx-vue-demos/jest.config.js new file mode 100644 index 0000000000..f487799f89 --- /dev/null +++ b/packages/dx-vue-demos/jest.config.js @@ -0,0 +1,10 @@ +const path = require('path'); + +module.exports = { + moduleNameMapper: { + '\\.css$': path.join(__dirname, './css-stub.js'), + }, + setupFiles: [ + path.join(__dirname, './setup-vue.js'), + ], +}; diff --git a/packages/dx-vue-demos/package.json b/packages/dx-vue-demos/package.json index 11040597ca..2f3526aa00 100644 --- a/packages/dx-vue-demos/package.json +++ b/packages/dx-vue-demos/package.json @@ -21,14 +21,6 @@ "lint": "eslint \"src/**/*.{js,jsx}\"", "lint:fix": "yarn run lint -- --fix" }, - "jest": { - "moduleNameMapper": { - "\\.css$": "/css-stub.js" - }, - "setupFiles": [ - "/setup-vue.js" - ] - }, "dependencies": { "@devexpress/dx-demo-shell": "1.1.0", "@devexpress/dx-vue-core": "1.1.0",