Skip to content

Commit

Permalink
refactor(scripts): combine lint and test scripts (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
luftywiranda13 authored Jan 17, 2018
1 parent 7178520 commit 7eee56f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ node_js:
- '8'
- '6'
script:
- npm run lint
- node node_modules/.bin/prettier -l "*.{js,json,md}"
- npm test
after_success:
Expand Down
3 changes: 1 addition & 2 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
"precommit": "remove-lockfiles<% if (prettier) { %> && xo --fix && lint-staged<% } %>",<% if (esnext) { %>
"prebuild": "rimraf dist",
"build": "babel src --out-dir dist --copy-files --ignore *.test.js",<% } %>
"lint": "xo",
"test:watch": "jest --watch",
"test": "jest<% if (coverage) { %> --coverage<% } %>"
"test": "xo && jest<% if (coverage) { %> --coverage<% } %>"
},<% if (esnext) { %>
"main": "dist/index.js",<% } %>
"files": [
Expand Down
3 changes: 1 addition & 2 deletions app/templates/_travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ notifications:
node_js:
- '8'
- '6'
script:
- npm run lint<% if (prettier) { %>
script:<% if (prettier) { %>
- node node_modules/.bin/prettier -l "*.{js,json,md}"<% } %>
- npm test<% if (esnext) { %>
- npm run build<% } %><% if (coverage) { %>
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
"node": ">=6"
},
"scripts": {
"lint": "xo",
"precommit": "remove-lockfiles && xo --fix && lint-staged",
"test:watch": "jest --watch",
"test": "jest --coverage"
"test": "xo && jest --coverage"
},
"files": [
"app"
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('prompts', () => {
.then(() => {
assert.jsonFileContent('package.json', {
scripts: {
test: 'jest --coverage',
test: 'xo && jest --coverage',
},
});

Expand Down

0 comments on commit 7eee56f

Please sign in to comment.