Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"presets": [
["env", {"modules": false}],
"react",
"stage-0",
"stage-0"
],
"plugins": [
"transform-decorators-legacy"
Expand All @@ -12,6 +12,12 @@
"plugins": [
"react-hot-loader/babel"
]
},
"test": {
"presets": ["es2015", "react", "stage-0"],
"plugins": [
"transform-decorators-legacy"
]
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/*
static/*
static/*
*.spec.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build
.env
app/config.js
*.bak
coverage/
1 change: 1 addition & 0 deletions .jestfilemock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
30 changes: 30 additions & 0 deletions app/js.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ "moduleNameMapper": {
"^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/.jestfilemock.js",
"^.+\\.(css|less|scss)$": "identity-obj-proxy",
"utils": "<rootDir>/app/utils/index.js",
"config": "<rootDir>/app/config.js",
"commons": "<rootDir>/app/commons",
"components": "<rootDir>/app/components"
},
"roots": [
"<rootDir>/app"
],
"snapshotSerializers": ["<rootDir>/node_modules/enzyme-to-json/serializer"],
"collectCoverageFrom": ["app/*.js"],
"coveragePathIgnorePatterns": [],
"coverageThreshold": {
"global": {
"branches": 46.17,
"functions": 62.18,
"lines": 58.18,
"statements": 57.46
}
},
"globals": {
"__DEV__": true,
"__BACKEND_URL__": "",
"__PACKAGE_SERVER__": "",
"__WS_URL__": "",
"__RUN_MODE__": "mode"
}
}
5 changes: 5 additions & 0 deletions app/store.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { getState } from './store'

describe('getState', () => {
it('should getState', () => expect(getState()).toBe(false))
})
29 changes: 20 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"build": "npm run clean && cross-env NODE_ENV=production webpack --progress --colors && npm run after-build",
"after-build": "node cdn.js",
"lint": "eslint app",
"flow": "flow; test $? -eq 0 -o $? -eq 2"
"lintf": "eslint app --fix",
"test": "./node_modules/.bin/jest --config app/js.config.json --coverage",
"testw": "./node_modules/.bin/jest --config app/js.config.json --watch"
},
"keywords": [
"coding",
Expand All @@ -29,7 +31,7 @@
"license": "BSD-3-Clause",
"devDependencies": {
"babel-core": "^6.23.1",
"babel-eslint": "^7.1.1",
"babel-eslint": "^7.2.1",
"babel-loader": "^6.3.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-polyfill": "^6.23.0",
Expand All @@ -40,12 +42,11 @@
"cross-env": "^3.1.4",
"css-loader": "^0.26.1",
"dotenv": "^4.0.0",
"eslint": "^3.5.0",
"eslint-config-airbnb": "^14.1.0",
"eslint": "^3.15.0",
"eslint-import-resolver-webpack": "^0.3.0",
"eslint-plugin-import": "^1.15.0",
"eslint-plugin-jsx-a11y": "^1.3.0",
"eslint-plugin-react": "^5.0.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.9.0",
"file-loader": "^0.10.0",
"html-webpack-plugin": "^2.28.0",
"react-hot-loader": "next",
Expand All @@ -55,7 +56,18 @@
"url-loader": "^0.5.7",
"webpack": "^2.2.1",
"webpack-dev-server": "^2.4.1",
"webpack-merge": "^3.0.0"
"webpack-merge": "^3.0.0",
"babel-jest": "^19.0.0",
"enzyme": "^2.8.0",
"enzyme-to-json": "^1.5.0",
"eslint-config-airbnb": "^14.1.0",
"react-test-renderer": "^15.5.4",
"redux-mock-store": "^1.2.3",
"nock": "^9.0.13",
"qiniu": "^6.1.13",
"jest": "^19.0.2",
"babel-preset-es2015": "^6.24.1",
"identity-obj-proxy": "^3.0.0"
},
"dependencies": {
"axios": "^0.15.3",
Expand All @@ -76,7 +88,6 @@
"markdown": "^0.5.0",
"moment": "^2.18.1",
"octicons": "^4.3.0",
"qiniu": "^6.1.13",
"qs": "^6.4.0",
"react": "^15.3.0",
"react-dom": "^15.3.1",
Expand Down
Loading