Skip to content

Commit

Permalink
chore: update test descriptions and details for active campaign migra…
Browse files Browse the repository at this point in the history
…ted tests
  • Loading branch information
utsabc committed Dec 24, 2024
1 parent 8101cc8 commit f93398a
Show file tree
Hide file tree
Showing 10 changed files with 1,185 additions and 398 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,8 @@ dist

# component test report
test_reports/
temp/
temp/

# Allure
allure-results/
allure-report/
2 changes: 1 addition & 1 deletion jest.config.typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module.exports = {
// snapshotSerializers: [],

// The test environment that will be used for testing
testEnvironment: 'node',
testEnvironment: 'allure-jest/node',

// Options that will be passed to the testEnvironment
// testEnvironmentOptions: {},
Expand Down
59 changes: 57 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"@types/supertest": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.59.2",
"allure-jest": "^3.0.7",
"axios-mock-adapter": "^1.22.0",
"benchmark-suite": "^0.1.8",
"commander": "^10.0.1",
Expand All @@ -154,6 +155,8 @@
"http-terminator": "^3.2.0",
"husky": "^9.1.6",
"jest": "^29.5.0",
"jest-diff": "^29.7.0",
"jest-environment-node": "^29.7.0",
"jest-sonar": "^0.2.16",
"jest-when": "^3.5.2",
"lint-staged": "^13.2.2",
Expand Down
17 changes: 9 additions & 8 deletions test/integrations/component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { appendFileSync } from 'fs';
import { assertRouterOutput, responses } from '../testHelper';
import { generateTestReport, initaliseReport } from '../test_reporter/reporter';
import _ from 'lodash';
import { enhancedTestUtils } from '../test_reporter/allureReporter';

// To run single destination test cases
// npm run test:ts -- component --destination=adobe_analytics
Expand Down Expand Up @@ -55,7 +56,12 @@ if (opts.generate === 'true') {

let server: Server;

const INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE = ['klaviyo', 'campaign_manager', 'criteo_audience'];
const INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE = [
'active_campaign',
'klaviyo',
'campaign_manager',
'criteo_audience',
];

beforeAll(async () => {
initaliseReport();
Expand Down Expand Up @@ -153,13 +159,8 @@ const testRoute = async (route, tcData: TestCaseData) => {

if (INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE.includes(tcData.name?.toLocaleLowerCase())) {
expect(validateTestWithZOD(tcData, response)).toEqual(true);
const bodyMatched = _.isEqual(response.body, outputResp.body);
const statusMatched = response.status === outputResp.status;
if (bodyMatched && statusMatched) {
generateTestReport(tcData, response.body, 'passed');
} else {
generateTestReport(tcData, response.body, 'failed');
}
enhancedTestUtils.beforeTestRun(tcData);
enhancedTestUtils.afterTestRun(tcData, response.body);
}

if (outputResp?.body) {
Expand Down
Loading

0 comments on commit f93398a

Please sign in to comment.