Skip to content

Commit

Permalink
Diagnose integration test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
justinwilaby committed Feb 7, 2025
1 parent f739e4a commit f882bc5
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/cli/test/integration/logs.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@ describe('logs', function () {
.stdout()
.command(['logs', '--app=heroku-cli-ci-smoke-test-app'])
.it('shows the logs', ctx => {
// This is asserting that logs are returned by checking for the presence of the first two
// digits of the year in the timestamp
expect(ctx.stdout.startsWith('20')).to.be.true
try {
expect(ctx.stdout.startsWith('20')).to.be.true
} catch (error: any) {
// Handle or log the error appropriately
throw new Error(`Failed to fetch logs: ${error.message}`)
}
})

test
.stdout()
.command(['logs', '--app=non-existent-app'])
.catch(error => {
expect(error.message).to.contain('fetch failed')
})
.it('handles non-existent app gracefully')
})

0 comments on commit f882bc5

Please sign in to comment.