-
Notifications
You must be signed in to change notification settings - Fork 248
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
Update major libs dep fix #398 #403
Merged
Merged
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,11 +218,11 @@ var CoverageReporter = function (rootConfig, helper, logger, emitter) { | |
coverageMap.merge(result.coverage) | ||
} | ||
|
||
this.onRunComplete = function (browsers, results) { | ||
this.onRunComplete = async function (browsers, results) { | ||
const checkedCoverage = {} | ||
|
||
for (const reporterConfig of reporters) { | ||
browsers.forEach(function (browser) { | ||
await Promise.all(browsers.map(async (browser) => { | ||
const coverageMap = coverageMaps[browser.id] | ||
if (!coverageMap) { | ||
return | ||
|
@@ -231,14 +231,15 @@ var CoverageReporter = function (rootConfig, helper, logger, emitter) { | |
const mainDir = reporterConfig.dir || config.dir | ||
const subDir = reporterConfig.subdir || config.subdir | ||
const outputPath = generateOutputPath(basePath, browser.name, mainDir, subDir) | ||
const remappedCoverageMap = await sourceMapStore.transformCoverage(coverageMap) | ||
|
||
const options = helper.merge(config, reporterConfig, { | ||
dir: outputPath, | ||
subdir: '', | ||
browser: browser, | ||
emitter: emitter | ||
emitter: emitter, | ||
coverageMap: remappedCoverageMap | ||
}) | ||
const remappedCoverageMap = sourceMapStore.transformCoverage(coverageMap).map | ||
|
||
// If config.check is defined, check coverage levels for each browser | ||
if (hasOwnProperty.call(config, 'check') && !checkedCoverage[browser.id]) { | ||
|
@@ -250,22 +251,21 @@ var CoverageReporter = function (rootConfig, helper, logger, emitter) { | |
} | ||
|
||
const context = istanbulLibReport.createContext(options) | ||
const tree = istanbulLibReport.summarizers.pkg(remappedCoverageMap) | ||
const report = reports.create(reporterConfig.type || 'html', options) | ||
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. Sorry I can't figure out what this commit is achieving. I think it is:
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. I split refactoring and upgrade on separate PRs |
||
|
||
// // If reporting to console or in-memory skip directory creation | ||
const toDisk = !reporterConfig.type || !reporterConfig.type.match(/^(text|text-summary|in-memory)$/) | ||
|
||
if (!toDisk && reporterConfig.file === undefined) { | ||
tree.visit(report, context) | ||
report.execute(context) | ||
return | ||
} | ||
|
||
helper.mkdirIfNotExists(outputPath, function () { | ||
log.debug('Writing coverage to %s', outputPath) | ||
tree.visit(report, context) | ||
report.execute(context) | ||
}) | ||
}) | ||
})) | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.
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.
Having this function async causes
result.exitCode
to be set too late to be taken into account when karma exits the process.So when the coverage check thresholds are not met, the process still exits with code 0.
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've created #418 to track this issue