Skip to content

Commit

Permalink
fix: use nullish coalescing for coverage directory paths
Browse files Browse the repository at this point in the history
  • Loading branch information
vladjerca committed Mar 4, 2021
1 parent b7e27ef commit 1400421
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/karma-typescript/src/karma/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ export class Reporter {
private getReportDestination(browser: any, reportConfig: any, reportType: any) {

if (lodash.isPlainObject(reportConfig)) {
let subdirectory = reportConfig.subdirectory || browser.name;
let subdirectory = reportConfig.subdirectory ?? browser.name;
if (typeof subdirectory === "function") {
subdirectory = subdirectory(browser);
}

return path.join(reportConfig.directory || "coverage", subdirectory);
return path.join(reportConfig.directory ?? "coverage", subdirectory);
}

if (lodash.isString(reportConfig) && reportConfig.length > 0) {
Expand Down

0 comments on commit 1400421

Please sign in to comment.