From ab6c7fe43ff6d982b1d26c17c9b16d90a4d35143 Mon Sep 17 00:00:00 2001 From: Yen Le Date: Thu, 19 Sep 2024 11:56:59 +0700 Subject: [PATCH] test: update test to pass pipeline --- .../__tests__/interfaces/cli/testResultProcessor.test.ts | 4 ++-- .../integration/cli/untpTest.integration.test.ts | 2 ++ packages/untp-test-suite/src/interfaces/utils/common.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/untp-test-suite/__tests__/interfaces/cli/testResultProcessor.test.ts b/packages/untp-test-suite/__tests__/interfaces/cli/testResultProcessor.test.ts index 1b151be9..831b6931 100644 --- a/packages/untp-test-suite/__tests__/interfaces/cli/testResultProcessor.test.ts +++ b/packages/untp-test-suite/__tests__/interfaces/cli/testResultProcessor.test.ts @@ -221,8 +221,8 @@ describe('getFinalReport', () => { JSON.stringify([ [{ colSpan: 3, content: 'UNTP Core Test Suite', hAlign: 'center' }], [{ colSpan: 3, content: 'Runner version 0.0.1', hAlign: 'center' }], - ['Credential Type', 'Version', 'Status'], - ['aggregationEvent', 'v0.0.1', 'FAIL'], + ['Credential Type', 'Version', 'URL', 'Status'], + ['aggregationEvent', 'v0.0.1', '', 'FAIL'], [ { colSpan: 3, diff --git a/packages/untp-test-suite/integration/cli/untpTest.integration.test.ts b/packages/untp-test-suite/integration/cli/untpTest.integration.test.ts index 398e77b7..15e91402 100644 --- a/packages/untp-test-suite/integration/cli/untpTest.integration.test.ts +++ b/packages/untp-test-suite/integration/cli/untpTest.integration.test.ts @@ -1,3 +1,5 @@ +jest.setTimeout(30000); + import { jest } from '@jest/globals'; import fs from 'fs'; import { exec } from 'child_process'; diff --git a/packages/untp-test-suite/src/interfaces/utils/common.ts b/packages/untp-test-suite/src/interfaces/utils/common.ts index fd5f59f9..5c8f0dbb 100644 --- a/packages/untp-test-suite/src/interfaces/utils/common.ts +++ b/packages/untp-test-suite/src/interfaces/utils/common.ts @@ -13,7 +13,7 @@ export async function readJsonFile(filePath: string): Promise { // Utility function to truncate strings export const truncateString = (str: string | undefined, maxLength: number) => { - if (!str) return; + if (!str) return ''; if (str.length <= maxLength) { return str;