diff --git a/tools/jest-gh-reporter.ts b/tools/jest-gh-reporter.ts index 8b33cc512d2344e09c055c740da1107831ab3c62..55b1e41d2c456f887d6bd95081b11dc9dc9e3b7d 100644 --- a/tools/jest-gh-reporter.ts +++ b/tools/jest-gh-reporter.ts @@ -28,7 +28,7 @@ function getPath(suite: TestResult): string { return relative(ROOT, suite.testFilePath).replace(/\\/g, '/'); } -const ignoreStates = new Set(['passed']); +const ignoreStates = new Set(['passed', 'pending']); const MAX_ANNOTATIONS = 50; const lineRe = /\.spec\.ts:(?<line>\d+):(?<col>\d+)\)/; @@ -40,7 +40,7 @@ function getPos( > { const pos = lineRe.exec(msg); if (!pos || !pos.groups) { - return { start_line: 1, end_line: 1 }; + return { start_line: 0, end_line: 0 }; } const line = parseInt(pos.groups.line, 10); @@ -79,7 +79,7 @@ class GitHubReporter extends BaseReporter { const annotations: Octokit.ChecksCreateParamsOutputAnnotations[] = []; const success = testResult.numFailedTests === 0; - for (const suite of testResult.testResults) { + for (const suite of testResult.testResults.filter(s => !s.skipped)) { const path = getPath(suite); for (const test of suite.testResults.filter( t => !ignoreStates.has(t.status)