This repository was archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 218
Make coverage reports es6 #63
Open
magicmark
wants to merge
1
commit into
airbnb:master
Choose a base branch
from
magicmark:make_coverage_reports_es6
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "lines": 90, | ||
| "functions": 55, | ||
| "branches": 66, | ||
| "statements": 91, | ||
| "reporter": [ | ||
| "html", | ||
| "text-summary" | ||
| ], | ||
| "require": [ | ||
| "babel-register" | ||
| ], | ||
| "exclude": [ | ||
| "test" | ||
| ], | ||
| "check-coverage": true | ||
| } |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,13 +5,13 @@ | |
| "main": "lib/index.js", | ||
| "scripts": { | ||
| "prepublish": "not-in-publish || safe-publish-latest && npm run build", | ||
| "build": "rimraf lib && babel src -d lib", | ||
| "build": "rimraf lib && babel --source-maps inline src -d lib", | ||
| "lint": "eslint src test", | ||
| "pretest": "npm run --silent lint", | ||
| "test": "npm run build && npm run test:coverage && npm run --silent cover:check", | ||
| "tests-only": "npm run build && npm run test:quick", | ||
| "test:coverage": "babel-node node_modules/.bin/istanbul cover --report html node_modules/.bin/_mocha -- -R tap test/init.js test/*-test.js", | ||
| "cover:check": "istanbul check-coverage && echo code coverage thresholds met, achievement unlocked!", | ||
| "test:coverage": "nyc --silent node_modules/.bin/mocha -R tap test/init.js test/*-test.js", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we use |
||
| "cover:check": "nyc report && echo code coverage thresholds met, achievement unlocked!", | ||
| "test:quick": "babel-node node_modules/.bin/_mocha -R tap test/init.js test/*-test.js" | ||
| }, | ||
| "repository": { | ||
|
|
@@ -50,11 +50,11 @@ | |
| "eslint-config-airbnb-base": "^11.2.0", | ||
| "eslint-plugin-import": "^2.2.0", | ||
| "in-publish": "^2.0.0", | ||
| "istanbul": "^1.0.0-alpha.2", | ||
| "mocha": "^3.4.1", | ||
| "mocha-wrap": "^2.1.1", | ||
| "rimraf": "^2.6.1", | ||
| "safe-publish-latest": "^1.1.1", | ||
| "nyc": "^10.3.2", | ||
| "sinon": "^1.17.7", | ||
| "sinon-sandbox": "^1.0.2" | ||
| }, | ||
|
|
||
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.
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.
Can we avoid using inline source maps, and use regular ones instead?
Uh oh!
There was an error while loading. Please reload this page.
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, running into some problems here.
The higher quality source maps decreases the coverage which isn't a big deal (I guess this was the point :D), but I can't get nyc to map back to original sources.
I tried both with and without the
babel-plugin-istanbulplugin, with every combination ofsourceMap,instrumentand env vars, but I couldn't get the mapping back from the instrumentation code+es5/es5 respectively :(I can't find anything in the
nycorbabel-plugin-istanbuldocs about external source maps - I also notice the documentation seems to recommend usinginlinesource maps (https://github.com/istanbuljs/nyc#support-for-custom-require-hooks-babel-webpack-etc)I'll open an issue+reproducible example on nyc later, but for now, this is blocking me :(
Have you got any thoughts w/r solving this? (You mentioned you had another repo set up with nyc?)
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.
https://github.com/airbnb/prop-types/blob/master/package.json#L52 is the other repo.
I'm not sure how to set it up.
It would be fine to build with inline source maps only when building for coverage, it just means we have to build twice.