Skip to content

Commit

Permalink
fix(core): undefined reference error in coverage recording
Browse files Browse the repository at this point in the history
Allow for the `baseline` to be `undefined` after loading the first test files in initial test run.
  • Loading branch information
aivopaas authored and nicojs committed Nov 7, 2019
1 parent 4422086 commit 0a68c9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/transpiler/coverageHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ Object.keys(coveragePerFile).forEach(function (file) {
var fileResult = { s: {}, f: {} };
var touchedFile = false;
for(var i in coverage.s){
if(coverage.s[i] !== baseline.s[i]){
if(!baseline || coverage.s[i] !== baseline.s[i]){
fileResult.s[i] = coverage.s[i];
touchedFile = true;
}
}
for(var i in coverage.f){
if(coverage.f[i] !== baseline.f[i]){
if(!baseline || coverage.f[i] !== baseline.f[i]){
fileResult.f[i] = coverage.f[i];
touchedFile = true;
}
Expand Down

0 comments on commit 0a68c9c

Please sign in to comment.