diff --git a/packages/cli/test/integration/audit/instance.risk.test.ts b/packages/cli/test/integration/audit/instance.risk.test.ts index 5080ff2622..f05ab3a067 100644 --- a/packages/cli/test/integration/audit/instance.risk.test.ts +++ b/packages/cli/test/integration/audit/instance.risk.test.ts @@ -100,9 +100,9 @@ test('should not report webhooks having basic or header auth', async () => { await Promise.all(promises); const testAudit = await audit(['instance']); + if (Array.isArray(testAudit)) fail('audit is empty'); - const report = testAudit?.[toReportTitle('instance')]; - + const report = testAudit[toReportTitle('instance')]; if (!report) { fail('Expected test audit to have instance risk report'); } @@ -160,9 +160,9 @@ test('should not report webhooks validated by direct children', async () => { await Promise.all(promises); const testAudit = await audit(['instance']); + if (Array.isArray(testAudit)) fail('audit is empty'); - const report = testAudit?.[toReportTitle('instance')]; - + const report = testAudit[toReportTitle('instance')]; if (!report) { fail('Expected test audit to have instance risk report'); } @@ -176,8 +176,9 @@ test('should not report non-webhook node', async () => { await saveManualTriggerWorkflow(); const testAudit = await audit(['instance']); + if (Array.isArray(testAudit)) fail('audit is empty'); - const report = testAudit?.[toReportTitle('instance')]; + const report = testAudit[toReportTitle('instance')]; if (!report) { fail('Expected test audit to have instance risk report'); @@ -210,9 +211,9 @@ test('should report outdated instance when outdated', async () => { test('should not report outdated instance when up to date', async () => { const testAudit = await audit(['instance']); + if (Array.isArray(testAudit)) fail('audit is empty'); - const report = testAudit?.[toReportTitle('instance')]; - + const report = testAudit[toReportTitle('instance')]; if (!report) { fail('Expected test audit to have instance risk report'); } diff --git a/packages/cli/test/integration/audit/nodes.risk.test.ts b/packages/cli/test/integration/audit/nodes.risk.test.ts index 811bd11a35..d9fac17b4a 100644 --- a/packages/cli/test/integration/audit/nodes.risk.test.ts +++ b/packages/cli/test/integration/audit/nodes.risk.test.ts @@ -67,9 +67,9 @@ test('should not report non-risky official nodes', async () => { await saveManualTriggerWorkflow(); const testAudit = await audit(['nodes']); + if (Array.isArray(testAudit)) return; - const report = testAudit?.[toReportTitle('nodes')]; - + const report = testAudit[toReportTitle('nodes')]; if (!report) return; for (const section of report.sections) { diff --git a/packages/cli/test/integration/eventbus.test.ts b/packages/cli/test/integration/eventbus.test.ts index 62c57ac091..7113c08dc3 100644 --- a/packages/cli/test/integration/eventbus.test.ts +++ b/packages/cli/test/integration/eventbus.test.ts @@ -367,7 +367,7 @@ test('should send message to sentry ', async () => { sentryDestination.enable(); - const mockedSentryCaptureMessage = jest.spyOn(sentryDestination.sentryClient, 'captureMessage'); + const mockedSentryCaptureMessage = jest.spyOn(sentryDestination.sentryClient!, 'captureMessage'); mockedSentryCaptureMessage.mockImplementation((_m, _level, _hint, _scope) => { eventBus.confirmSent(testMessage, { id: sentryDestination.id,