Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

fix: Fix Implentation guide integration test #467

Merged
merged 2 commits into from
Oct 1, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion integration-tests/implementationGuides.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
import axios, { AxiosInstance } from 'axios';
import https from 'https';
import waitForExpect from 'wait-for-expect';
import { cloneDeep } from 'lodash';
import { Chance } from 'chance';
Expand Down Expand Up @@ -94,7 +95,14 @@ describe('Implementation Guides - US Core', () => {
);

const expectedCapStatement: CapabilityStatement = (
await axios.get(`https://www.hl7.org/fhir/us/core/${usCoreVersion}/CapabilityStatement-us-core-server.json`)
await axios.get(
`https://www.hl7.org/fhir/us/core/${usCoreVersion}/CapabilityStatement-us-core-server.json`,
{
httpsAgent: new https.Agent({
rejectUnauthorized: false,
Copy link
Contributor

@carvantes carvantes Sep 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably better to download the capability statement from https://www.hl7.org/fhir/us/core/STU3.1.1/CapabilityStatement-us-core-server.json and commit the file as part of the integ tests code. That gets rid of any other transient issue (i.e. www.hl7.org is down) and the json files are not that big.

Plus, disabling certificate validation is an odd choice that will be flagged by any security scan. (CodeQL already flagged it). We could dismiss it as "used in tests" but that's less than ideal

}),
},
)
).data;

const expectedResourcesWithSupportedProfile: Record<string, string[]> = getResourcesWithSupportedProfile(
Expand Down