From 44799089d42a9674d0098efd5153bd578d517dae Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Thu, 15 Feb 2024 11:52:05 +0100 Subject: [PATCH 1/6] fix(ws): keep internal close method behind symbol --- src/interceptors/WebSocket/WebSocketClassTransport.ts | 4 ++-- src/interceptors/WebSocket/WebSocketOverride.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/interceptors/WebSocket/WebSocketClassTransport.ts b/src/interceptors/WebSocket/WebSocketClassTransport.ts index 443262ae..1797b133 100644 --- a/src/interceptors/WebSocket/WebSocketClassTransport.ts +++ b/src/interceptors/WebSocket/WebSocketClassTransport.ts @@ -6,7 +6,7 @@ import { WebSocketTransportOnIncomingCallback, WebSocketTransportOnOutgoingCallback, } from './WebSocketTransport' -import { kOnSend, WebSocketOverride } from './WebSocketOverride' +import { kOnSend, kClose, WebSocketOverride } from './WebSocketOverride' export class WebSocketClassTransport extends WebSocketTransport { public onOutgoing: WebSocketTransportOnOutgoingCallback = () => {} @@ -50,6 +50,6 @@ export class WebSocketClassTransport extends WebSocketTransport { * to allow closing the connection with the status codes * that are non-configurable by the user (> 1000 <= 1015). */ - this.ws['_close'](code, reason) + this.ws[kClose](code, reason) } } diff --git a/src/interceptors/WebSocket/WebSocketOverride.ts b/src/interceptors/WebSocket/WebSocketOverride.ts index 546480b5..00711dff 100644 --- a/src/interceptors/WebSocket/WebSocketOverride.ts +++ b/src/interceptors/WebSocket/WebSocketOverride.ts @@ -16,6 +16,7 @@ const WEBSOCKET_CLOSE_CODE_RANGE_ERROR = 'InvalidAccessError: close code out of user configurable range' export const kOnSend = Symbol('kOnSend') +export const kClose = Symbol('kClose') export class WebSocketOverride extends EventTarget implements WebSocket { static readonly CONNECTING = WebSocket.CONNECTING @@ -150,10 +151,10 @@ export class WebSocketOverride extends EventTarget implements WebSocket { return } - this._close(code, reason) + this[kClose](code, reason) } - private _close(code: number = 1000, reason?: string): void { + private [kClose](code: number = 1000, reason?: string): void { this.readyState = this.CLOSING queueMicrotask(() => { From 2e5839232b9acc0f8ee796389f058cdab90ba658 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Thu, 15 Feb 2024 11:52:25 +0100 Subject: [PATCH 2/6] docs: server-to-client forwarding --- src/interceptors/WebSocket/WebSocketServerConnection.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/interceptors/WebSocket/WebSocketServerConnection.ts b/src/interceptors/WebSocket/WebSocketServerConnection.ts index 75fa9e0e..23e50a89 100644 --- a/src/interceptors/WebSocket/WebSocketServerConnection.ts +++ b/src/interceptors/WebSocket/WebSocketServerConnection.ts @@ -3,7 +3,6 @@ import type { WebSocketOverride } from './WebSocketOverride' import type { WebSocketRawData } from './WebSocketTransport' import type { WebSocketClassTransport } from './WebSocketClassTransport' import { bindEvent } from './utils/bindEvent' -import { CloseEvent } from './utils/events' const kEmitter = Symbol('kEmitter') @@ -95,9 +94,10 @@ export class WebSocketServerConnection { this.transport.onIncoming(messageEvent) - // Unless the default is prevented, forward the - // messages from the original server to the mock client. - // This is the only way the user can receive them. + /** + * @note Forward the incoming server events to the client. + * Preventing the default on the message event stops this. + */ if (!messageEvent.defaultPrevented) { this.mockWebSocket.dispatchEvent( bindEvent( From f3af92548554adb2169e411162356f011198c8af Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Thu, 15 Feb 2024 13:38:55 +0100 Subject: [PATCH 3/6] chore: update vitest --- package.json | 2 +- pnpm-lock.yaml | 656 +++++++++++++++++++++++++++++++------------------ 2 files changed, 414 insertions(+), 244 deletions(-) diff --git a/package.json b/package.json index f0496c87..f77c7557 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,7 @@ "tsup": "^6.5.0", "typescript": "^4.9.4", "undici": "^6.5.0", - "vitest": "^0.28.5", + "vitest": "^1.2.2", "vitest-environment-miniflare": "^2.14.1", "wait-for-expect": "^3.0.2", "web-encoding": "^1.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3f5ad027..04db2d9a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,7 +49,7 @@ specifiers: tsup: ^6.5.0 typescript: ^4.9.4 undici: ^6.5.0 - vitest: ^0.28.5 + vitest: ^1.2.2 vitest-environment-miniflare: ^2.14.1 wait-for-expect: ^3.0.2 web-encoding: ^1.1.5 @@ -104,8 +104,8 @@ devDependencies: tsup: 6.7.0_typescript@4.9.5 typescript: 4.9.5 undici: 6.5.0 - vitest: 0.28.5_happy-dom@12.10.3 - vitest-environment-miniflare: 2.14.1_vitest@0.28.5 + vitest: 1.2.2_tzd3dabz5yko6x5zyblyxnclxa + vitest-environment-miniflare: 2.14.1_vitest@1.2.2 wait-for-expect: 3.0.2 web-encoding: 1.1.5 webpack-http-server: 0.5.0 @@ -671,6 +671,15 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true + /@esbuild/aix-ppc64/0.19.12: + resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-arm/0.17.19: resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} engines: {node: '>=12'} @@ -680,8 +689,8 @@ packages: dev: true optional: true - /@esbuild/android-arm/0.18.20: - resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} + /@esbuild/android-arm/0.19.12: + resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -698,8 +707,8 @@ packages: dev: true optional: true - /@esbuild/android-arm64/0.18.20: - resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} + /@esbuild/android-arm64/0.19.12: + resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -716,8 +725,8 @@ packages: dev: true optional: true - /@esbuild/android-x64/0.18.20: - resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} + /@esbuild/android-x64/0.19.12: + resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -734,8 +743,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64/0.18.20: - resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} + /@esbuild/darwin-arm64/0.19.12: + resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -752,8 +761,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64/0.18.20: - resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} + /@esbuild/darwin-x64/0.19.12: + resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -770,8 +779,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64/0.18.20: - resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} + /@esbuild/freebsd-arm64/0.19.12: + resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -788,8 +797,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64/0.18.20: - resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} + /@esbuild/freebsd-x64/0.19.12: + resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -806,8 +815,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm/0.18.20: - resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} + /@esbuild/linux-arm/0.19.12: + resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -824,8 +833,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64/0.18.20: - resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} + /@esbuild/linux-arm64/0.19.12: + resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -842,8 +851,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32/0.18.20: - resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} + /@esbuild/linux-ia32/0.19.12: + resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -860,8 +869,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64/0.18.20: - resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} + /@esbuild/linux-loong64/0.19.12: + resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -878,8 +887,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el/0.18.20: - resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} + /@esbuild/linux-mips64el/0.19.12: + resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -896,8 +905,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64/0.18.20: - resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} + /@esbuild/linux-ppc64/0.19.12: + resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -914,8 +923,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64/0.18.20: - resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} + /@esbuild/linux-riscv64/0.19.12: + resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -932,8 +941,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x/0.18.20: - resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} + /@esbuild/linux-s390x/0.19.12: + resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -950,8 +959,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64/0.18.20: - resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} + /@esbuild/linux-x64/0.19.12: + resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -968,8 +977,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64/0.18.20: - resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} + /@esbuild/netbsd-x64/0.19.12: + resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -986,8 +995,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64/0.18.20: - resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} + /@esbuild/openbsd-x64/0.19.12: + resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -1004,8 +1013,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64/0.18.20: - resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} + /@esbuild/sunos-x64/0.19.12: + resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -1022,8 +1031,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64/0.18.20: - resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} + /@esbuild/win32-arm64/0.19.12: + resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -1040,8 +1049,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32/0.18.20: - resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} + /@esbuild/win32-ia32/0.19.12: + resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -1058,8 +1067,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64/0.18.20: - resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} + /@esbuild/win32-x64/0.19.12: + resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -1218,6 +1227,13 @@ packages: - supports-color dev: true + /@jest/schemas/29.6.3: + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.27.8 + dev: true + /@jest/source-map/27.5.1: resolution: {integrity: sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -1578,6 +1594,114 @@ packages: fsevents: 2.3.2 dev: true + /@rollup/rollup-android-arm-eabi/4.11.0: + resolution: {integrity: sha512-BV+u2QSfK3i1o6FucqJh5IK9cjAU6icjFFhvknzFgu472jzl0bBojfDAkJLBEsHFMo+YZg6rthBvBBt8z12IBQ==} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-android-arm64/4.11.0: + resolution: {integrity: sha512-0ij3iw7sT5jbcdXofWO2NqDNjSVVsf6itcAkV2I6Xsq4+6wjW1A8rViVB67TfBEan7PV2kbLzT8rhOVWLI2YXw==} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-arm64/4.11.0: + resolution: {integrity: sha512-yPLs6RbbBMupArf6qv1UDk6dzZvlH66z6NLYEwqTU0VHtss1wkI4UYeeMS7TVj5QRVvaNAWYKP0TD/MOeZ76Zg==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-x64/4.11.0: + resolution: {integrity: sha512-OvqIgwaGAwnASzXaZEeoJY3RltOFg+WUbdkdfoluh2iqatd090UeOG3A/h0wNZmE93dDew9tAtXgm3/+U/B6bw==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm-gnueabihf/4.11.0: + resolution: {integrity: sha512-X17s4hZK3QbRmdAuLd2EE+qwwxL8JxyVupEqAkxKPa/IgX49ZO+vf0ka69gIKsaYeo6c1CuwY3k8trfDtZ9dFg==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-gnu/4.11.0: + resolution: {integrity: sha512-673Lu9EJwxVB9NfYeA4AdNu0FOHz7g9t6N1DmT7bZPn1u6bTF+oZjj+fuxUcrfxWXE0r2jxl5QYMa9cUOj9NFg==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-musl/4.11.0: + resolution: {integrity: sha512-yFW2msTAQNpPJaMmh2NpRalr1KXI7ZUjlN6dY/FhWlOclMrZezm5GIhy3cP4Ts2rIAC+IPLAjNibjp1BsxCVGg==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-riscv64-gnu/4.11.0: + resolution: {integrity: sha512-kKT9XIuhbvYgiA3cPAGntvrBgzhWkGpBMzuk1V12Xuoqg7CI41chye4HU0vLJnGf9MiZzfNh4I7StPeOzOWJfA==} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-gnu/4.11.0: + resolution: {integrity: sha512-6q4ESWlyTO+erp1PSCmASac+ixaDv11dBk1fqyIuvIUc/CmRAX2Zk+2qK1FGo5q7kyDcjHCFVwgGFCGIZGVwCA==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-musl/4.11.0: + resolution: {integrity: sha512-vIAQUmXeMLmaDN78HSE4Kh6xqof2e3TJUKr+LPqXWU4NYNON0MDN9h2+t4KHrPAQNmU3w1GxBQ/n01PaWFwa5w==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-arm64-msvc/4.11.0: + resolution: {integrity: sha512-LVXo9dDTGPr0nezMdqa1hK4JeoMZ02nstUxGYY/sMIDtTYlli1ZxTXBYAz3vzuuvKO4X6NBETciIh7N9+abT1g==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-ia32-msvc/4.11.0: + resolution: {integrity: sha512-xZVt6K70Gr3I7nUhug2dN6VRR1ibot3rXqXS3wo+8JP64t7djc3lBFyqO4GiVrhNaAIhUCJtwQ/20dr0h0thmQ==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-x64-msvc/4.11.0: + resolution: {integrity: sha512-f3I7h9oTg79UitEco9/2bzwdciYkWr8pITs3meSDSlr1TdvQ7IxkQaaYN2YqZXX5uZhiYL+VuYDmHwNzhx+HOg==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@sinclair/typebox/0.27.8: + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + dev: true + /@sindresorhus/is/4.6.0: resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} @@ -1678,16 +1802,6 @@ packages: '@types/responselike': 1.0.0 dev: true - /@types/chai-subset/1.3.3: - resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} - dependencies: - '@types/chai': 4.3.5 - dev: true - - /@types/chai/4.3.5: - resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==} - dev: true - /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: @@ -1718,13 +1832,13 @@ packages: resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==} dependencies: '@types/eslint': 8.44.2 - '@types/estree': 1.0.1 + '@types/estree': 1.0.5 dev: true /@types/eslint/8.44.2: resolution: {integrity: sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==} dependencies: - '@types/estree': 1.0.1 + '@types/estree': 1.0.5 '@types/json-schema': 7.0.12 dev: true @@ -1732,6 +1846,10 @@ packages: resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} dev: true + /@types/estree/1.0.5: + resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + dev: true + /@types/express-rate-limit/6.0.0_express@4.18.2: resolution: {integrity: sha512-nZxo3nwU20EkTl/f2eGdndQkDIJYwkXIX4S3Vrp2jMdSdFJ6AWtIda8gOz0wiMuOFoeH/UUlCAiacz3x3eWNFA==} deprecated: This is a stub types definition. express-rate-limit provides its own type definitions, so you do not need this installed. @@ -1941,36 +2059,43 @@ packages: '@types/yargs-parser': 21.0.0 dev: true - /@vitest/expect/0.28.5: - resolution: {integrity: sha512-gqTZwoUTwepwGIatnw4UKpQfnoyV0Z9Czn9+Lo2/jLIt4/AXLTn+oVZxlQ7Ng8bzcNkR+3DqLJ08kNr8jRmdNQ==} + /@vitest/expect/1.2.2: + resolution: {integrity: sha512-3jpcdPAD7LwHUUiT2pZTj2U82I2Tcgg2oVPvKxhn6mDI2On6tfvPQTjAI4628GUGDZrCm4Zna9iQHm5cEexOAg==} dependencies: - '@vitest/spy': 0.28.5 - '@vitest/utils': 0.28.5 - chai: 4.3.8 + '@vitest/spy': 1.2.2 + '@vitest/utils': 1.2.2 + chai: 4.4.1 dev: true - /@vitest/runner/0.28.5: - resolution: {integrity: sha512-NKkHtLB+FGjpp5KmneQjTcPLWPTDfB7ie+MmF1PnUBf/tGe2OjGxWyB62ySYZ25EYp9krR5Bw0YPLS/VWh1QiA==} + /@vitest/runner/1.2.2: + resolution: {integrity: sha512-JctG7QZ4LSDXr5CsUweFgcpEvrcxOV1Gft7uHrvkQ+fsAVylmWQvnaAr/HDp3LAH1fztGMQZugIheTWjaGzYIg==} dependencies: - '@vitest/utils': 0.28.5 - p-limit: 4.0.0 + '@vitest/utils': 1.2.2 + p-limit: 5.0.0 pathe: 1.1.1 dev: true - /@vitest/spy/0.28.5: - resolution: {integrity: sha512-7if6rsHQr9zbmvxN7h+gGh2L9eIIErgf8nSKYDlg07HHimCxp4H6I/X/DPXktVPPLQfiZ1Cw2cbDIx9fSqDjGw==} + /@vitest/snapshot/1.2.2: + resolution: {integrity: sha512-SmGY4saEw1+bwE1th6S/cZmPxz/Q4JWsl7LvbQIky2tKE35US4gd0Mjzqfr84/4OD0tikGWaWdMja/nWL5NIPA==} dependencies: - tinyspy: 1.1.1 + magic-string: 0.30.7 + pathe: 1.1.1 + pretty-format: 29.7.0 dev: true - /@vitest/utils/0.28.5: - resolution: {integrity: sha512-UyZdYwdULlOa4LTUSwZ+Paz7nBHGTT72jKwdFSV4IjHF1xsokp+CabMdhjvVhYwkLfO88ylJT46YMilnkSARZA==} + /@vitest/spy/1.2.2: + resolution: {integrity: sha512-k9Gcahssw8d7X3pSLq3e3XEu/0L78mUkCjivUqCQeXJm9clfXR/Td8+AP+VC1O6fKPIDLcHDTAmBOINVuv6+7g==} dependencies: - cli-truncate: 3.1.0 - diff: 5.1.0 - loupe: 2.3.6 - picocolors: 1.0.0 - pretty-format: 27.5.1 + tinyspy: 2.2.1 + dev: true + + /@vitest/utils/1.2.2: + resolution: {integrity: sha512-WKITBHLsBHlpjnDQahr+XK6RE7MiAsgrIkr0pGhQ9ygoxBfUeG0lUG5iLlzqjmKSlBv3+j5EGsriBzh+C3Tq9g==} + dependencies: + diff-sequences: 29.6.3 + estree-walker: 3.0.3 + loupe: 2.3.7 + pretty-format: 29.7.0 dev: true /@webassemblyjs/ast/1.11.6: @@ -2133,8 +2258,8 @@ packages: engines: {node: '>=0.4.0'} dev: true - /acorn-walk/8.2.0: - resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} + /acorn-walk/8.3.2: + resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} engines: {node: '>=0.4.0'} dev: true @@ -2150,6 +2275,12 @@ packages: hasBin: true dev: true + /acorn/8.11.3: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + /agent-base/6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -2198,11 +2329,6 @@ packages: engines: {node: '>=8'} dev: true - /ansi-regex/6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - dev: true - /ansi-styles/3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -2222,11 +2348,6 @@ packages: engines: {node: '>=10'} dev: true - /ansi-styles/6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - dev: true - /any-promise/1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} dev: true @@ -2611,14 +2732,14 @@ packages: resolution: {integrity: sha512-Jj917pJtYg9HSJBF95HVX3Cdr89JUyLT4IZ8SvM5aDRni95swKgYi3TgYLH5hnGfPE/U1dg6IfZ50UsIlLkwSA==} dev: true - /chai/4.3.8: - resolution: {integrity: sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==} + /chai/4.4.1: + resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==} engines: {node: '>=4'} dependencies: assertion-error: 1.1.0 - check-error: 1.0.2 + check-error: 1.0.3 deep-eql: 4.1.3 - get-func-name: 2.0.0 + get-func-name: 2.0.2 loupe: 2.3.6 pathval: 1.1.1 type-detect: 4.0.8 @@ -2650,8 +2771,10 @@ packages: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} dev: true - /check-error/1.0.2: - resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} + /check-error/1.0.3: + resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + dependencies: + get-func-name: 2.0.2 dev: true /chokidar/3.5.3: @@ -2695,14 +2818,6 @@ packages: engines: {node: '>=6'} dev: true - /cli-truncate/3.1.0: - resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - slice-ansi: 5.0.0 - string-width: 5.1.2 - dev: true - /cli-width/3.0.0: resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} engines: {node: '>= 10'} @@ -3155,13 +3270,13 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dev: true - /diff/4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} + /diff-sequences/29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /diff/5.1.0: - resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} + /diff/4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} dev: true @@ -3206,10 +3321,6 @@ packages: stream-shift: 1.0.1 dev: true - /eastasianwidth/0.2.0: - resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - dev: true - /ee-first/1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: true @@ -3227,10 +3338,6 @@ packages: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true - /emoji-regex/9.2.2: - resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - dev: true - /encodeurl/1.0.2: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} engines: {node: '>= 0.8'} @@ -3334,34 +3441,35 @@ packages: '@esbuild/win32-x64': 0.17.19 dev: true - /esbuild/0.18.20: - resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} + /esbuild/0.19.12: + resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.18.20 - '@esbuild/android-arm64': 0.18.20 - '@esbuild/android-x64': 0.18.20 - '@esbuild/darwin-arm64': 0.18.20 - '@esbuild/darwin-x64': 0.18.20 - '@esbuild/freebsd-arm64': 0.18.20 - '@esbuild/freebsd-x64': 0.18.20 - '@esbuild/linux-arm': 0.18.20 - '@esbuild/linux-arm64': 0.18.20 - '@esbuild/linux-ia32': 0.18.20 - '@esbuild/linux-loong64': 0.18.20 - '@esbuild/linux-mips64el': 0.18.20 - '@esbuild/linux-ppc64': 0.18.20 - '@esbuild/linux-riscv64': 0.18.20 - '@esbuild/linux-s390x': 0.18.20 - '@esbuild/linux-x64': 0.18.20 - '@esbuild/netbsd-x64': 0.18.20 - '@esbuild/openbsd-x64': 0.18.20 - '@esbuild/sunos-x64': 0.18.20 - '@esbuild/win32-arm64': 0.18.20 - '@esbuild/win32-ia32': 0.18.20 - '@esbuild/win32-x64': 0.18.20 + '@esbuild/aix-ppc64': 0.19.12 + '@esbuild/android-arm': 0.19.12 + '@esbuild/android-arm64': 0.19.12 + '@esbuild/android-x64': 0.19.12 + '@esbuild/darwin-arm64': 0.19.12 + '@esbuild/darwin-x64': 0.19.12 + '@esbuild/freebsd-arm64': 0.19.12 + '@esbuild/freebsd-x64': 0.19.12 + '@esbuild/linux-arm': 0.19.12 + '@esbuild/linux-arm64': 0.19.12 + '@esbuild/linux-ia32': 0.19.12 + '@esbuild/linux-loong64': 0.19.12 + '@esbuild/linux-mips64el': 0.19.12 + '@esbuild/linux-ppc64': 0.19.12 + '@esbuild/linux-riscv64': 0.19.12 + '@esbuild/linux-s390x': 0.19.12 + '@esbuild/linux-x64': 0.19.12 + '@esbuild/netbsd-x64': 0.19.12 + '@esbuild/openbsd-x64': 0.19.12 + '@esbuild/sunos-x64': 0.19.12 + '@esbuild/win32-arm64': 0.19.12 + '@esbuild/win32-ia32': 0.19.12 + '@esbuild/win32-x64': 0.19.12 dev: true /escalade/3.1.1: @@ -3426,6 +3534,12 @@ packages: engines: {node: '>=4.0'} dev: true + /estree-walker/3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + dependencies: + '@types/estree': 1.0.1 + dev: true + /esutils/2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -3471,6 +3585,21 @@ packages: strip-final-newline: 3.0.0 dev: true + /execa/8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.1.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + dev: true + /exit/0.1.2: resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} engines: {node: '>= 0.8.0'} @@ -3771,8 +3900,8 @@ packages: engines: {node: 6.* || 8.* || >= 10.*} dev: true - /get-func-name/2.0.0: - resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} + /get-func-name/2.0.2: + resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} dev: true /get-intrinsic/1.2.1: @@ -3801,6 +3930,11 @@ packages: engines: {node: '>=10'} dev: true + /get-stream/8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + dev: true + /git-log-parser/1.2.0: resolution: {integrity: sha512-rnCVNfkTL8tdNryFuaY0fYiBWEBcgF748O6ZI61rslBvr2o7U65c2/6npCRqH40vuAhtgtDiqLTJjBVdrejCzA==} dependencies: @@ -4070,6 +4204,11 @@ packages: engines: {node: '>=12.20.0'} dev: true + /human-signals/5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + dev: true + /iconv-lite/0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -4201,11 +4340,6 @@ packages: engines: {node: '>=8'} dev: true - /is-fullwidth-code-point/4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - dev: true - /is-generator-fn/2.1.0: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} engines: {node: '>=6'} @@ -4861,7 +4995,7 @@ packages: optional: true dependencies: abab: 2.0.6 - acorn: 8.10.0 + acorn: 8.11.3 acorn-globals: 6.0.0 cssom: 0.4.4 cssstyle: 2.3.0 @@ -4989,9 +5123,12 @@ packages: engines: {node: '>=6.11.5'} dev: true - /local-pkg/0.4.3: - resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} + /local-pkg/0.5.0: + resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} engines: {node: '>=14'} + dependencies: + mlly: 1.5.0 + pkg-types: 1.0.3 dev: true /locate-path/5.0.0: @@ -5074,8 +5211,15 @@ packages: /loupe/2.3.6: resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} + deprecated: Please upgrade to 2.3.7 which fixes GHSA-4q6p-r6v2-jvc5 dependencies: - get-func-name: 2.0.0 + get-func-name: 2.0.2 + dev: true + + /loupe/2.3.7: + resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + dependencies: + get-func-name: 2.0.2 dev: true /lowercase-keys/2.0.0: @@ -5096,6 +5240,13 @@ packages: yallist: 4.0.0 dev: true + /magic-string/0.30.7: + resolution: {integrity: sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + /make-dir/4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} @@ -5254,13 +5405,13 @@ packages: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} dev: true - /mlly/1.4.1: - resolution: {integrity: sha512-SCDs78Q2o09jiZiE2WziwVBEqXQ02XkGdUy45cbJf+BpYRIjArXRJ1Wbowxkb+NaM9DWvS3UC9GiO/6eqvQ/pg==} + /mlly/1.5.0: + resolution: {integrity: sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==} dependencies: - acorn: 8.10.0 - pathe: 1.1.1 + acorn: 8.11.3 + pathe: 1.1.2 pkg-types: 1.0.3 - ufo: 1.3.0 + ufo: 1.4.0 dev: true /mri/1.1.4: @@ -5297,8 +5448,8 @@ packages: thenify-all: 1.6.0 dev: true - /nanoid/3.3.6: - resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} + /nanoid/3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true dev: true @@ -5474,9 +5625,9 @@ packages: yocto-queue: 0.1.0 dev: true - /p-limit/4.0.0: - resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /p-limit/5.0.0: + resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} + engines: {node: '>=18'} dependencies: yocto-queue: 1.0.0 dev: true @@ -5572,6 +5723,10 @@ packages: resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} dev: true + /pathe/1.1.2: + resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + dev: true + /pathval/1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} dev: true @@ -5648,7 +5803,7 @@ packages: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} dependencies: jsonc-parser: 3.2.0 - mlly: 1.4.1 + mlly: 1.5.0 pathe: 1.1.1 dev: true @@ -5674,11 +5829,11 @@ packages: yaml: 1.10.2 dev: true - /postcss/8.4.28: - resolution: {integrity: sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==} + /postcss/8.4.35: + resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.6 + nanoid: 3.3.7 picocolors: 1.0.0 source-map-js: 1.0.2 dev: true @@ -5692,6 +5847,15 @@ packages: react-is: 17.0.2 dev: true + /pretty-format/29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + /process-nextick-args/2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true @@ -5822,6 +5986,10 @@ packages: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} dev: true + /react-is/18.2.0: + resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + dev: true + /read-pkg-up/7.0.1: resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} engines: {node: '>=8'} @@ -5992,6 +6160,29 @@ packages: fsevents: 2.3.3 dev: true + /rollup/4.11.0: + resolution: {integrity: sha512-2xIbaXDXjf3u2tajvA5xROpib7eegJ9Y/uPlSFhXLNpK9ampCczXAhLEb5yLzJyG3LAdI1NWtNjDXiLyniNdjQ==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + dependencies: + '@types/estree': 1.0.5 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.11.0 + '@rollup/rollup-android-arm64': 4.11.0 + '@rollup/rollup-darwin-arm64': 4.11.0 + '@rollup/rollup-darwin-x64': 4.11.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.11.0 + '@rollup/rollup-linux-arm64-gnu': 4.11.0 + '@rollup/rollup-linux-arm64-musl': 4.11.0 + '@rollup/rollup-linux-riscv64-gnu': 4.11.0 + '@rollup/rollup-linux-x64-gnu': 4.11.0 + '@rollup/rollup-linux-x64-musl': 4.11.0 + '@rollup/rollup-win32-arm64-msvc': 4.11.0 + '@rollup/rollup-win32-ia32-msvc': 4.11.0 + '@rollup/rollup-win32-x64-msvc': 4.11.0 + fsevents: 2.3.3 + dev: true + /run-async/2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} engines: {node: '>=0.12.0'} @@ -6147,6 +6338,11 @@ packages: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true + /signal-exit/4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + dev: true + /simple-git-hooks/2.9.0: resolution: {integrity: sha512-waSQ5paUQtyGC0ZxlHmcMmD9I1rRXauikBwX31bX58l5vTOhCEcBC5Bi+ZDkPXTjDnZAF8TbCqKBY+9+sVPScw==} hasBin: true @@ -6162,14 +6358,6 @@ packages: engines: {node: '>=8'} dev: true - /slice-ansi/5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - dev: true - /socket.io-adapter/2.5.2: resolution: {integrity: sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==} dependencies: @@ -6318,8 +6506,8 @@ packages: engines: {node: '>= 0.8'} dev: true - /std-env/3.4.3: - resolution: {integrity: sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==} + /std-env/3.7.0: + resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} dev: true /stream-combiner2/1.1.1: @@ -6359,15 +6547,6 @@ packages: strip-ansi: 6.0.1 dev: true - /string-width/5.1.2: - resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} - engines: {node: '>=12'} - dependencies: - eastasianwidth: 0.2.0 - emoji-regex: 9.2.2 - strip-ansi: 7.1.0 - dev: true - /string_decoder/1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} dependencies: @@ -6387,13 +6566,6 @@ packages: ansi-regex: 5.0.1 dev: true - /strip-ansi/7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - dependencies: - ansi-regex: 6.0.1 - dev: true - /strip-bom/4.0.0: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} engines: {node: '>=8'} @@ -6575,7 +6747,7 @@ packages: hasBin: true dependencies: '@jridgewell/source-map': 0.3.5 - acorn: 8.10.0 + acorn: 8.11.3 commander: 2.20.3 source-map-support: 0.5.21 dev: true @@ -6634,17 +6806,17 @@ packages: readable-stream: 3.6.2 dev: true - /tinybench/2.5.0: - resolution: {integrity: sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==} + /tinybench/2.6.0: + resolution: {integrity: sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==} dev: true - /tinypool/0.3.1: - resolution: {integrity: sha512-zLA1ZXlstbU2rlpA4CIeVaqvWq41MTWqLY3FfsAXgC8+f7Pk7zroaJQxDgxn1xNudKW6Kmj4808rPFShUlIRmQ==} + /tinypool/0.8.2: + resolution: {integrity: sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==} engines: {node: '>=14.0.0'} dev: true - /tinyspy/1.1.1: - resolution: {integrity: sha512-UVq5AXt/gQlti7oxoIg5oi/9r0WpF7DGEVwXgqWSMmyN16+e3tl5lIvTaOpJ3TAtu5xFzWccFRM4R5NaWHF+4g==} + /tinyspy/2.2.1: + resolution: {integrity: sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==} engines: {node: '>=14.0.0'} dev: true @@ -6775,8 +6947,8 @@ packages: '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 '@types/node': 16.18.46 - acorn: 8.10.0 - acorn-walk: 8.2.0 + acorn: 8.11.3 + acorn-walk: 8.3.2 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 @@ -6806,8 +6978,8 @@ packages: '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 '@types/node': 20.4.7 - acorn: 8.10.0 - acorn-walk: 8.2.0 + acorn: 8.11.3 + acorn-walk: 8.3.2 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 @@ -6903,8 +7075,8 @@ packages: hasBin: true dev: true - /ufo/1.3.0: - resolution: {integrity: sha512-bRn3CsoojyNStCZe0BG0Mt4Nr/4KF+rhFlnNXybgqt5pXHNFRlqinSoQaTrGyzE4X8aHplSb+TorH+COin9Yxw==} + /ufo/1.4.0: + resolution: {integrity: sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==} dev: true /undici/5.20.0: @@ -7015,19 +7187,16 @@ packages: engines: {node: '>= 0.8'} dev: true - /vite-node/0.28.5_@types+node@16.18.46: - resolution: {integrity: sha512-LmXb9saMGlrMZbXTvOveJKwMTBTNUH66c8rJnQ0ZPNX+myPEol64+szRzXtV5ORb0Hb/91yq+/D3oERoyAt6LA==} - engines: {node: '>=v14.16.0'} + /vite-node/1.2.2_@types+node@16.18.46: + resolution: {integrity: sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true dependencies: cac: 6.7.14 debug: 4.3.4 - mlly: 1.4.1 pathe: 1.1.1 picocolors: 1.0.0 - source-map: 0.6.1 - source-map-support: 0.5.21 - vite: 4.4.9_@types+node@16.18.46 + vite: 5.1.2_@types+node@16.18.46 transitivePeerDependencies: - '@types/node' - less @@ -7039,12 +7208,12 @@ packages: - terser dev: true - /vite/4.4.9_@types+node@16.18.46: - resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} - engines: {node: ^14.18.0 || >=16.0.0} + /vite/5.1.2_@types+node@16.18.46: + resolution: {integrity: sha512-uwiFebQbTWRIGbCaTEBVAfKqgqKNKMJ2uPXsXeLIZxM8MVMjoS3j0cG8NrPxdDIadaWnPSjrkLWffLSC+uiP3Q==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: - '@types/node': '>= 14' + '@types/node': ^18.0.0 || >=20.0.0 less: '*' lightningcss: ^1.21.0 sass: '*' @@ -7068,14 +7237,14 @@ packages: optional: true dependencies: '@types/node': 16.18.46 - esbuild: 0.18.20 - postcss: 8.4.28 - rollup: 3.28.1 + esbuild: 0.19.12 + postcss: 8.4.35 + rollup: 4.11.0 optionalDependencies: fsevents: 2.3.3 dev: true - /vitest-environment-miniflare/2.14.1_vitest@0.28.5: + /vitest-environment-miniflare/2.14.1_vitest@1.2.2: resolution: {integrity: sha512-efMpx9XnpjHeIN1lnEMO+4Ky9xSFM0VeG8Ilf+5Uyh8U8lNuJ+qTTfr76LQ6MQcNzkLMo4byh0YxaZo8QfIYrw==} engines: {node: '>=16.13'} peerDependencies: @@ -7086,25 +7255,28 @@ packages: '@miniflare/shared': 2.14.1 '@miniflare/shared-test-environment': 2.14.1 undici: 5.20.0 - vitest: 0.28.5_happy-dom@12.10.3 + vitest: 1.2.2_tzd3dabz5yko6x5zyblyxnclxa transitivePeerDependencies: - bufferutil - utf-8-validate dev: true - /vitest/0.28.5_happy-dom@12.10.3: - resolution: {integrity: sha512-pyCQ+wcAOX7mKMcBNkzDwEHRGqQvHUl0XnoHR+3Pb1hytAHISgSxv9h0gUiSiYtISXUU3rMrKiKzFYDrI6ZIHA==} - engines: {node: '>=v14.16.0'} + /vitest/1.2.2_tzd3dabz5yko6x5zyblyxnclxa: + resolution: {integrity: sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@vitest/browser': '*' - '@vitest/ui': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': ^1.0.0 + '@vitest/ui': ^1.0.0 happy-dom: '*' jsdom: '*' peerDependenciesMeta: '@edge-runtime/vm': optional: true + '@types/node': + optional: true '@vitest/browser': optional: true '@vitest/ui': @@ -7114,30 +7286,28 @@ packages: jsdom: optional: true dependencies: - '@types/chai': 4.3.5 - '@types/chai-subset': 1.3.3 '@types/node': 16.18.46 - '@vitest/expect': 0.28.5 - '@vitest/runner': 0.28.5 - '@vitest/spy': 0.28.5 - '@vitest/utils': 0.28.5 - acorn: 8.10.0 - acorn-walk: 8.2.0 + '@vitest/expect': 1.2.2 + '@vitest/runner': 1.2.2 + '@vitest/snapshot': 1.2.2 + '@vitest/spy': 1.2.2 + '@vitest/utils': 1.2.2 + acorn-walk: 8.3.2 cac: 6.7.14 - chai: 4.3.8 + chai: 4.4.1 debug: 4.3.4 + execa: 8.0.1 happy-dom: 12.10.3 - local-pkg: 0.4.3 + local-pkg: 0.5.0 + magic-string: 0.30.7 pathe: 1.1.1 picocolors: 1.0.0 - source-map: 0.6.1 - std-env: 3.4.3 + std-env: 3.7.0 strip-literal: 1.3.0 - tinybench: 2.5.0 - tinypool: 0.3.1 - tinyspy: 1.1.1 - vite: 4.4.9_@types+node@16.18.46 - vite-node: 0.28.5_@types+node@16.18.46 + tinybench: 2.6.0 + tinypool: 0.8.2 + vite: 5.1.2_@types+node@16.18.46 + vite-node: 1.2.2_@types+node@16.18.46 why-is-node-running: 2.2.2 transitivePeerDependencies: - less From f6f054d6d49dad402c59c52fb3b8aa90ea756dfe Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Thu, 15 Feb 2024 13:39:22 +0100 Subject: [PATCH 4/6] fix: add CancelableMessageEvent for node.js --- .../WebSocket/WebSocketServerConnection.ts | 79 +++++++++-------- src/interceptors/WebSocket/utils/events.ts | 35 ++++++++ test/envs/node-with-websocket.ts | 1 + .../exchange/websocket.server.connect.test.ts | 1 - .../intercept/websocket.server.events.test.ts | 87 +++++++++++++++++++ 5 files changed, 162 insertions(+), 41 deletions(-) create mode 100644 test/modules/WebSocket/intercept/websocket.server.events.test.ts diff --git a/src/interceptors/WebSocket/WebSocketServerConnection.ts b/src/interceptors/WebSocket/WebSocketServerConnection.ts index 23e50a89..3a954603 100644 --- a/src/interceptors/WebSocket/WebSocketServerConnection.ts +++ b/src/interceptors/WebSocket/WebSocketServerConnection.ts @@ -3,6 +3,7 @@ import type { WebSocketOverride } from './WebSocketOverride' import type { WebSocketRawData } from './WebSocketTransport' import type { WebSocketClassTransport } from './WebSocketClassTransport' import { bindEvent } from './utils/bindEvent' +import { CancelableMessageEvent } from './utils/events' const kEmitter = Symbol('kEmitter') @@ -30,6 +31,19 @@ export class WebSocketServerConnection { // whenever a "message" event from the actual server // is dispatched on it (the dispatch will be skipped). this.transport.onIncoming = (event) => { + // Clone the event to dispatch it on this class + // once again and prevent the "already being dispatched" + // exception. Clone it here so we can observe this event + // being prevented in the "server.on()" listeners. + const messageEvent = bindEvent( + this.realWebSocket!, + new CancelableMessageEvent('message', { + data: event.data, + origin: event.origin, + cancelable: true, + }) + ) + /** * @note Emit "message" event on the WebSocketClassServer * instance to let the interceptor know about these @@ -37,7 +51,30 @@ export class WebSocketServerConnection { * the interceptor can modify or skip the event forwarding * to the mock WebSocket instance. */ - this[kEmitter].dispatchEvent(event) + this[kEmitter].dispatchEvent(messageEvent) + + /** + * @note Forward the incoming server events to the client. + * Preventing the default on the message event stops this. + */ + if (!messageEvent.defaultPrevented) { + this.mockWebSocket.dispatchEvent( + bindEvent( + /** + * @note Bind the forwarded original server events + * to the mock WebSocket instance so it would + * dispatch them straight away. + */ + this.mockWebSocket, + // Clone the message event again to prevent + // the "already being dispatched" exception. + new MessageEvent('message', { + data: event.data, + origin: event.origin, + }) + ) + ) + } } } @@ -76,46 +113,8 @@ export class WebSocketServerConnection { { once: true } ) - // Once the connection is open, forward any incoming - // events directly to the (override) WebSocket instance. ws.addEventListener('message', (event) => { - // Clone the event to dispatch it on this class - // once again and prevent the "already being dispatched" - // exception. Clone it here so we can observe this event - // being prevented in the "server.on()" listeners. - const messageEvent = bindEvent( - ws, - new MessageEvent('message', { - data: event.data, - origin: event.origin, - cancelable: true, - }) - ) - - this.transport.onIncoming(messageEvent) - - /** - * @note Forward the incoming server events to the client. - * Preventing the default on the message event stops this. - */ - if (!messageEvent.defaultPrevented) { - this.mockWebSocket.dispatchEvent( - bindEvent( - /** - * @note Bind the forwarded original server events - * to the mock WebSocket instance so it would - * dispatch them straight away. - */ - this.mockWebSocket, - // Clone the message event again to prevent - // the "already being dispatched" exception. - new MessageEvent('message', { - data: event.data, - origin: event.origin, - }) - ) - ) - } + this.transport.onIncoming(event) }) this.realWebSocket = ws diff --git a/src/interceptors/WebSocket/utils/events.ts b/src/interceptors/WebSocket/utils/events.ts index c47e1a7c..d78fd777 100644 --- a/src/interceptors/WebSocket/utils/events.ts +++ b/src/interceptors/WebSocket/utils/events.ts @@ -1,3 +1,38 @@ +const kCancelable = Symbol('kCancelable') +const kDefaultPrevented = Symbol('kDefaultPrevented') + +/** + * A `MessageEvent` superset that supports event cancellation + * in Node.js. It's rather non-intrusive so it can be safely + * used in the browser as well. + * + * @see https://github.com/nodejs/node/issues/51767 + */ +export class CancelableMessageEvent extends MessageEvent { + [kCancelable]: boolean; + [kDefaultPrevented]: boolean + + constructor(type: string, init: MessageEventInit) { + super(type, init) + this[kCancelable] = !!init.cancelable + this[kDefaultPrevented] = false + } + + get cancelable() { + return this[kCancelable] + } + + get defaultPrevented() { + return this[kDefaultPrevented] + } + + public preventDefault(): void { + if (this.cancelable && !this[kDefaultPrevented]) { + this[kDefaultPrevented] = true + } + } +} + interface CloseEventInit extends EventInit { code?: number reason?: string diff --git a/test/envs/node-with-websocket.ts b/test/envs/node-with-websocket.ts index 70399e58..2189fc39 100644 --- a/test/envs/node-with-websocket.ts +++ b/test/envs/node-with-websocket.ts @@ -7,6 +7,7 @@ import { WebSocket } from 'undici' export default { name: 'node-with-websocket', + transformMode: 'ssr', async setup(global, options) { const { teardown } = await builtinEnvironments.node.setup(global, options) diff --git a/test/modules/WebSocket/exchange/websocket.server.connect.test.ts b/test/modules/WebSocket/exchange/websocket.server.connect.test.ts index 87a2fe60..ed67bc21 100644 --- a/test/modules/WebSocket/exchange/websocket.server.connect.test.ts +++ b/test/modules/WebSocket/exchange/websocket.server.connect.test.ts @@ -6,7 +6,6 @@ import { WebSocketServer } from 'ws' import { DeferredPromise } from '@open-draft/deferred-promise' import { WebSocketInterceptor } from '../../../../src/interceptors/WebSocket' import { getWsUrl } from '../utils/getWsUrl' -import { waitForNextTick } from '../utils/waitForNextTick' const interceptor = new WebSocketInterceptor() diff --git a/test/modules/WebSocket/intercept/websocket.server.events.test.ts b/test/modules/WebSocket/intercept/websocket.server.events.test.ts new file mode 100644 index 00000000..1ab5872b --- /dev/null +++ b/test/modules/WebSocket/intercept/websocket.server.events.test.ts @@ -0,0 +1,87 @@ +/** + * @vitest-environment node-with-websocket + */ +import { vi, it, expect, beforeAll, afterAll } from 'vitest' +import { WebSocketServer } from 'ws' +import { WebSocketInterceptor } from '../../../../src/interceptors/WebSocket' +import { getWsUrl } from '../utils/getWsUrl' + +const interceptor = new WebSocketInterceptor() + +const wsServer = new WebSocketServer({ + host: '127.0.0.1', + port: 0, +}) + +beforeAll(() => { + interceptor.apply() +}) + +afterAll(() => { + interceptor.dispose() + wsServer.close() +}) + +it('emits a MessageEvent on incoming server message', async () => { + wsServer.once('connection', (ws) => { + ws.send('hi from server') + }) + + const serverMessageListener = vi.fn() + interceptor.once('connection', ({ server }) => { + server.connect() + server.addEventListener('message', serverMessageListener) + }) + + const clientMessageListener = vi.fn() + const ws = new WebSocket(getWsUrl(wsServer)) + ws.onmessage = (event) => clientMessageListener(event) + + // Must dispatch the correct incoming server MessageEvent. + await vi.waitFor(() => { + expect(serverMessageListener).toHaveBeenCalledTimes(1) + const event = serverMessageListener.mock.calls[0][0] as MessageEvent + + expect(event).toBeInstanceOf(MessageEvent) + expect(event.type).toBe('message') + expect(event.data).toBe('hi from server') + expect(event.origin).toBe(getWsUrl(wsServer)) + expect(event.cancelable).toBe(true) + expect(event.defaultPrevented).toBe(false) + }) + + // Must dispatch the correct received client MessageEvent. + await vi.waitFor(() => { + expect(clientMessageListener).toBeCalledTimes(1) + + const event = clientMessageListener.mock.calls[0][0] as MessageEvent + expect(event).toBeInstanceOf(MessageEvent) + expect(event.type).toBe('message') + expect(event.data).toBe('hi from server') + expect(event.origin).toBe(getWsUrl(wsServer)) + }) +}) + +it('prevents the default server-to-client message forwarding', async () => { + wsServer.once('connection', (ws) => { + ws.send('hi from server') + }) + + const serverMessageListener = vi.fn() + interceptor.once('connection', ({ server }) => { + server.connect() + server.addEventListener('message', (event) => { + event.preventDefault() + serverMessageListener() + }) + }) + + const clientMessageListener = vi.fn() + const ws = new WebSocket(getWsUrl(wsServer)) + ws.onmessage = (event) => clientMessageListener(event) + + await vi.waitFor(() => { + expect(serverMessageListener).toHaveBeenCalledTimes(1) + expect(clientMessageListener).not.toHaveBeenCalled() + }) +}) From 9adf0772ea53818e1b17a6c7fd24608aaa2b4090 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Thu, 15 Feb 2024 14:05:21 +0100 Subject: [PATCH 5/6] test: unit tests for custom events --- .../WebSocket/utils/event.test.ts | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/interceptors/WebSocket/utils/event.test.ts diff --git a/src/interceptors/WebSocket/utils/event.test.ts b/src/interceptors/WebSocket/utils/event.test.ts new file mode 100644 index 00000000..dd5b2ba7 --- /dev/null +++ b/src/interceptors/WebSocket/utils/event.test.ts @@ -0,0 +1,79 @@ +/** + * @vitest-environment node + */ +import { describe, it, expect } from 'vitest' +import { CancelableMessageEvent, CloseEvent } from './events' + +describe(CancelableMessageEvent, () => { + it('initiates with the right defaults', () => { + const event = new CancelableMessageEvent('message', { + data: 'hello', + }) + + expect(event).toBeInstanceOf(MessageEvent) + expect(event.type).toBe('message') + expect(event.data).toBe('hello') + expect(event.cancelable).toBe(false) + expect(event.defaultPrevented).toBe(false) + }) + + it('initiates a canceaable event', () => { + const event = new CancelableMessageEvent('message', { + data: 'hello', + cancelable: true, + }) + + expect(event).toBeInstanceOf(MessageEvent) + expect(event.type).toBe('message') + expect(event.data).toBe('hello') + expect(event.cancelable).toBe(true) + expect(event.defaultPrevented).toBe(false) + }) + + it('cancels a cancelable event when calling "preventDefault()"', () => { + const event = new CancelableMessageEvent('message', { + data: 'hello', + cancelable: true, + }) + + expect(event.defaultPrevented).toBe(false) + event.preventDefault() + expect(event.defaultPrevented).toBe(true) + }) + + it('does nothing when calling "preventDefault()" on a non-cancelable event', () => { + const event = new CancelableMessageEvent('message', { + data: 'hello', + }) + + expect(event.defaultPrevented).toBe(false) + event.preventDefault() + expect(event.defaultPrevented).toBe(false) + }) +}) + +describe(CloseEvent, () => { + it('initiates with the right defaults', () => { + const event = new CloseEvent('close') + + expect(event).toBeInstanceOf(Event) + expect(event.type).toBe('close') + expect(event.code).toBe(0) + expect(event.reason).toBe('') + expect(event.wasClean).toBe(false) + }) + + it('initiates with custom values', () => { + const event = new CloseEvent('close', { + code: 1003, + reason: 'close reason', + wasClean: true, + }) + + expect(event).toBeInstanceOf(Event) + expect(event.type).toBe('close') + expect(event.code).toBe(1003) + expect(event.reason).toBe('close reason') + expect(event.wasClean).toBe(true) + }) +}) From 7ab68a14a86452698e0c347d6f988b5654135cb6 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Thu, 15 Feb 2024 14:50:30 +0100 Subject: [PATCH 6/6] chore: fix vitest .toContain behavior difference --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- .../XMLHttpRequestController.ts | 2 +- .../XMLHttpRequest/XMLHttpRequestProxy.ts | 6 +++++- test/envs/react-native-like.ts | 1 + .../intercept/XMLHttpRequest.test.ts | 20 +++++++++---------- .../regressions/xhr-axios-xhr-adapter.test.ts | 10 +++++++++- .../fetch/intercept/fetch.request.test.ts | 2 +- test/modules/fetch/intercept/fetch.test.ts | 20 +++++++++---------- test/modules/http/intercept/http.get.test.ts | 2 +- test/modules/http/intercept/https.get.test.ts | 2 +- .../regressions/http-socket-timeout.test.ts | 8 ++++++++ 12 files changed, 52 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index f77c7557..50fc5576 100644 --- a/package.json +++ b/package.json @@ -149,7 +149,7 @@ "ts-jest": "^27.1.1", "tsup": "^6.5.0", "typescript": "^4.9.4", - "undici": "^6.5.0", + "undici": "^6.6.2", "vitest": "^1.2.2", "vitest-environment-miniflare": "^2.14.1", "wait-for-expect": "^3.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 04db2d9a..e9f37355 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,7 +48,7 @@ specifiers: ts-jest: ^27.1.1 tsup: ^6.5.0 typescript: ^4.9.4 - undici: ^6.5.0 + undici: ^6.6.2 vitest: ^1.2.2 vitest-environment-miniflare: ^2.14.1 wait-for-expect: ^3.0.2 @@ -103,7 +103,7 @@ devDependencies: ts-jest: 27.1.5_n4jzo3ixy42kfaqevs43wjx5ui tsup: 6.7.0_typescript@4.9.5 typescript: 4.9.5 - undici: 6.5.0 + undici: 6.6.2 vitest: 1.2.2_tzd3dabz5yko6x5zyblyxnclxa vitest-environment-miniflare: 2.14.1_vitest@1.2.2 wait-for-expect: 3.0.2 @@ -7086,8 +7086,8 @@ packages: busboy: 1.6.0 dev: true - /undici/6.5.0: - resolution: {integrity: sha512-/MUmPb2ptTvp1j7lPvdMSofMdqPxcOhAaKZi4k55sqm6XMeKI3n1dZJ5cnD4gLjpt2l7CIlthR1IXM59xKhpxw==} + /undici/6.6.2: + resolution: {integrity: sha512-vSqvUE5skSxQJ5sztTZ/CdeJb1Wq0Hf44hlYMciqHghvz+K88U0l7D6u1VsndoFgskDcnU+nG3gYmMzJVzd9Qg==} engines: {node: '>=18.0'} dependencies: '@fastify/busboy': 2.1.0 diff --git a/src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts b/src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts index 84baa4bf..9ebd204f 100644 --- a/src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts +++ b/src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts @@ -559,7 +559,7 @@ export class XMLHttpRequestController { credentials: this.request.withCredentials ? 'include' : 'same-origin', body: ['GET', 'HEAD'].includes(this.method) ? null - : (this.requestBody as any), + : (this.requestBody as BodyInit), }) const proxyHeaders = createProxy(fetchRequest.headers, { diff --git a/src/interceptors/XMLHttpRequest/XMLHttpRequestProxy.ts b/src/interceptors/XMLHttpRequest/XMLHttpRequestProxy.ts index 308dec5e..e152e8d3 100644 --- a/src/interceptors/XMLHttpRequest/XMLHttpRequestProxy.ts +++ b/src/interceptors/XMLHttpRequest/XMLHttpRequestProxy.ts @@ -23,7 +23,11 @@ export function createXMLHttpRequestProxy({ construct(target, args, newTarget) { logger.info('constructed new XMLHttpRequest') - const originalRequest = Reflect.construct(target, args, newTarget) + const originalRequest = Reflect.construct( + target, + args, + newTarget + ) as XMLHttpRequest /** * @note Forward prototype descriptors onto the proxied object. diff --git a/test/envs/react-native-like.ts b/test/envs/react-native-like.ts index f40f6824..66df9267 100644 --- a/test/envs/react-native-like.ts +++ b/test/envs/react-native-like.ts @@ -6,6 +6,7 @@ import { builtinEnvironments } from 'vitest/environments' export default { name: 'react-native-like', + transformMode: 'ssr', async setup(global, options) { const { teardown } = await builtinEnvironments.jsdom.setup(global, options) diff --git a/test/modules/XMLHttpRequest/intercept/XMLHttpRequest.test.ts b/test/modules/XMLHttpRequest/intercept/XMLHttpRequest.test.ts index 97c9ba4e..68d964db 100644 --- a/test/modules/XMLHttpRequest/intercept/XMLHttpRequest.test.ts +++ b/test/modules/XMLHttpRequest/intercept/XMLHttpRequest.test.ts @@ -72,7 +72,7 @@ it('intercepts an HTTP HEAD request', async () => { expect(request.method).toBe('HEAD') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -96,7 +96,7 @@ it('intercepts an HTTP GET request', async () => { expect(request.method).toBe('GET') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -120,7 +120,7 @@ it('intercepts an HTTP POST request', async () => { expect(request.method).toBe('POST') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -144,7 +144,7 @@ it('intercepts an HTTP PUT request', async () => { expect(request.method).toBe('PUT') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -168,7 +168,7 @@ it('intercepts an HTTP DELETE request', async () => { expect(request.method).toBe('DELETE') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -192,7 +192,7 @@ it('intercepts an HTTPS HEAD request', async () => { expect(request.method).toBe('HEAD') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -216,7 +216,7 @@ it('intercepts an HTTPS GET request', async () => { expect(request.method).toBe('GET') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -240,7 +240,7 @@ it('intercepts an HTTPS POST request', async () => { expect(request.method).toBe('POST') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -264,7 +264,7 @@ it('intercepts an HTTPS PUT request', async () => { expect(request.method).toBe('PUT') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -288,7 +288,7 @@ it('intercepts an HTTPS DELETE request', async () => { expect(request.method).toBe('DELETE') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') diff --git a/test/modules/XMLHttpRequest/regressions/xhr-axios-xhr-adapter.test.ts b/test/modules/XMLHttpRequest/regressions/xhr-axios-xhr-adapter.test.ts index 618884ff..019561d9 100644 --- a/test/modules/XMLHttpRequest/regressions/xhr-axios-xhr-adapter.test.ts +++ b/test/modules/XMLHttpRequest/regressions/xhr-axios-xhr-adapter.test.ts @@ -5,6 +5,12 @@ */ import { beforeAll, afterAll, it, expect } from 'vitest' import axios from 'axios' +/** + * @note Use `Response` from Undici because "happy-dom" + * does not implement ReadableStream at all. They use + * Node's Readable instead, which is completely incompatible. + */ +import { Response as UndiciResponse } from 'undici' import { XMLHttpRequestInterceptor } from '../../../../src/interceptors/XMLHttpRequest' const request = axios.create({ @@ -24,7 +30,9 @@ afterAll(() => { it('performs a request with the "xhr" axios adapter', async () => { interceptor.once('request', ({ request }) => { - request.respondWith(new Response('Hello world')) + request.respondWith( + new UndiciResponse('Hello world') as unknown as Response + ) }) const res = await request('/resource') diff --git a/test/modules/fetch/intercept/fetch.request.test.ts b/test/modules/fetch/intercept/fetch.request.test.ts index 6cb7681b..cdb9535c 100644 --- a/test/modules/fetch/intercept/fetch.request.test.ts +++ b/test/modules/fetch/intercept/fetch.request.test.ts @@ -52,7 +52,7 @@ it('intercepts fetch requests constructed via a "Request" instance', async () => expect(capturedRequest.method).toBe('POST') expect(capturedRequest.url).toBe(httpServer.http.url('/user')) - expect(Object.fromEntries(capturedRequest.headers.entries())).toContain({ + expect(Object.fromEntries(capturedRequest.headers.entries())).toMatchObject({ 'content-type': 'text/plain', 'user-agent': 'interceptors', }) diff --git a/test/modules/fetch/intercept/fetch.test.ts b/test/modules/fetch/intercept/fetch.test.ts index 358bf43e..e9bc952c 100644 --- a/test/modules/fetch/intercept/fetch.test.ts +++ b/test/modules/fetch/intercept/fetch.test.ts @@ -97,7 +97,7 @@ it('intercepts an HTTP POST request', async () => { expect(request.method).toBe('POST') expect(request.url).toBe(httpServer.http.url('/user?id=123')) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ accept: '*/*', 'x-custom-header': 'yes', }) @@ -123,7 +123,7 @@ it('intercepts an HTTP PUT request', async () => { expect(request.method).toBe('PUT') expect(request.url).toBe(httpServer.http.url('/user?id=123')) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -147,7 +147,7 @@ it('intercepts an HTTP DELETE request', async () => { expect(request.method).toBe('DELETE') expect(request.url).toBe(httpServer.http.url('/user?id=123')) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -172,7 +172,7 @@ it('intercepts an HTTP PATCH request', async () => { expect(request.method).toBe('PATCH') expect(request.url).toBe(httpServer.http.url('/user?id=123')) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -197,7 +197,7 @@ it('intercepts an HTTPS HEAD request', async () => { expect(request.method).toBe('HEAD') expect(request.url).toBe(httpServer.https.url('/user?id=123')) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -221,7 +221,7 @@ it('intercepts an HTTPS GET request', async () => { expect(request.method).toBe('GET') expect(request.url).toBe(httpServer.https.url('/user?id=123')) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -247,7 +247,7 @@ it('intercepts an HTTPS POST request', async () => { expect(request.method).toBe('POST') expect(request.url).toBe(httpServer.https.url('/user?id=123')) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -273,7 +273,7 @@ it('intercepts an HTTPS PUT request', async () => { expect(request.method).toBe('PUT') expect(request.url).toBe(httpServer.https.url('/user?id=123')) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -298,7 +298,7 @@ it('intercepts an HTTPS DELETE request', async () => { expect(request.method).toBe('DELETE') expect(request.url).toBe(httpServer.https.url('/user?id=123')) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') @@ -323,7 +323,7 @@ it('intercepts an HTTPS PATCH request', async () => { expect(request.method).toBe('PATCH') expect(request.url).toBe(httpServer.https.url('/user?id=123')) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') diff --git a/test/modules/http/intercept/http.get.test.ts b/test/modules/http/intercept/http.get.test.ts index 7013c502..624e1f74 100644 --- a/test/modules/http/intercept/http.get.test.ts +++ b/test/modules/http/intercept/http.get.test.ts @@ -45,7 +45,7 @@ it('intercepts an http.get request', async () => { expect(request.method).toBe('GET') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') diff --git a/test/modules/http/intercept/https.get.test.ts b/test/modules/http/intercept/https.get.test.ts index 5b4fde98..207ba382 100644 --- a/test/modules/http/intercept/https.get.test.ts +++ b/test/modules/http/intercept/https.get.test.ts @@ -45,7 +45,7 @@ it('intercepts a GET request', async () => { expect(request.method).toBe('GET') expect(request.url).toBe(url) - expect(Object.fromEntries(request.headers.entries())).toContain({ + expect(Object.fromEntries(request.headers.entries())).toMatchObject({ 'x-custom-header': 'yes', }) expect(request.credentials).toBe('same-origin') diff --git a/test/modules/http/regressions/http-socket-timeout.test.ts b/test/modules/http/regressions/http-socket-timeout.test.ts index 1950d6ed..88a86e83 100644 --- a/test/modules/http/regressions/http-socket-timeout.test.ts +++ b/test/modules/http/regressions/http-socket-timeout.test.ts @@ -12,6 +12,14 @@ beforeAll(() => { // Jest writes its output into "stderr". child.stderr?.on('data', (buffer: Buffer) => { + /** + * @note @fixme Skip Vite's CJS build deprecation message. + * Remove this once the Interceptors are ESM-only. + */ + if (buffer.toString('utf8').includes('Vite')) { + return + } + stderr = Buffer.concat([stderr, buffer]) }) })