Skip to content
Permalink
Browse files

Feature/add jest configs ref: #1383 (#1385)

* add deps for testing

* feat(tests): add jest configs

* uncomment module directories path
  • Loading branch information...
larrybotha authored and tannerlinsley committed Jul 15, 2019
1 parent 4a3929c commit bc3ea07c3e47371a94f557b45ab0d9ff1d5f057f
Showing with 10,740 additions and 6,337 deletions.
  1. +4 −1 .eslintrc
  2. +17 −0 configs/tests/jest.common.js
  3. +13 −0 configs/tests/jest.lint.js
  4. +15 −0 configs/tests/jest.unit.js
  5. 0 configs/tests/utils/.gitkeep
  6. +16 −0 jest.config.js
  7. +7,341 −5,809 package-lock.json
  8. +11 −6 package.json
  9. 0 tests/.gitkeep
  10. +3,323 −521 yarn.lock
@@ -1,6 +1,9 @@
{
"parser": "babel-eslint",
"extends": ["react-app", "prettier"],
"plugins": [
"react-hooks"
],
"env": {
"es6": true
},
@@ -16,4 +19,4 @@
"version": "latest"
}
}
}
}
@@ -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],
};
@@ -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'],
};
@@ -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',
},
};
No changes.
@@ -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',
],
};

0 comments on commit bc3ea07

Please sign in to comment.
You can’t perform that action at this time.