-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(infrastructure): Set up testing #4567
Conversation
@@ -9,31 +9,49 @@ | |||
"build:min": "mkdir -p build && MDL_ENV=production webpack -p", | |||
"dist": "npm run clean && npm run build && npm run build:min", | |||
"dev": "npm run clean && MDL_ENV=development webpack-dev-server --content-base demos --inline --hot", | |||
"lint:js": "eslint --fix packages webpack.config.js", | |||
"postinstall": "lerna bootstrap" | |||
"lint:js": "eslint --fix packages test webpack.config.js karma.conf.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going to use this as a dependency for other scripts, we should probably remove --fix
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have it set up to run as the "pretest" script as well, so it'll execute
when "npm test" is run. However developers can also manually run it if they
wish.
On Wed, Jul 20, 2016 at 09:10 Sérgio Gomes notifications@github.com wrote:
In package.json
#4567 (comment)
:@@ -9,31 +9,49 @@
"build:min": "mkdir -p build && MDL_ENV=production webpack -p",
"dist": "npm run clean && npm run build && npm run build:min",
"dev": "npm run clean && MDL_ENV=development webpack-dev-server --content-base demos --inline --hot",
- "lint:js": "eslint --fix packages webpack.config.js",
- "postinstall": "lerna bootstrap"
- "lint:js": "eslint --fix packages test webpack.config.js karma.conf.js",
This one's meant to be manually used by developers, not as part of some
build process, right?—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/google/material-design-lite/pull/4567/files/e26e3d3de0cf7001a07c785f7cb5ed0beef0b20e#r71520727,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABIV9dlHIdmCOue2CQlArCAzXAhGlvDoks5qXh5jgaJpZM4JQBo4
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah good point. I guess I was thinking that running it as part of lint would save devs some time fixing stuff. But yeah maybe having a lint:fix
rule which runs both eslint --fix
and stylefmt
Would be better.
e26e3d3
to
7811fda
Compare
@sgomes changes made; PTAL |
* `npm test` lints files, runs karma, reports coverages, checks coverage thresholds * `npm run test:watch` runs karma in auto-watch mode, with source maps for both source and test files. * `npm run fix` attempts to fix both CSS and JS lint issues in parallel * `npm run lint` lints JS and CSS in parallel * [karma](https://karma-runner.github.io/1.0/index.html) is used for running tests. * [tape](https://github.com/substack/tape) is used as the actual test runner. * [bel](https://github.com/shama/bel) is used for easy DOM fixtures. * [testdouble](https://github.com/testdouble/testdouble.js) is used for mocking/doubles. * [isparta](https://github.com/douglasduteil/isparta) is used to instrument source files for coverage. * [istanbul](https://github.com/gotwarlost/istanbul) is used to check and report coverage. * [eslint-plugin-tape](https://github.com/atabel/eslint-plugin-tape) is used for tape-specific test linting. resolves #4465
7811fda
to
e886ee9
Compare
LGTM, thanks @traviskaufman! |
npm test
lints files, runs karma, reports coverages, checks coverage thresholdsnpm run test:watch
runs karma in auto-watch mode, with source mapsfor both source and test files.
resolves #4465