Skip to content

Commit

Permalink
adjust jest config file
Browse files Browse the repository at this point in the history
  • Loading branch information
HyunMo Ahn committed Apr 18, 2019
1 parent 771ffc2 commit 59088cf
Show file tree
Hide file tree
Showing 7 changed files with 440 additions and 267 deletions.
3 changes: 3 additions & 0 deletions config/babel/babel.jest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = require('babel-jest').createTransformer(
require('./babel.config.js'),
);
4 changes: 4 additions & 0 deletions config/enzyme.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const { configure } = require('enzyme/build');
const Adapter = require('enzyme-adapter-react-16/build');

configure({ adapter: new Adapter() });
10 changes: 7 additions & 3 deletions jest.config.js → config/jest/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
collectCoverageFrom: [
'app/**/*.{js,jsx}',
'<rootDir>/app/**/*.{js,jsx}',
],
moduleNameMapper: {
'\\.(css|scss)$': '<rootDir>/app/__mocks__/styleMock.js',
Expand All @@ -18,10 +18,14 @@ module.exports = {
'^widget(.*)$': '<rootDir>/app/renderer/pages/widget$1',
'^utils(.*)$': '<rootDir>/app/utils$1',
},
transform: {
'^.+\\.jsx?$': '<rootDir>/config/babel/babel.jest.js',
},
rootDir: '../../',
globals: {
__dirname: '/Users/user-name/project/oh-my-desk/app',
__dirname: '<rootDir>',
},
setupTestFrameworkScriptFile: '<rootDir>/enzyme.config.js',
setupTestFrameworkScriptFile: '<rootDir>/config/enzyme.config.js',
snapshotSerializers: [
'enzyme-to-json/serializer',
],
Expand Down
1 change: 1 addition & 0 deletions jest.e2e.config.js → config/jest/jest.e2e.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
'^widget(.*)$': '<rootDir>/app/renderer/pages/widget$1',
'^utils(.*)$': '<rootDir>/app/utils$1',
},
rootDir: '../../',
globals: {
__dirname: '/Users/user-name/project/oh-my-desk/app',
},
Expand Down
4 changes: 0 additions & 4 deletions enzyme.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"package:mac": "yarn build && build -c electron-builder.yml -m",
"package:win": "yarn build && build -c electron-builder.yml -w",
"package:release": "yarn build && build -c electron-builder.yml -mw -p always ",
"test": "jest --config jest.config.js",
"test": "jest --config ./config/jest/jest.config.js",
"test:watch": "yarn test -- --watch",
"test:coverage": "yarn test -- --coverage",
"show:coverage": "yarn test:coverage && open ./coverage/lcov-report/index.html",
"e2e": "jest --config jest.e2e.config.js",
"e2e": "jest --config config/jest/jest.e2e.config.js",
"e2e:build": "cross-env NODE_ENV=test webpack --config config/webpack/webpack.prod.config.js",
"e2e:watch": "yarn e2e:build && yarn e2e -- --watch",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls",
Expand Down
681 changes: 423 additions & 258 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 59088cf

Please sign in to comment.