-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
Implements an `--all` flag for a src directory to consider for coverage. If supplied, c8 will glob the directory respecting the `--include` and `--exclude` parameters for src files. All source files will be included in the final report. If a file is not found in the v8 coverage output, it will be initialized with an empty v8 record and reported as 0 lines/branches/functions covered. Note: This uses the empty v8 approach instead of the empty report approach Fix html report --all should be boolean Update snapshot fix async function WIP - changing --all a bit to create a fake v8 coverage entry and additional args changes WIP - read source maps for faked entries WIP WIP Moved approach to empty v8 blocks
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ node_modules | |
.nyc_output | ||
coverage | ||
tmp | ||
.idea |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function Unloaded(){ | ||
return 'Never loaded :(' | ||
} | ||
|
||
console.log("This file shouldn't have been evaluated") |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export default function getString(i){ | ||
if (typeof i === 'number'){ | ||
if (isNaN(i)){ | ||
return 'NaN' | ||
} | ||
else if (i === 0){ | ||
return 'zero' | ||
} | ||
else if (i > 0){ | ||
return 'positive' | ||
} | ||
else { | ||
return 'negative' | ||
} | ||
} | ||
else { | ||
return 'wat?' | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import getString from "./loaded" | ||
console.log(getString(0)) | ||
console.log(getString(1)) | ||
console.log(getString(-1)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function Unloaded(){ | ||
return 'Never loaded :(' | ||
} | ||
|
||
console.log("This file shouldn't have been evaluated") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export default function getString(i){ | ||
if (typeof i === 'number'){ | ||
if (isNaN(i)){ | ||
return 'NaN' | ||
} | ||
else if (i === 0){ | ||
return 'zero' | ||
} | ||
else if (i > 0){ | ||
return 'positive' | ||
} | ||
else { | ||
return 'negative' | ||
} | ||
} | ||
else { | ||
return 'wat?' | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import getString from "./loaded" | ||
console.log(getString(0)) | ||
console.log(getString(1)) | ||
console.log(getString(-1)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = function Unloaded(){ | ||
return 'Never loaded :(' | ||
} | ||
|
||
console.log("This file shouldn't have been evaluated") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = function getString(i){ | ||
if (typeof i === 'number'){ | ||
if (isNaN(i)){ | ||
return 'NaN' | ||
} | ||
else if (i === 0){ | ||
return 'zero' | ||
} | ||
else if (i > 0){ | ||
return 'positive' | ||
} | ||
else { | ||
return 'negative' | ||
} | ||
} | ||
else { | ||
return 'wat?' | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const loaded = require('./loaded.js'); | ||
console.log(loaded(0)) | ||
console.log(loaded(1)) | ||
console.log(loaded(-1)) |