mirror of
https://github.com/gosticks/react-table.git
synced 2026-06-28 17:10:01 +00:00
* add deps for testing * feat(tests): add jest configs * uncomment module directories path
This commit is contained in:
committed by
Tanner Linsley
parent
4a3929cd50
commit
bc3ea07c3e
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"parser": "babel-eslint",
|
||||
"extends": ["react-app", "prettier"],
|
||||
"plugins": [
|
||||
"react-hooks"
|
||||
],
|
||||
"env": {
|
||||
"es6": true
|
||||
},
|
||||
@@ -16,4 +19,4 @@
|
||||
"version": "latest"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
configs/tests/jest.common.js
Normal file
17
configs/tests/jest.common.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
moduleDirectories: [
|
||||
'node_modules',
|
||||
/*
|
||||
* make 'test/utils' available in tests, e.g.
|
||||
*
|
||||
* const {myModule} = require('utils/my-test-helper')
|
||||
*/
|
||||
__dirname,
|
||||
],
|
||||
|
||||
rootDir: path.resolve(__dirname, '../..'),
|
||||
|
||||
roots: ['<rootDir>/src', __dirname],
|
||||
};
|
||||
13
configs/tests/jest.lint.js
Normal file
13
configs/tests/jest.lint.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const {rootDir} = require('./jest.common');
|
||||
|
||||
module.exports = {
|
||||
rootDir,
|
||||
|
||||
displayName: 'lint',
|
||||
|
||||
runner: 'jest-runner-eslint',
|
||||
|
||||
testMatch: ['<rootDir>/src/**/*.js'],
|
||||
|
||||
testPathIgnorePatterns: ['node_modules', 'coverage', 'dist', '.test.js'],
|
||||
};
|
||||
15
configs/tests/jest.unit.js
Normal file
15
configs/tests/jest.unit.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const commonConfig = require('./jest.common');
|
||||
|
||||
module.exports = {
|
||||
...commonConfig,
|
||||
|
||||
displayName: 'unit',
|
||||
|
||||
coverageDirectory: '../../coverage',
|
||||
|
||||
testMatch: ['<rootDir>/tests/**/*.js'],
|
||||
|
||||
transform: {
|
||||
// '^.+\\.js$': '<rootDir>/node_modules/babel-jest',
|
||||
},
|
||||
};
|
||||
0
configs/tests/utils/.gitkeep
Normal file
0
configs/tests/utils/.gitkeep
Normal file
16
jest.config.js
Normal file
16
jest.config.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const path = require('path');
|
||||
|
||||
const lintProject = require('./configs/tests/jest.lint');
|
||||
const unitProject = require('./configs/tests/jest.unit');
|
||||
|
||||
module.exports = {
|
||||
...require('./configs/tests/jest.common'),
|
||||
|
||||
projects: [lintProject, unitProject],
|
||||
|
||||
watchPlugins: [
|
||||
'jest-watch-typeahead/filename',
|
||||
'jest-watch-typeahead/testname',
|
||||
'jest-watch-select-projects',
|
||||
],
|
||||
};
|
||||
10514
package-lock.json
generated
10514
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@@ -18,14 +18,14 @@
|
||||
"module": "dist/index.es.js",
|
||||
"jsnext:main": "dist/index.es.js",
|
||||
"scripts": {
|
||||
"test": "cross-env CI=1 react-scripts test --env=jsdom",
|
||||
"test:watch": "react-scripts test --env=jsdom",
|
||||
"test": "is-ci 'test:ci' 'test:dev'",
|
||||
"test:dev": "jest --watch",
|
||||
"test:ci": "jest",
|
||||
"build": "rollup -c",
|
||||
"start": "rollup -c -w",
|
||||
"prepare": "yarn build",
|
||||
"release": "yarn publish",
|
||||
"releaseNext": "yarn publish --tag next",
|
||||
"lint": "eslint 'src/**/*.js'"
|
||||
"releaseNext": "yarn publish --tag next"
|
||||
},
|
||||
"files": [
|
||||
"src/",
|
||||
@@ -47,6 +47,7 @@
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@babel/runtime": "^7.2.0",
|
||||
"@svgr/rollup": "^4.1.0",
|
||||
"@testing-library/react": "^8.0.4",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"babel-eslint": "9.x",
|
||||
"cross-env": "^5.1.4",
|
||||
@@ -64,8 +65,12 @@
|
||||
"eslint-plugin-react": "7.x",
|
||||
"eslint-plugin-react-hooks": "1.5.0",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"husky": "^3.0.0",
|
||||
"lint-staged": "^9.0.0",
|
||||
"is-ci-cli": "^1.1.1",
|
||||
"jest": "^24.8.0",
|
||||
"jest-cli": "^24.8.0",
|
||||
"jest-runner-eslint": "^0.7.4",
|
||||
"jest-watch-select-projects": "^0.1.2",
|
||||
"jest-watch-typeahead": "^0.3.1",
|
||||
"rollup": "^0.68.0",
|
||||
"rollup-plugin-babel": "^4.1.0",
|
||||
"rollup-plugin-commonjs": "^9.1.3",
|
||||
|
||||
0
tests/.gitkeep
Normal file
0
tests/.gitkeep
Normal file
Reference in New Issue
Block a user