-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,7 +192,8 @@ module.exports = (req, res) => { | |
}); | ||
|
||
if (!isBinary) { | ||
stream = stream.pipe(replStream(fhirServer, `${config.baseUrl}/v/${fhirVersionLower}/fhir`)); | ||
// stream = stream.pipe(replStream(fhirServer, `${config.baseUrl}/v/${fhirVersionLower}/fhir`)); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
vlad-ignatov
Author
Contributor
|
||
stream = stream.pipe(replStream(fhirServer, `${Lib.getRequestBaseURL(req)}/v/${fhirVersionLower}/fhir`)); | ||
} | ||
|
||
stream.pipe(res); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -274,8 +274,7 @@ for(const FHIR_VERSION in TESTED_FHIR_SERVERS) { | |
}); | ||
|
||
it ("Handles pagination", () => { | ||
return agent.get(`${PATH_FHIR}/Patient`) | ||
.expect(res => { | ||
return agent.get(`${PATH_FHIR}/Patient`).expect(async (res) => { | ||
if (!Array.isArray(res.body.link)) { | ||
throw new Error("No links found"); | ||
} | ||
|
@@ -284,26 +283,30 @@ for(const FHIR_VERSION in TESTED_FHIR_SERVERS) { | |
if (!next) { | ||
throw new Error("No next link found"); | ||
} | ||
// console.log(next) | ||
return agent.get(next.url).expect(res2 => { | ||
if (!Array.isArray(res.body.link)) { | ||
throw new Error("No links found on second page"); | ||
} | ||
|
||
const nextURL = new URL(next.url) | ||
|
||
const res2 = await request(app).get(nextURL.pathname + nextURL.search) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
vlad-ignatov
Author
Contributor
|
||
|
||
if (!Array.isArray(res2.body.link)) { | ||
throw new Error("No links found on second page"); | ||
} | ||
|
||
let self = res.body.link.find(l => l.relation == "self") | ||
if (!self) { | ||
throw new Error("No self link found on second page"); | ||
} | ||
if (self.url !== next.url) { | ||
throw new Error("Links mismatch"); | ||
} | ||
let self = res2.body.link.find(l => l.relation == "self") | ||
|
||
if (!self) { | ||
throw new Error("No self link found on second page"); | ||
} | ||
|
||
if (self.url !== next.url) { | ||
throw new Error("Links mismatch"); | ||
} | ||
|
||
let next2 = res.body.link.find(l => l.relation == "next") | ||
if (!next2) { | ||
throw new Error("No next link found on second page"); | ||
} | ||
// console.log(next2) | ||
}) | ||
let next2 = res.body.link.find(l => l.relation == "next") | ||
|
||
if (!next2) { | ||
throw new Error("No next link found on second page"); | ||
} | ||
}) | ||
}); | ||
|
||
|
1 comment
on commit 92fec07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - your changes fit in better with the existing codebase, so I'm fine if you want to commit it directly and I'll just delete my fix branch. Thanks!
is this a related change?