Skip to content

Commit

Permalink
chore: add test-session link on github reporter [gh-822] (#828)
Browse files Browse the repository at this point in the history
* chore: add test-session link on github reporter [gh-822]

* test: test-session link on github reporter [gh-822]

* chore: add test-session link on github reporter [gh-822]
  • Loading branch information
Nahuel Alejandro Ramos authored Aug 17, 2023
1 parent 092f82c commit 41aaa63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/cli/e2e/__tests__/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,23 @@ describe('test', () => {
expect(result.status).toBe(0)
})

it('Should use Github reporter', async () => {
it('Should use Github reporter and show test-session link', async () => {
const reportFilename = './reports/checkly-summary.md'
try {
fs.unlinkSync(reportFilename)
} catch {
}
const result = await runChecklyCli({
args: ['test', '--reporter', 'github'],
args: ['test', '--record', '--reporter', 'github'],
apiKey: config.get('apiKey'),
accountId: config.get('accountId'),
directory: path.join(__dirname, 'fixtures', 'test-project'),
env: { CHECKLY_REPORTER_GITHUB_OUTPUT: reportFilename },
timeout: 120000, // 2 minutes
})
expect(result.stdout).toContain('Github summary saved in')
expect(result.stdout).toContain('Detailed session summary at')
expect(result.stdout).toContain('https://chkly.link/l')
expect(fs.existsSync(path.join(__dirname, 'fixtures', 'test-project', reportFilename))).toBe(true)
expect(result.status).toBe(0)
})
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/reporters/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,7 @@ export default class GithubReporter extends AbstractListReporter {
fs.writeFileSync(summaryFilename, markDown)

printLn(`Github summary saved in '${path.resolve(summaryFilename)}'.`, 2)

this._printTestSessionsUrl()
}
}

0 comments on commit 41aaa63

Please sign in to comment.