Skip to content

Commit

Permalink
fixed logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zuki-linB committed Jul 31, 2023
1 parent 88ae77c commit 4f24319
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/DiffChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export class DiffChecker {
const reportNewKeys = Object.keys(coverageReportNew)
const reportOldKeys = Object.keys(coverageReportOld)
const reportKeys = new Set([...reportNewKeys, ...reportOldKeys])
console.log({reportKeys})
for (const filePath of reportKeys) {
this.diffCoverageReport[filePath] = {
branches: {
Expand All @@ -40,7 +39,6 @@ export class DiffChecker {
}
}
}
console.log({diffCoverageReport: this.diffCoverageReport})
}

getCoverageDetails(diffOnly: boolean, currentDirectory: string): string[] {
Expand Down
9 changes: 3 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,17 @@ async function run(): Promise<void> {
const codeCoverageOld = <CoverageReport>(
JSON.parse(fs.readFileSync(mainBranchCoverageSummaryFileName).toString())
)
console.log({codeCoverageNew})
console.log({codeCoverageOld})

const resolvedCodeCoverageOld = Object.entries(codeCoverageOld).reduce(
// @ts-ignore
([key, value], acc) => {
(acc, [key, value]) => {
if (codeCoverageNew[key]) {
// @ts-ignore
acc[key] = value
}
return acc
},
{}
)
console.log({resolvedCodeCoverageOld})
const currentDirectory = execSync('pwd')
.toString()
.trim()
Expand All @@ -63,7 +61,6 @@ async function run(): Promise<void> {
!fullCoverage,
`${currentDirectory}/`
)
console.log({coverageDetails})

if (coverageDetails.length === 0) {
messageToPost =
Expand Down

0 comments on commit 4f24319

Please sign in to comment.