From 38bcfc42e4d0351fae6ab35930f867afbaea7e27 Mon Sep 17 00:00:00 2001 From: Chandra shekar Varkala Date: Tue, 9 Jan 2024 17:38:54 -0600 Subject: [PATCH] chore: component test assertions --- test/integrations/component.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 847dd4c91f..9abbb5cfcc 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -20,7 +20,8 @@ import { import tags from '../../src/v0/util/tags'; import { Server } from 'http'; import { appendFileSync } from 'fs'; -import { responses } from '../testHelper'; +import { assertRouterOutput, responses } from '../testHelper'; +import { assert } from 'console'; // To run single destination test cases // npm run test:ts -- component --destination=adobe_analytics @@ -122,6 +123,11 @@ const testRoute = async (route, tcData: TestCaseData) => { .query(params || {}) .send(body); const outputResp = tcData.output.response || ({} as any); + + if (tcData.feature === tags.FEATURES.BATCH || tcData.feature === tags.FEATURES.ROUTER) { + assertRouterOutput(response.body.output, tcData.input.request.body.input); + } + expect(response.status).toEqual(outputResp.status); if (outputResp?.body) {