From ae7bfa9d1a86b8705543812eb6a169cfb40a67c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 18:18:25 +0000 Subject: [PATCH 1/5] chore(deps): bump fetch-mock from 11.1.1 to 12.2.0 Bumps [fetch-mock](https://github.com/wheresrhys/fetch-mock/tree/HEAD/packages/fetch-mock) from 11.1.1 to 12.2.0. - [Release notes](https://github.com/wheresrhys/fetch-mock/releases) - [Changelog](https://github.com/wheresrhys/fetch-mock/blob/main/packages/fetch-mock/CHANGELOG.md) - [Commits](https://github.com/wheresrhys/fetch-mock/commits/fetch-mock-v12.2.0/packages/fetch-mock) --- updated-dependencies: - dependency-name: fetch-mock dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- handlers/ticket-tailor-webhook/package.json | 2 +- pnpm-lock.yaml | 34 ++++++++++++--------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/handlers/ticket-tailor-webhook/package.json b/handlers/ticket-tailor-webhook/package.json index 534c5462a..45a3c2495 100644 --- a/handlers/ticket-tailor-webhook/package.json +++ b/handlers/ticket-tailor-webhook/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@types/aws-lambda": "^8.10.145", - "fetch-mock": "^11.1.1" + "fetch-mock": "^12.2.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 72b8d3369..b22deaf8d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -205,8 +205,8 @@ importers: specifier: ^8.10.145 version: 8.10.145 fetch-mock: - specifier: ^11.1.1 - version: 11.1.1 + specifier: ^12.2.0 + version: 12.2.0 handlers/update-supporter-plus-amount: dependencies: @@ -2959,14 +2959,9 @@ packages: fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} - fetch-mock@11.1.1: - resolution: {integrity: sha512-2lZ42bnMar9MBfNR0nza5wM4ZDwLxb+ZbNR4sEvpqOOBzZ+V6cZVVhLBHj8+AAEInF4vp2/tbRM8WlGX5mPhiA==} - engines: {node: '>=8.0.0'} - peerDependencies: - node-fetch: '*' - peerDependenciesMeta: - node-fetch: - optional: true + fetch-mock@12.2.0: + resolution: {integrity: sha512-XjgxM582kB0SzPOqH2UdGTwSqga8A8aBPjxcYr0wTeOlCWpZoK6zBrPzltECUTu6Zt3VTWafmKF599LN9BRN5Q==} + engines: {node: '>=18.11.0'} fflate@0.8.1: resolution: {integrity: sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==} @@ -3389,8 +3384,9 @@ packages: resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} engines: {node: '>=4'} - is-subset@0.1.1: - resolution: {integrity: sha512-6Ybun0IkarhmEqxXCNw/C0bna6Zb/TkfUX9UbwJtK6ObwAVCxmAP308WWTHviM/zAqXk05cdhYsUsZeGQh99iw==} + is-subset-of@3.1.10: + resolution: {integrity: sha512-avvaYgVmYWyaZ1NDFiv4y9JGkrE2je3op1Po4VYKKJKR8H2qVPsg1GZuuXl5elCTxTlwAIsrAjWAs4BVrISFRw==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. is-symbol@1.0.4: resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} @@ -4519,6 +4515,10 @@ packages: resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} engines: {node: '>= 0.4'} + typedescriptor@3.0.2: + resolution: {integrity: sha512-hyVbaCUd18UiXk656g/imaBLMogpdijIEpnhWYrSda9rhvO4gOU16n2nh7xG5lv/rjumnZzGOdz0CEGTmFe0fQ==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. + typescript@5.6.3: resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} engines: {node: '>=14.17'} @@ -9971,12 +9971,12 @@ snapshots: dependencies: bser: 2.1.1 - fetch-mock@11.1.1: + fetch-mock@12.2.0: dependencies: '@types/glob-to-regexp': 0.4.4 dequal: 2.0.3 glob-to-regexp: 0.4.1 - is-subset: 0.1.1 + is-subset-of: 3.1.10 regexparam: 3.0.0 fflate@0.8.1: {} @@ -10400,7 +10400,9 @@ snapshots: dependencies: better-path-resolve: 1.0.0 - is-subset@0.1.1: {} + is-subset-of@3.1.10: + dependencies: + typedescriptor: 3.0.2 is-symbol@1.0.4: dependencies: @@ -11761,6 +11763,8 @@ snapshots: is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 + typedescriptor@3.0.2: {} + typescript@5.6.3: {} unbox-primitive@1.0.2: From 1fbf64d193c66497af76364e44184d1b18f0f0b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Honor=C3=A9?= Date: Mon, 9 Dec 2024 12:48:43 +0000 Subject: [PATCH 2/5] - --- handlers/ticket-tailor-webhook/test/index.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/ticket-tailor-webhook/test/index.test.ts b/handlers/ticket-tailor-webhook/test/index.test.ts index 5f769542e..319350712 100644 --- a/handlers/ticket-tailor-webhook/test/index.test.ts +++ b/handlers/ticket-tailor-webhook/test/index.test.ts @@ -24,7 +24,7 @@ const validEpochSeconds = beforeEach(() => { process.env.Stage = 'DEV'; - fetchMock.restore(); + fetchMock.hardReset(); }); test('calls create guest account for new email addresses', async () => { From fb85a2f2968f5410fae5a982dd01718d432d1245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Honor=C3=A9?= Date: Mon, 9 Dec 2024 13:06:03 +0000 Subject: [PATCH 3/5] - --- handlers/ticket-tailor-webhook/test/index.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/handlers/ticket-tailor-webhook/test/index.test.ts b/handlers/ticket-tailor-webhook/test/index.test.ts index 319350712..4588de064 100644 --- a/handlers/ticket-tailor-webhook/test/index.test.ts +++ b/handlers/ticket-tailor-webhook/test/index.test.ts @@ -29,18 +29,18 @@ beforeEach(() => { test('calls create guest account for new email addresses', async () => { jest.useFakeTimers().setSystemTime(new Date(validEpochSeconds * 1000)); //Date works in Epoch milli - fetchMock.mock( + fetchMock.route( `https://idapi.code.dev-theguardian.com/user/type/${emailAddress}`, new Response(JSON.stringify({ userType: 'new' })), ); - fetchMock.mock( + fetchMock.route( + 'https://idapi.code.dev-theguardian.com/guest?accountVerificationEmail=true', { - url: 'https://idapi.code.dev-theguardian.com/guest?accountVerificationEmail=true', body: { primaryEmailAddress: emailAddress }, method: 'POST', + status: 200 }, - 200, ); await handler(sqsEvent); From 964eb902f69ea11cd186a9f495285c3739f723ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Honor=C3=A9?= Date: Mon, 9 Dec 2024 13:09:19 +0000 Subject: [PATCH 4/5] - --- handlers/ticket-tailor-webhook/test/index.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/ticket-tailor-webhook/test/index.test.ts b/handlers/ticket-tailor-webhook/test/index.test.ts index 4588de064..b8897653a 100644 --- a/handlers/ticket-tailor-webhook/test/index.test.ts +++ b/handlers/ticket-tailor-webhook/test/index.test.ts @@ -58,7 +58,7 @@ test('calls create guest account for new email addresses', async () => { test('no call to create guest account for an existing email addresses', async () => { jest.useFakeTimers().setSystemTime(new Date(validEpochSeconds * 1000)); //Date works in Epoch milli - fetchMock.mock( + fetchMock.route( `https://idapi.code.dev-theguardian.com/user/type/${emailAddress}`, new Response(JSON.stringify({ userType: 'current' })), ); From d506e2b7086957c4a72e264230c13a1688040bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Honor=C3=A9?= Date: Mon, 9 Dec 2024 13:35:50 +0000 Subject: [PATCH 5/5] - --- handlers/ticket-tailor-webhook/test/index.test.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/handlers/ticket-tailor-webhook/test/index.test.ts b/handlers/ticket-tailor-webhook/test/index.test.ts index b8897653a..dc84d33e4 100644 --- a/handlers/ticket-tailor-webhook/test/index.test.ts +++ b/handlers/ticket-tailor-webhook/test/index.test.ts @@ -28,17 +28,16 @@ beforeEach(() => { }); test('calls create guest account for new email addresses', async () => { - jest.useFakeTimers().setSystemTime(new Date(validEpochSeconds * 1000)); //Date works in Epoch milli - fetchMock.route( + jest.useFakeTimers().setSystemTime(new Date(validEpochSeconds * 1000)); // Date works in Epoch milli + fetchMock.get( `https://idapi.code.dev-theguardian.com/user/type/${emailAddress}`, new Response(JSON.stringify({ userType: 'new' })), ); - fetchMock.route( + fetchMock.post( 'https://idapi.code.dev-theguardian.com/guest?accountVerificationEmail=true', { body: { primaryEmailAddress: emailAddress }, - method: 'POST', status: 200 }, ); @@ -57,8 +56,8 @@ test('calls create guest account for new email addresses', async () => { }); test('no call to create guest account for an existing email addresses', async () => { - jest.useFakeTimers().setSystemTime(new Date(validEpochSeconds * 1000)); //Date works in Epoch milli - fetchMock.route( + jest.useFakeTimers().setSystemTime(new Date(validEpochSeconds * 1000)); // Date works in Epoch milli + fetchMock.get( `https://idapi.code.dev-theguardian.com/user/type/${emailAddress}`, new Response(JSON.stringify({ userType: 'current' })), );