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

Commit

Permalink
fix: Fix Implentation guide integration test (#467)
Browse files Browse the repository at this point in the history
* Update to use downloaded JSON

Co-authored-by: Tim Nguyen <[email protected]>
  • Loading branch information
nguyen102 and Tim Nguyen authored Oct 1, 2021
1 parent 248356f commit 421f1db
Show file tree
Hide file tree
Showing 2 changed files with 3,814 additions and 7 deletions.
3,807 changes: 3,807 additions & 0 deletions integration-tests/STU3_1_1UsCoreCapStatement.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions integration-tests/implementationGuides.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import axios, { AxiosInstance } from 'axios';
import { AxiosInstance } from 'axios';
import waitForExpect from 'wait-for-expect';
import { cloneDeep } from 'lodash';
import { Chance } from 'chance';
// NOTE this needs to be the same version as what is going to be downloaded. Please see /.github/workflows/deploy.yaml to verify
// This json is version STU3.1.1 from https://www.hl7.org/fhir/us/core/STU3.1.1/CapabilityStatement-us-core-server.json
// We're using the JSON instead of downloading from the URL because the SSL cert at that domain has expired
import STU311UsCoreCapStatement from './STU3_1_1UsCoreCapStatement.json';
import {
expectResourceToBeInBundle,
expectResourceToBePartOfSearchResults,
Expand All @@ -18,9 +22,6 @@ import { CapabilityStatement } from './types';

jest.setTimeout(60 * 1000);

// NOTE this needs to be the same version as what is going to be downloaded. Please see /.github/workflows/deploy.yaml to verify
const usCoreVersion = 'STU3.1.1';

describe('Implementation Guides - US Core', () => {
let client: AxiosInstance;
beforeAll(async () => {
Expand Down Expand Up @@ -93,9 +94,8 @@ describe('Implementation Guides - US Core', () => {
actualCapabilityStatement,
);

const expectedCapStatement: CapabilityStatement = (
await axios.get(`https://www.hl7.org/fhir/us/core/${usCoreVersion}/CapabilityStatement-us-core-server.json`)
).data;
// @ts-ignore
const expectedCapStatement: CapabilityStatement = STU311UsCoreCapStatement;

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

0 comments on commit 421f1db

Please sign in to comment.