-
-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Add collectCoverageFrom option to collect coverage on files without any tests #961
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours has expired. Before we can review or merge your code, we need you to email [email protected] with your details so we can update your status. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Looks good to me, thanks. |
kitze
added a commit
to kitze/custom-react-scripts
that referenced
this pull request
Nov 4, 2016
…react-app # By Ville Immonen (11) and others # Via Dan Abramov * 'master' of https://github.com/facebookincubator/create-react-app: (39 commits) Remove redundant `function` from export statement (facebook#996) Add Gatsby to alternatives (facebook#995) Allow webpack 2 as peerDependency in react-dev-utils (facebook#963) Remove custom babel-loader cache dir config (facebook#983) Check for presence of folders before continuing eject. Closes facebook#939. (facebook#951) Fixes facebook#952 (facebook#953) Always build before deploying to gh-pages (facebook#959) Add collectCoverageFrom option to collect coverage on files without any tests. (facebook#961) Catch and noop call to open web browser. (facebook#964) Gently nudge users towards https by default (facebook#974) Enable compression on webpack-dev-server (facebook#966) (facebook#968) Add next.js to Alternatives Point people to npm Windows instructions Encourage people to try recent npm Fix an attribution link in 0.7.0 changelog Update CLI version in changelog Publish Update eslint-config-react-app version in the guide Update changelog for 0.7.0 Revert "Temporarily remove 0.7.0 changelog as it's not out yet" ... Conflicts: packages/babel-preset-react-app/package.json packages/create-react-app/package.json packages/eslint-config-react-app/package.json packages/react-dev-utils/package.json packages/react-scripts/config/webpack.config.dev.js packages/react-scripts/config/webpack.config.prod.js packages/react-scripts/package.json
eXtreme
added a commit
to eXtreme/create-react-app
that referenced
this pull request
Nov 18, 2016
* pull2: Support Yarn (facebook#898) Fix chrome tab reuse (facebook#1035) Remove unnecessary transform plugins for object spread to work (facebook#1052) Clears the usage of react-jsx-source & react-jsx-self (facebook#992) Update babel-present-env and use node: 'current' as target (facebook#1051) Remove redundant `function` from export statement (facebook#996) Add Gatsby to alternatives (facebook#995) Allow webpack 2 as peerDependency in react-dev-utils (facebook#963) Remove custom babel-loader cache dir config (facebook#983) Check for presence of folders before continuing eject. Closes facebook#939. (facebook#951) Fixes facebook#952 (facebook#953) Always build before deploying to gh-pages (facebook#959) Add collectCoverageFrom option to collect coverage on files without any tests. (facebook#961) Catch and noop call to open web browser. (facebook#964) Gently nudge users towards https by default (facebook#974) Enable compression on webpack-dev-server (facebook#966) (facebook#968) Add next.js to Alternatives Point people to npm Windows instructions Encourage people to try recent npm # Conflicts: # packages/react-scripts/config/webpack.config.dev.js # packages/react-scripts/package.json # packages/react-scripts/utils/createJestConfig.js
jarlef
pushed a commit
to jarlef/create-react-app
that referenced
this pull request
Nov 28, 2016
alexdriaguine
pushed a commit
to alexdriaguine/create-react-app
that referenced
this pull request
Jan 23, 2017
maltestenzel
pushed a commit
to maltestenzel/custom-react-scripts
that referenced
this pull request
Mar 7, 2018
…react-app # By Ville Immonen (11) and others # Via Dan Abramov * 'master' of https://github.com/facebookincubator/create-react-app: (39 commits) Remove redundant `function` from export statement (facebook#996) Add Gatsby to alternatives (facebook#995) Allow webpack 2 as peerDependency in react-dev-utils (facebook#963) Remove custom babel-loader cache dir config (facebook#983) Check for presence of folders before continuing eject. Closes facebook#939. (facebook#951) Fixes facebook#952 (facebook#953) Always build before deploying to gh-pages (facebook#959) Add collectCoverageFrom option to collect coverage on files without any tests. (facebook#961) Catch and noop call to open web browser. (facebook#964) Gently nudge users towards https by default (facebook#974) Enable compression on webpack-dev-server (facebook#966) (facebook#968) Add next.js to Alternatives Point people to npm Windows instructions Encourage people to try recent npm Fix an attribution link in 0.7.0 changelog Update CLI version in changelog Publish Update eslint-config-react-app version in the guide Update changelog for 0.7.0 Revert "Temporarily remove 0.7.0 changelog as it's not out yet" ... Conflicts: packages/babel-preset-react-app/package.json packages/create-react-app/package.json packages/eslint-config-react-app/package.json packages/react-dev-utils/package.json packages/react-scripts/config/webpack.config.dev.js packages/react-scripts/config/webpack.config.prod.js packages/react-scripts/package.json
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding collectCoverageFrom option to the config to cover files that have no tests. This is set to look for any file under the
src/
directory.Below is the coverage report prior to the change:
![screen shot 2016-10-25 at 15 46 11](https://cloud.githubusercontent.com/assets/17095658/19690878/0af2628a-9aca-11e6-8d3b-3bfc6d3f068f.png)
And here is the coverage after the change with the same tests:
![screen shot 2016-10-25 at 15 46 42](https://cloud.githubusercontent.com/assets/17095658/19690879/0afe43e8-9aca-11e6-8ecd-3dcc91a63200.png)
It's worth noting this can currently be achieved by passing the arguments through
npm test -- --coverage --collectCoverageFrom='src/**/*.{js,jsx}'
.This change would make this the default behaviour. If a different path is required then passing it as an argument overrides the default.
For example if I only cared about the actions folder I could run:
![screen shot 2016-10-25 at 16 11 13](https://cloud.githubusercontent.com/assets/17095658/19691971/1b2d53c2-9ace-11e6-968f-92aa185c24e9.png)
npm test -- --coverage --collectCoverageFrom='src/actions/*.{js,jsx}'
A similar PR was already submitted #905 but the author hasn't responded in a while. This is also without the ignore path as I feel its unnecessary.