ci: Fix typing issues in cli tests (no-changelog) (#5227)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-01-23 17:41:55 +01:00 committed by GitHub
parent 96dddf12e1
commit bd14ec1110
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 10 deletions

View file

@ -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');
}

View file

@ -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) {

View file

@ -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,