Skip to content

Commit

Permalink
chore: component test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandra shekar Varkala committed Jan 9, 2024
1 parent bab0617 commit 38bcfc4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/integrations/component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 38bcfc4

Please sign in to comment.