Skip to content

Commit

Permalink
feat(tests): centralize test command & dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte authored and Raphaël Benitte committed Feb 1, 2018
1 parent e8e38da commit eda819c
Show file tree
Hide file tree
Showing 52 changed files with 1,754 additions and 43,772 deletions.
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,19 @@ packages-lint: ##@1 packages run eslint on all packages
--ignore-pattern 'nivo-generators' \
./packages/*/{src,tests}

package-test-%: ##@1 packages run tests for a package
@./node_modules/.bin/jest --setupTestFrameworkScriptFile=raf/polyfill ./packages/nivo-${*}/tests

package-update-test-%: ##@1 packages run tests for a package and update its snapshots
@./node_modules/.bin/jest --setupTestFrameworkScriptFile=raf/polyfill ./packages/nivo-${*}/tests -u

packages-test: ##@1 packages run tests for all packages
# stream can be used for a mire verbose output
#@./node_modules/.bin/lerna run --concurrency 1 --stream test
@./node_modules/.bin/lerna run --concurrency 1 test
@echo "${YELLOW}Running test suites for all packages${RESET}"
@./node_modules/.bin/jest --setupTestFrameworkScriptFile=raf/polyfill ./packages/*/tests

packages-test-cover: ##@1 packages run tests for all packages with code coverage
@echo "${YELLOW}Running test suites for all packages${RESET}"
@./node_modules/.bin/jest --coverage --setupTestFrameworkScriptFile=raf/polyfill ./packages/*/tests

package-build-%: ##@1 packages build a package
@echo "${YELLOW}Building package ${WHITE}@nivo/${*}${RESET}"
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,21 @@
"babel-eslint": "^8.2.1",
"chalk": "^2.3.0",
"clog-cli": "^1.0.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^4.16.0",
"eslint-plugin-react": "^7.6.0",
"gh-pages": "^1.0.0",
"jest": "^22.1.4",
"lerna": "^2.5.1",
"lodash": "^4.17.4",
"prettier": "^1.6.1",
"prop-types": "^15.5.10",
"puppeteer": "^0.13.0",
"raf": "^3.4.0",
"react": "16.2.0",
"react-dom": "16.2.0",
"react-test-renderer": "^16.2.0",
"rollup": "^0.55.1",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-node-resolve": "^3.0.2",
Expand Down
3 changes: 0 additions & 3 deletions packages/nivo-bar/.babelrc

This file was deleted.

15 changes: 0 additions & 15 deletions packages/nivo-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,11 @@
"react-motion": "^0.5.2",
"recompose": "^0.26.0"
},
"devDependencies": {
"@nivo/babel-preset": "0.33.0",
"@nivo/generators": "0.33.0",
"babel-cli": "^6.26.0",
"babel-jest": "^20.0.3",
"cross-env": "^5.0.5",
"jest": "^21.0.1",
"react": "16.2.0",
"react-dom": "16.2.0",
"react-test-renderer": "16.2.0"
},
"peerDependencies": {
"prop-types": "^15.5.10",
"react": ">= 16.2.0 < 17.0.0"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"test": "jest --verbose ./tests",
"test:cover": "jest --verbose --coverage ./tests"
}
}
Loading

0 comments on commit eda819c

Please sign in to comment.