From f882bc5230ae4d55128b3f7db8b7f0d6e94ac356 Mon Sep 17 00:00:00 2001 From: Justin Wilaby Date: Thu, 6 Feb 2025 16:10:04 -0800 Subject: [PATCH] Diagnose integration test failure --- .../test/integration/logs.integration.test.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/cli/test/integration/logs.integration.test.ts b/packages/cli/test/integration/logs.integration.test.ts index 9703b18609..5a6604c579 100644 --- a/packages/cli/test/integration/logs.integration.test.ts +++ b/packages/cli/test/integration/logs.integration.test.ts @@ -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') })