Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
unit tests added
Browse files Browse the repository at this point in the history
  • Loading branch information
Bharatkk-metron committed May 21, 2024
1 parent f8a0e63 commit ccd0b52
Show file tree
Hide file tree
Showing 3 changed files with 1,736 additions and 0 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions src/steps/network-analyzer/relationship.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
NETWORK_INTELLIGENCE_CENTER_TYPE,
RELATIONSHIP_NETWORK_INTELLIGENCE_CENTER_HAS_NETWORK_ANALYZER_CONNECTIVITY_TEST_TYPE,
RELATIONSHIP_VPN_GATEWAY_USES_VPN_GATEWAY_TUNNEL_RELATIONSHIP_TYPE,
STEP_CONNECTIVITY_TEST_SCANS_CLOUD_FUNCTION,
STEP_CONNECTIVITY_TEST_SCANS_NETWORK,
STEP_NETWORK_INTELLIGENCE_CENTER_HAS_NETWORK_ANALYZER_CONNECTIVITY_TEST_RELATIONSHIP,
STEP_PROJECT_HAS_NETWORK_ANALYZER_CONNECTIVITY_TEST_RELATIONSHIP,
STEP_PROJECT_HAS_NETWORK_INTELLIGENCE_CENTER_RELATIONSHIP,
Expand Down Expand Up @@ -337,3 +339,59 @@ describe(`networkAnalyzer#${STEP_VPN_GATEWAY_USES_VPN_GATEWAY_TUNNEL_RELATIONSHI
});
}, 1000000);
});

describe(`networkAnalyzer#${STEP_CONNECTIVITY_TEST_SCANS_CLOUD_FUNCTION}`, () => {
let recording: Recording;
afterEach(async () => {
await recording.stop();
});

jest.setTimeout(45000);

test.skip(STEP_CONNECTIVITY_TEST_SCANS_CLOUD_FUNCTION, async () => {
recording = setupGoogleCloudRecording({
name: STEP_CONNECTIVITY_TEST_SCANS_CLOUD_FUNCTION,
directory: __dirname,
options: {
matchRequestsBy: getMatchRequestsBy(tempNewAccountConfig),
},
});

const stepTestConfig: StepTestConfig = {
stepId: STEP_CONNECTIVITY_TEST_SCANS_CLOUD_FUNCTION,
instanceConfig: tempNewAccountConfig,
invocationConfig: invocationConfig as any,
};

const result = await executeStepWithDependencies(stepTestConfig);
expect(result).toMatchStepMetadata(stepTestConfig);
});
});

describe(`networkAnalyzer#${STEP_CONNECTIVITY_TEST_SCANS_NETWORK}`, () => {
let recording: Recording;
afterEach(async () => {
await recording.stop();
});

jest.setTimeout(45000);

test(STEP_CONNECTIVITY_TEST_SCANS_NETWORK, async () => {
recording = setupGoogleCloudRecording({
name: STEP_CONNECTIVITY_TEST_SCANS_NETWORK,
directory: __dirname,
options: {
matchRequestsBy: getMatchRequestsBy(tempNewAccountConfig),
},
});

const stepTestConfig: StepTestConfig = {
stepId: STEP_CONNECTIVITY_TEST_SCANS_NETWORK,
instanceConfig: tempNewAccountConfig,
invocationConfig: invocationConfig as any,
};

const result = await executeStepWithDependencies(stepTestConfig);
expect(result).toMatchStepMetadata(stepTestConfig);
});
});

0 comments on commit ccd0b52

Please sign in to comment.