Skip to content

Commit d3c7d94

Browse files
dependabot[bot]anthony-nhskris-szlapa
authored
Upgrade: [dependabot] - bump axios-mock-adapter from 2.0.0 to 2.1.0 (#1363)
Bumps [axios-mock-adapter](https://github.com/ctimmerm/axios-mock-adapter) from 2.0.0 to 2.1.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/ctimmerm/axios-mock-adapter/releases">axios-mock-adapter's releases</a>.</em></p> <blockquote> <h2>v2.1.0</h2> <ul> <li>Migrate to modern js <a href="https://redirect.github.com/ctimmerm/axios-mock-adapter/pull/393">ctimmerm/axios-mock-adapter#393</a> <ul> <li>♻️ Migrate internal handler to an object</li> <li>♻️ Migrate to ES2022</li> <li>♻️ Migrate to Class</li> <li>♻️ Migrate to async/await</li> <li>🎁 Migrate handlers and history to a flat array. That way one only needs to check the history array to see all requests. The verbs on the array are still exposed, so there's no downside.</li> <li>🎁 Add MockResponse types</li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/ctimmerm/axios-mock-adapter/commit/64d25b38a246eea276296d52b337c10879fd171a"><code>64d25b3</code></a> 2.1.0</li> <li><a href="https://github.com/ctimmerm/axios-mock-adapter/commit/533d3d9c6c8c8d1cf6f97035679c57b4e05b8059"><code>533d3d9</code></a> chore: Upgrade axios, as there was a security issue, they fixed the url behavior</li> <li><a href="https://github.com/ctimmerm/axios-mock-adapter/commit/c958a546979c350bb843039bb7c73a030c535b7b"><code>c958a54</code></a> Migrate to class</li> <li><a href="https://github.com/ctimmerm/axios-mock-adapter/commit/cf3d88136870c7b98436c0c16c4d390bd9fbc4c3"><code>cf3d881</code></a> Add MockResponse types</li> <li><a href="https://github.com/ctimmerm/axios-mock-adapter/commit/47db99552b6f6802630341b80d48dc9827aa4fd8"><code>47db995</code></a> Migrate handle_request.js to async/await</li> <li><a href="https://github.com/ctimmerm/axios-mock-adapter/commit/c1b4a0fcd079511b62063b20ffb9c809a029973e"><code>c1b4a0f</code></a> Upgrade eslint and rewrite to modern js</li> <li><a href="https://github.com/ctimmerm/axios-mock-adapter/commit/6acbf993abf277f5035788523b2d12c13532cbc2"><code>6acbf99</code></a> Migrate handlers and history to a flat array</li> <li><a href="https://github.com/ctimmerm/axios-mock-adapter/commit/1291950c201c2e24cfac6a6ea513cce2a9a2debc"><code>1291950</code></a> Migrate handler to an object</li> <li><a href="https://github.com/ctimmerm/axios-mock-adapter/commit/25541417915d49c3985535160f7997b672122578"><code>2554141</code></a> Use AxiosMockAdapter throughout README</li> <li>See full diff in <a href="https://github.com/ctimmerm/axios-mock-adapter/compare/v2.0.0...v2.1.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=axios-mock-adapter&package-manager=npm_and_yarn&previous-version=2.0.0&new-version=2.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: anthony-nhs <[email protected]> Co-authored-by: Kris Szlapa <[email protected]>
1 parent f1c7973 commit d3c7d94

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

package-lock.json

Lines changed: 6 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/distanceSelling/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
},
2121
"devDependencies": {
2222
"@prescriptionsforpatients_common/testing": "^1.0.0",
23-
"axios-mock-adapter": "^2.0.0"
23+
"axios-mock-adapter": "^2.1.0"
2424
}
2525
}

packages/getMyPrescriptions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
},
2929
"devDependencies": {
3030
"@prescriptionsforpatients_common/testing": "^1.0.0",
31-
"axios-mock-adapter": "^2.0.0"
31+
"axios-mock-adapter": "^2.1.0"
3232
}
3333
}

packages/getMyPrescriptions/tests/test-handler.test.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ describe("Unit test for app handler", function () {
268268

269269
it("times-out if spine call takes too long", async () => {
270270
const mockErrorLogger = jest.spyOn(Logger.prototype, "error")
271-
const delayedResponse: Promise<Array<unknown>> = new Promise((resolve) => setTimeout(() => resolve([]), 15_000))
272271
// eslint-disable-next-line @typescript-eslint/no-unused-vars
273-
mock.onGet("https://live/mm/patientfacingprescriptions").reply((_config) => delayedResponse)
274-
272+
mock.onGet("https://live/mm/patientfacingprescriptions").reply(function (config) {
273+
return new Promise((resolve) => setTimeout(() => resolve([200, {}]), 15_000))
274+
})
275275
const event: GetMyPrescriptionsEvent = JSON.parse(exampleStateMachineEvent)
276276
const eventHandler: Promise<LambdaResult> = handler(event, dummyContext)
277277

@@ -300,9 +300,11 @@ describe("Unit test for app handler", function () {
300300
params: handlerParams,
301301
middleware: []
302302
})
303-
const delayedResponse: Promise<Array<unknown>> = new Promise((resolve) => setTimeout(() => resolve([]), 5_000))
303+
304304
// eslint-disable-next-line @typescript-eslint/no-unused-vars
305-
mock.onGet("https://live/mm/patientfacingprescriptions").reply((_config) => delayedResponse)
305+
mock.onGet("https://live/mm/patientfacingprescriptions").reply(function (config) {
306+
return new Promise((resolve) => setTimeout(() => resolve([200, {}]), 5_000))
307+
})
306308

307309
const event: GetMyPrescriptionsEvent = JSON.parse(exampleStateMachineEvent)
308310
const eventHandler: Promise<LambdaResult> = handler(event, dummyContext)
@@ -429,9 +431,10 @@ describe("Unit tests for app handler including service search", function () {
429431
const exampleResponse = {resourceType: "Bundle"}
430432
mock.onGet("https://spine/mm/patientfacingprescriptions").reply(200, exampleResponse)
431433

432-
const delayedResponse: Promise<Array<unknown>> = new Promise((resolve) => setTimeout(() => resolve([]), 15_000))
433434
// eslint-disable-next-line @typescript-eslint/no-unused-vars
434-
mock.onGet("https://service-search/service-search").reply((_config) => delayedResponse)
435+
mock.onGet("https://service-search/service-search").reply(function (config) {
436+
return new Promise((resolve) => setTimeout(() => resolve([200, {}]), 15_000))
437+
})
435438

436439
const event: GetMyPrescriptionsEvent = JSON.parse(exampleStateMachineEvent)
437440
const eventHandler: Promise<LambdaResult> = handler(event, dummyContext)

packages/serviceSearchClient/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
},
2222
"devDependencies": {
2323
"@prescriptionsforpatients_common/testing": "^1.0.0",
24-
"axios-mock-adapter": "^2.0.0"
24+
"axios-mock-adapter": "^2.1.0"
2525
}
2626
}

0 commit comments

Comments
 (0)