diff --git a/packages/compat/src/__tests__/transaction-test.ts b/packages/compat/src/__tests__/transaction-test.ts index 1920ea8f2e0..04717525ca9 100644 --- a/packages/compat/src/__tests__/transaction-test.ts +++ b/packages/compat/src/__tests__/transaction-test.ts @@ -1,3 +1,5 @@ +import { Buffer } from 'node:buffer'; + import { Address } from '@solana/addresses'; import { AccountRole, IInstruction } from '@solana/instructions'; import { SignatureBytes } from '@solana/keys'; diff --git a/packages/library-legacy-sham/src/__tests__/public-key-test.ts b/packages/library-legacy-sham/src/__tests__/public-key-test.ts index a0c18f3505a..e4d234cd7fc 100644 --- a/packages/library-legacy-sham/src/__tests__/public-key-test.ts +++ b/packages/library-legacy-sham/src/__tests__/public-key-test.ts @@ -44,8 +44,7 @@ describe('PublicKeySham', () => { expect(publicKey.encode()).toEqual(Buffer.from(VALID_ADDRESS_BYTES)); }); } else { - // FIXME(https://github.com/solana-labs/solana-web3.js/issues/1867) - it.failing('fatals', () => { + it('fatals', () => { expect(() => { publicKey.encode(); }).toThrow(); @@ -73,8 +72,7 @@ describe('PublicKeySham', () => { expect(publicKey.toBuffer()).toEqual(Buffer.from(VALID_ADDRESS_BYTES)); }); } else { - // FIXME(https://github.com/solana-labs/solana-web3.js/issues/1867) - it.failing('fatals', () => { + it('fatals', () => { expect(() => { publicKey.toBuffer(); }).toThrow(); diff --git a/packages/rpc-api/package.json b/packages/rpc-api/package.json index 78d397111ce..e69e6e844dc 100644 --- a/packages/rpc-api/package.json +++ b/packages/rpc-api/package.json @@ -82,6 +82,7 @@ "@solana/tsconfig": "workspace:*", "@swc/jest": "^0.2.29", "@types/jest": "^29.5.11", + "@types/node": "^20.11.20", "@typescript-eslint/eslint-plugin": "^6.13.2", "@typescript-eslint/parser": "^6.3.0", "agadoo": "^3.0.0", @@ -90,7 +91,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "prettier": "^3.1", diff --git a/packages/rpc-api/src/__tests__/get-account-info-test.ts b/packages/rpc-api/src/__tests__/get-account-info-test.ts index 42b4014e9ad..4ca65da363b 100644 --- a/packages/rpc-api/src/__tests__/get-account-info-test.ts +++ b/packages/rpc-api/src/__tests__/get-account-info-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetAccountInfoApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -14,8 +13,6 @@ const CONTEXT_MATCHER = expect.objectContaining({ describe('getAccountInfo', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-balance-test.ts b/packages/rpc-api/src/__tests__/get-balance-test.ts index 363833311b9..05e36e45364 100644 --- a/packages/rpc-api/src/__tests__/get-balance-test.ts +++ b/packages/rpc-api/src/__tests__/get-balance-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetBalanceApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -10,8 +9,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getBalance', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-block-height.ts b/packages/rpc-api/src/__tests__/get-block-height.ts index 189c8715199..017aae99786 100644 --- a/packages/rpc-api/src/__tests__/get-block-height.ts +++ b/packages/rpc-api/src/__tests__/get-block-height.ts @@ -1,7 +1,6 @@ import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetBlockHeightApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -9,8 +8,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getBlockHeight', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); (['confirmed', 'finalized', 'processed'] as Commitment[]).forEach(commitment => { diff --git a/packages/rpc-api/src/__tests__/get-block-production-test.ts b/packages/rpc-api/src/__tests__/get-block-production-test.ts index f8046a5f372..f679c8314bd 100644 --- a/packages/rpc-api/src/__tests__/get-block-production-test.ts +++ b/packages/rpc-api/src/__tests__/get-block-production-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetBlockProductionApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -14,8 +13,6 @@ const CONTEXT_MATCHER = expect.objectContaining({ describe('getBlockProduction', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-block-time-test.ts b/packages/rpc-api/src/__tests__/get-block-time-test.ts index a53a1ab02dd..2758a911be0 100644 --- a/packages/rpc-api/src/__tests__/get-block-time-test.ts +++ b/packages/rpc-api/src/__tests__/get-block-time-test.ts @@ -1,7 +1,6 @@ import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetBlockTimeApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -9,8 +8,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getBlockTime', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-cluster-nodes-test.ts b/packages/rpc-api/src/__tests__/get-cluster-nodes-test.ts index 0681ee16570..db106fca274 100644 --- a/packages/rpc-api/src/__tests__/get-cluster-nodes-test.ts +++ b/packages/rpc-api/src/__tests__/get-cluster-nodes-test.ts @@ -1,7 +1,6 @@ import { open } from 'node:fs/promises'; import type { Rpc } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import path from 'path'; import { GetClusterNodesApi } from '../index'; @@ -64,8 +63,6 @@ async function getNodeInfoFromLogFile() { describe('getClusterNodes', () => { let mockRpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); mockRpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-epoch-info-test.ts b/packages/rpc-api/src/__tests__/get-epoch-info-test.ts index 779eaa708db..1bb6391ca58 100644 --- a/packages/rpc-api/src/__tests__/get-epoch-info-test.ts +++ b/packages/rpc-api/src/__tests__/get-epoch-info-test.ts @@ -1,7 +1,6 @@ import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetEpochInfoApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -9,8 +8,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getEpochInfo', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-epoch-schedule-test.ts b/packages/rpc-api/src/__tests__/get-epoch-schedule-test.ts index efb86138b4f..7cedf0f074b 100644 --- a/packages/rpc-api/src/__tests__/get-epoch-schedule-test.ts +++ b/packages/rpc-api/src/__tests__/get-epoch-schedule-test.ts @@ -1,5 +1,4 @@ import type { Rpc } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetEpochScheduleApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -7,8 +6,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getEpochSchedule', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-fee-for-message-test.ts b/packages/rpc-api/src/__tests__/get-fee-for-message-test.ts index 70df1d97b39..7a16191be8b 100644 --- a/packages/rpc-api/src/__tests__/get-fee-for-message-test.ts +++ b/packages/rpc-api/src/__tests__/get-fee-for-message-test.ts @@ -4,7 +4,6 @@ import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Blockhash, Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; import type { SerializedMessageBytesBase64 } from '@solana/transactions'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetFeeForMessageApi, GetLatestBlockhashApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -59,8 +58,6 @@ function getMockTransactionMessage(blockhash: Blockhash) { describe('getFeeForMessage', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-first-available-block-test.ts b/packages/rpc-api/src/__tests__/get-first-available-block-test.ts index 0f0d701fc1c..02d57c45043 100644 --- a/packages/rpc-api/src/__tests__/get-first-available-block-test.ts +++ b/packages/rpc-api/src/__tests__/get-first-available-block-test.ts @@ -1,5 +1,4 @@ import type { Rpc } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetFirstAvailableBlockApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -7,8 +6,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getFirstAvailableBlock', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); describe('when called with no parameters', () => { diff --git a/packages/rpc-api/src/__tests__/get-genesis-hash-test.ts b/packages/rpc-api/src/__tests__/get-genesis-hash-test.ts index d46ad2d99d1..fd63c881340 100644 --- a/packages/rpc-api/src/__tests__/get-genesis-hash-test.ts +++ b/packages/rpc-api/src/__tests__/get-genesis-hash-test.ts @@ -1,7 +1,6 @@ import { open } from 'node:fs/promises'; import type { Rpc } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import path from 'path'; import { GetGenesisHashApi } from '../index'; @@ -28,8 +27,6 @@ async function getGenesisHashFromLogFile() { describe('getGenesisHash', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-health-test.ts b/packages/rpc-api/src/__tests__/get-health-test.ts index 6e19d399708..665843beea8 100644 --- a/packages/rpc-api/src/__tests__/get-health-test.ts +++ b/packages/rpc-api/src/__tests__/get-health-test.ts @@ -1,19 +1,15 @@ -import type { Rpc } from '@solana/rpc-spec'; +import { createRpc, type Rpc } from '@solana/rpc-spec'; import type { SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; -import { GetHealthApi } from '../index'; +import { createSolanaRpcApi, GetHealthApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; describe('getHealth', () => { - let rpc: Rpc; - beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); - rpc = createLocalhostSolanaRpc(); - }); - describe('when the node is healthy', () => { + let rpc: Rpc; + beforeEach(() => { + rpc = createLocalhostSolanaRpc(); + }); it('returns "ok"', async () => { expect.assertions(1); const healthPromise = rpc.getHealth().send(); @@ -22,16 +18,22 @@ describe('getHealth', () => { }); describe('when the node is unhealthy', () => { + let rpc: Rpc; + const errorMessage = 'Node is unhealthy'; + const errorCode = -32005; + const errorObject = { + code: errorCode, + message: errorMessage, + name: 'RpcError', + }; + beforeEach(() => { + rpc = createRpc({ + api: createSolanaRpcApi(), + transport: jest.fn().mockRejectedValue(errorObject), + }); + }); it('returns an error message', async () => { expect.assertions(1); - const errorMessage = 'Node is unhealthy'; - const errorCode = -32005; - const errorObject = { - code: errorCode, - message: errorMessage, - name: 'RpcError', - }; - fetchMock.mockRejectOnce(errorObject); const healthPromise = rpc.getHealth().send(); await expect(healthPromise).rejects.toMatchObject({ code: errorCode satisfies (typeof SolanaRpcErrorCode)['JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY'], diff --git a/packages/rpc-api/src/__tests__/get-identity-test.ts b/packages/rpc-api/src/__tests__/get-identity-test.ts index 789dca59f47..39375411ec7 100644 --- a/packages/rpc-api/src/__tests__/get-identity-test.ts +++ b/packages/rpc-api/src/__tests__/get-identity-test.ts @@ -3,7 +3,6 @@ import { open } from 'node:fs/promises'; import type { Address } from '@solana/addresses'; import { getBase58Decoder } from '@solana/codecs-strings'; import type { Rpc } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import path from 'path'; import { GetIdentityApi } from '../index'; @@ -33,8 +32,6 @@ async function getValidatorAddress() { describe('getIdentity', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-inflation-governor-test.ts b/packages/rpc-api/src/__tests__/get-inflation-governor-test.ts index 1f1aedfd899..60007bf99ea 100644 --- a/packages/rpc-api/src/__tests__/get-inflation-governor-test.ts +++ b/packages/rpc-api/src/__tests__/get-inflation-governor-test.ts @@ -1,6 +1,5 @@ import type { Rpc } from '@solana/rpc-spec'; import type { Commitment } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetInflationGovernorApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -8,8 +7,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getInflationGovernor', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); // TODO: I honestly have no clue how to test this diff --git a/packages/rpc-api/src/__tests__/get-inflation-rate-test.ts b/packages/rpc-api/src/__tests__/get-inflation-rate-test.ts index 823ff2fc84d..4cf91d80746 100644 --- a/packages/rpc-api/src/__tests__/get-inflation-rate-test.ts +++ b/packages/rpc-api/src/__tests__/get-inflation-rate-test.ts @@ -1,5 +1,4 @@ import type { Rpc } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetInflationRateApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -7,8 +6,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getInflationRate', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); // TODO: I honestly have no clue how to test this diff --git a/packages/rpc-api/src/__tests__/get-inflation-reward-test.ts b/packages/rpc-api/src/__tests__/get-inflation-reward-test.ts index 273b5bb219a..da66a36f6a9 100644 --- a/packages/rpc-api/src/__tests__/get-inflation-reward-test.ts +++ b/packages/rpc-api/src/__tests__/get-inflation-reward-test.ts @@ -1,7 +1,6 @@ import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetInflationRewardApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -9,8 +8,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getInflationReward', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); [{ minContextSlot: 0n }, null].forEach(minContextConfig => { diff --git a/packages/rpc-api/src/__tests__/get-largest-accounts-test.ts b/packages/rpc-api/src/__tests__/get-largest-accounts-test.ts index 4a1a673ec4b..ae722f70929 100644 --- a/packages/rpc-api/src/__tests__/get-largest-accounts-test.ts +++ b/packages/rpc-api/src/__tests__/get-largest-accounts-test.ts @@ -4,7 +4,6 @@ import type { Address } from '@solana/addresses'; import { getBase58Decoder } from '@solana/codecs-strings'; import type { Rpc } from '@solana/rpc-spec'; import type { Commitment } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import path from 'path'; import { GetLargestAccountsApi } from '../index'; @@ -40,8 +39,6 @@ async function getNodeAddress(path: string) { describe('getLargestAccounts', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-latest-blockhash-test.ts b/packages/rpc-api/src/__tests__/get-latest-blockhash-test.ts index dc143dfd145..651194cbf80 100644 --- a/packages/rpc-api/src/__tests__/get-latest-blockhash-test.ts +++ b/packages/rpc-api/src/__tests__/get-latest-blockhash-test.ts @@ -1,7 +1,6 @@ import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetLatestBlockhashApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -13,8 +12,6 @@ const CONTEXT_MATCHER = expect.objectContaining({ describe('getLatestBlockhash', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-leader-schedule-test.ts b/packages/rpc-api/src/__tests__/get-leader-schedule-test.ts index 46b6cad2f37..7bcef9b4691 100644 --- a/packages/rpc-api/src/__tests__/get-leader-schedule-test.ts +++ b/packages/rpc-api/src/__tests__/get-leader-schedule-test.ts @@ -4,7 +4,6 @@ import type { Rpc } from '@solana/rpc-spec'; import type { Commitment } from '@solana/rpc-types'; import assert from 'assert'; import { open } from 'fs/promises'; -import fetchMock from 'jest-fetch-mock-fork'; import path from 'path'; import { GetLeaderScheduleApi } from '../index'; @@ -34,8 +33,6 @@ async function getValidatorAddress() { describe('getLeaderSchedule', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-max-retransmit-slot-test.ts b/packages/rpc-api/src/__tests__/get-max-retransmit-slot-test.ts index d0327053605..586b9604f51 100644 --- a/packages/rpc-api/src/__tests__/get-max-retransmit-slot-test.ts +++ b/packages/rpc-api/src/__tests__/get-max-retransmit-slot-test.ts @@ -1,5 +1,4 @@ import type { Rpc } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetMaxRetransmitSlotApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -7,8 +6,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getMaxRetransmitSlot', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); describe('when called with no parameters', () => { diff --git a/packages/rpc-api/src/__tests__/get-max-shred-insert-slot-test.ts b/packages/rpc-api/src/__tests__/get-max-shred-insert-slot-test.ts index 86b2de81f53..4ae3ad59244 100644 --- a/packages/rpc-api/src/__tests__/get-max-shred-insert-slot-test.ts +++ b/packages/rpc-api/src/__tests__/get-max-shred-insert-slot-test.ts @@ -1,5 +1,4 @@ import type { Rpc } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetMaxShredInsertSlotApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -7,8 +6,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getMaxShredInsertSlot', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); describe('when called with no parameters', () => { diff --git a/packages/rpc-api/src/__tests__/get-minimum-balance-for-rent-exemption-test.ts b/packages/rpc-api/src/__tests__/get-minimum-balance-for-rent-exemption-test.ts index c50f553d809..dfcd6ca8e27 100644 --- a/packages/rpc-api/src/__tests__/get-minimum-balance-for-rent-exemption-test.ts +++ b/packages/rpc-api/src/__tests__/get-minimum-balance-for-rent-exemption-test.ts @@ -1,6 +1,5 @@ import type { Rpc } from '@solana/rpc-spec'; import type { Commitment } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetMinimumBalanceForRentExemptionApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -8,8 +7,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getMinimumBalanceForRentExemption', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-multiple-accounts-test.ts b/packages/rpc-api/src/__tests__/get-multiple-accounts-test.ts index 86396ad0bd2..096eb915e69 100644 --- a/packages/rpc-api/src/__tests__/get-multiple-accounts-test.ts +++ b/packages/rpc-api/src/__tests__/get-multiple-accounts-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetMultipleAccountsApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -14,8 +13,6 @@ const CONTEXT_MATCHER = expect.objectContaining({ describe('getMultipleAccounts', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-program-accounts-test.ts b/packages/rpc-api/src/__tests__/get-program-accounts-test.ts index abe483a00cd..5e9c7d17fd2 100644 --- a/packages/rpc-api/src/__tests__/get-program-accounts-test.ts +++ b/packages/rpc-api/src/__tests__/get-program-accounts-test.ts @@ -5,7 +5,6 @@ import { getBase58Decoder } from '@solana/codecs-strings'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import path from 'path'; import { GetProgramAccountsApi } from '../index'; @@ -40,8 +39,6 @@ async function getNodeAddress(path: string) { describe('getProgramAccounts', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-recent-prioritization-fees-test.ts b/packages/rpc-api/src/__tests__/get-recent-prioritization-fees-test.ts index bc24ac6c3d1..b21ef029f4e 100644 --- a/packages/rpc-api/src/__tests__/get-recent-prioritization-fees-test.ts +++ b/packages/rpc-api/src/__tests__/get-recent-prioritization-fees-test.ts @@ -1,6 +1,5 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetRecentPrioritizationFeesApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -8,8 +7,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getRecentPrioritizationFees', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-signature-statuses-test.ts b/packages/rpc-api/src/__tests__/get-signature-statuses-test.ts index bdc61752d19..8b066a6338b 100644 --- a/packages/rpc-api/src/__tests__/get-signature-statuses-test.ts +++ b/packages/rpc-api/src/__tests__/get-signature-statuses-test.ts @@ -2,7 +2,6 @@ import type { Signature } from '@solana/keys'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetSignatureStatusesApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -14,8 +13,6 @@ const CONTEXT_MATCHER = expect.objectContaining({ describe('getSignatureStatuses', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-signatures-for-address-test.ts b/packages/rpc-api/src/__tests__/get-signatures-for-address-test.ts index bad6df2da49..6d3ad877a1c 100644 --- a/packages/rpc-api/src/__tests__/get-signatures-for-address-test.ts +++ b/packages/rpc-api/src/__tests__/get-signatures-for-address-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetSignaturesForAddressApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -10,8 +9,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getSignaturesForAddress', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-slot-leader-test.ts b/packages/rpc-api/src/__tests__/get-slot-leader-test.ts index 5338c2e9694..b4d4491988b 100644 --- a/packages/rpc-api/src/__tests__/get-slot-leader-test.ts +++ b/packages/rpc-api/src/__tests__/get-slot-leader-test.ts @@ -5,7 +5,6 @@ import { getBase58Decoder } from '@solana/codecs-strings'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import path from 'path'; import { GetSlotLeaderApi } from '../index'; @@ -35,8 +34,6 @@ async function getValidatorAddress() { describe('getSlotLeader', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-slot-leaders-test.ts b/packages/rpc-api/src/__tests__/get-slot-leaders-test.ts index 9dec336244f..73ea063a573 100644 --- a/packages/rpc-api/src/__tests__/get-slot-leaders-test.ts +++ b/packages/rpc-api/src/__tests__/get-slot-leaders-test.ts @@ -5,7 +5,6 @@ import { getBase58Decoder } from '@solana/codecs-strings'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import path from 'path'; import { GetSlotLeadersApi } from '../index'; @@ -35,8 +34,6 @@ async function getValidatorAddress() { describe('getSlotLeaders', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-slot-test.ts b/packages/rpc-api/src/__tests__/get-slot-test.ts index cbba31080da..7c9700f06ad 100644 --- a/packages/rpc-api/src/__tests__/get-slot-test.ts +++ b/packages/rpc-api/src/__tests__/get-slot-test.ts @@ -1,7 +1,6 @@ import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetSlotApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -9,8 +8,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getSlot', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); (['confirmed', 'finalized', 'processed'] as Commitment[]).forEach(commitment => { diff --git a/packages/rpc-api/src/__tests__/get-stake-activation-test.ts b/packages/rpc-api/src/__tests__/get-stake-activation-test.ts index df62b34693e..67087a626b6 100644 --- a/packages/rpc-api/src/__tests__/get-stake-activation-test.ts +++ b/packages/rpc-api/src/__tests__/get-stake-activation-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetStakeActivationApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -13,8 +12,6 @@ const stakeAccountAddress = 'CSg2vQGbnwWdSyJpwK4i3qGfB6FebaV3xQTx4U1MbixN' as Ad describe('getStakeActivation', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-stake-minimum-delegation-test.ts b/packages/rpc-api/src/__tests__/get-stake-minimum-delegation-test.ts index 68a3370fa85..f41b05de178 100644 --- a/packages/rpc-api/src/__tests__/get-stake-minimum-delegation-test.ts +++ b/packages/rpc-api/src/__tests__/get-stake-minimum-delegation-test.ts @@ -1,6 +1,5 @@ import type { Rpc } from '@solana/rpc-spec'; import type { Commitment } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetStakeMinimumDelegationApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -8,8 +7,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getStakeMinimumDelegation', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); (['confirmed', 'finalized', 'processed'] as Commitment[]).forEach(commitment => { diff --git a/packages/rpc-api/src/__tests__/get-supply-test.ts b/packages/rpc-api/src/__tests__/get-supply-test.ts index 6233c0c1458..d180b1ac60d 100644 --- a/packages/rpc-api/src/__tests__/get-supply-test.ts +++ b/packages/rpc-api/src/__tests__/get-supply-test.ts @@ -1,6 +1,5 @@ import type { Rpc } from '@solana/rpc-spec'; import type { Commitment } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetSupplyApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -12,8 +11,6 @@ const CONTEXT_MATCHER = expect.objectContaining({ describe('getSupply', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-token-account-balance-test.ts b/packages/rpc-api/src/__tests__/get-token-account-balance-test.ts index 26f1a626786..ab8bd00e5fa 100644 --- a/packages/rpc-api/src/__tests__/get-token-account-balance-test.ts +++ b/packages/rpc-api/src/__tests__/get-token-account-balance-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetTokenAccountBalanceApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -14,8 +13,6 @@ const CONTEXT_MATCHER = expect.objectContaining({ describe('getTokenAccountBalance', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-token-accounts-by-delegate-test.ts b/packages/rpc-api/src/__tests__/get-token-accounts-by-delegate-test.ts index cdb8d4e94a1..1ef0660583d 100644 --- a/packages/rpc-api/src/__tests__/get-token-accounts-by-delegate-test.ts +++ b/packages/rpc-api/src/__tests__/get-token-accounts-by-delegate-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetTokenAccountsByDelegateApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -14,8 +13,6 @@ const CONTEXT_MATCHER = expect.objectContaining({ describe('getTokenAccountsByDelegate', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-token-accounts-by-owner-test.ts b/packages/rpc-api/src/__tests__/get-token-accounts-by-owner-test.ts index 27e5fc364f5..5cdc53ba14f 100644 --- a/packages/rpc-api/src/__tests__/get-token-accounts-by-owner-test.ts +++ b/packages/rpc-api/src/__tests__/get-token-accounts-by-owner-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetTokenAccountsByOwnerApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -14,8 +13,6 @@ const CONTEXT_MATCHER = expect.objectContaining({ describe('getTokenAccountsByOwner', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-token-largest-accounts-test.ts b/packages/rpc-api/src/__tests__/get-token-largest-accounts-test.ts index 50431d98860..33cea83f90c 100644 --- a/packages/rpc-api/src/__tests__/get-token-largest-accounts-test.ts +++ b/packages/rpc-api/src/__tests__/get-token-largest-accounts-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetTokenLargestAccountsApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -14,8 +13,6 @@ const CONTEXT_MATCHER = expect.objectContaining({ describe('getTokenLargestAccounts', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-token-supply-test.ts b/packages/rpc-api/src/__tests__/get-token-supply-test.ts index 8e1eaadcb34..88528e19c09 100644 --- a/packages/rpc-api/src/__tests__/get-token-supply-test.ts +++ b/packages/rpc-api/src/__tests__/get-token-supply-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetTokenSupplyApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -14,8 +13,6 @@ const CONTEXT_MATCHER = expect.objectContaining({ describe('getTokenSupply', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-transaction-count-test.ts b/packages/rpc-api/src/__tests__/get-transaction-count-test.ts index e7838594809..90b968d5953 100644 --- a/packages/rpc-api/src/__tests__/get-transaction-count-test.ts +++ b/packages/rpc-api/src/__tests__/get-transaction-count-test.ts @@ -1,7 +1,6 @@ import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetTransactionCountApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -9,8 +8,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getTransactionCount', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); (['confirmed', 'finalized', 'processed'] as Commitment[]).forEach(commitment => { diff --git a/packages/rpc-api/src/__tests__/get-transaction-test.ts b/packages/rpc-api/src/__tests__/get-transaction-test.ts index 207d366932e..80440774213 100644 --- a/packages/rpc-api/src/__tests__/get-transaction-test.ts +++ b/packages/rpc-api/src/__tests__/get-transaction-test.ts @@ -1,12 +1,10 @@ // import { createHttpTransport, createJsonRpc, type Rpc } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; + // import { createSolanaRpcApi, GetTransactionApi } from '../index'; describe('getTransaction', () => { // let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); // rpc = createJsonRpc({ // api: createSolanaRpcApi(), // transport: createHttpTransport({ url: 'http://127.0.0.1:8899' }), diff --git a/packages/rpc-api/src/__tests__/get-version-test.ts b/packages/rpc-api/src/__tests__/get-version-test.ts index 94568bac3ce..bf1daad0e1a 100644 --- a/packages/rpc-api/src/__tests__/get-version-test.ts +++ b/packages/rpc-api/src/__tests__/get-version-test.ts @@ -1,7 +1,6 @@ import { open } from 'node:fs/promises'; import type { Rpc } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import path from 'path'; import { GetVersionApi } from '../index'; @@ -38,8 +37,6 @@ async function getVersionFromLogFile() { describe('getVersion', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/get-vote-accounts.ts b/packages/rpc-api/src/__tests__/get-vote-accounts.ts index 4a3079aa0fb..fdebfd7e9e1 100644 --- a/packages/rpc-api/src/__tests__/get-vote-accounts.ts +++ b/packages/rpc-api/src/__tests__/get-vote-accounts.ts @@ -1,7 +1,6 @@ import type { Address } from '@solana/addresses'; import type { Rpc } from '@solana/rpc-spec'; import type { Commitment } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetVoteAccountsApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -9,8 +8,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('getVoteAccounts', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-api/src/__tests__/is-blockhash-valid-test.ts b/packages/rpc-api/src/__tests__/is-blockhash-valid-test.ts index 44428a46b72..90e8510b091 100644 --- a/packages/rpc-api/src/__tests__/is-blockhash-valid-test.ts +++ b/packages/rpc-api/src/__tests__/is-blockhash-valid-test.ts @@ -1,6 +1,5 @@ import type { Rpc } from '@solana/rpc-spec'; import type { Blockhash, Commitment } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { IsBlockhashValidApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -8,8 +7,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('isBlockhashValid', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); (['confirmed', 'finalized', 'processed'] as Commitment[]).forEach(commitment => { diff --git a/packages/rpc-api/src/__tests__/minimum-ledger-slot-test.ts b/packages/rpc-api/src/__tests__/minimum-ledger-slot-test.ts index 9132e72c593..b7d59986aba 100644 --- a/packages/rpc-api/src/__tests__/minimum-ledger-slot-test.ts +++ b/packages/rpc-api/src/__tests__/minimum-ledger-slot-test.ts @@ -1,5 +1,4 @@ import type { Rpc } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import { MinimumLedgerSlotApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -7,8 +6,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('minimumLedgerSlot', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); describe('when called with no parameters', () => { diff --git a/packages/rpc-api/src/__tests__/request-airdrop-test.ts b/packages/rpc-api/src/__tests__/request-airdrop-test.ts index ec14de2ff4d..df62bc64b88 100644 --- a/packages/rpc-api/src/__tests__/request-airdrop-test.ts +++ b/packages/rpc-api/src/__tests__/request-airdrop-test.ts @@ -2,7 +2,6 @@ import type { Address } from '@solana/addresses'; import { getBase58Decoder } from '@solana/codecs-strings'; import type { Rpc } from '@solana/rpc-spec'; import type { Commitment, LamportsUnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { RequestAirdropApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -10,8 +9,6 @@ import { createLocalhostSolanaRpc } from './__setup__'; describe('requestAirdrop', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); (['confirmed', 'finalized', 'processed'] as Commitment[]).forEach(commitment => { diff --git a/packages/rpc-api/src/__tests__/send-transaction-test.ts b/packages/rpc-api/src/__tests__/send-transaction-test.ts index 0d0a3a5ea1e..6e40755704c 100644 --- a/packages/rpc-api/src/__tests__/send-transaction-test.ts +++ b/packages/rpc-api/src/__tests__/send-transaction-test.ts @@ -1,3 +1,5 @@ +import { Buffer } from 'node:buffer'; + import { fixEncoder } from '@solana/codecs-core'; import { getBase58Decoder, getBase58Encoder } from '@solana/codecs-strings'; import { createPrivateKeyFromBytes } from '@solana/keys'; @@ -5,7 +7,6 @@ import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; import type { Base64EncodedWireTransaction } from '@solana/transactions'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetLatestBlockhashApi, SendTransactionApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -72,8 +73,6 @@ async function getSecretKey() { describe('sendTransaction', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); (['confirmed', 'finalized', 'processed'] as Commitment[]).forEach(commitment => { diff --git a/packages/rpc-api/src/__tests__/simulate-transaction-test.ts b/packages/rpc-api/src/__tests__/simulate-transaction-test.ts index a9531a95ad2..b02b65158ec 100644 --- a/packages/rpc-api/src/__tests__/simulate-transaction-test.ts +++ b/packages/rpc-api/src/__tests__/simulate-transaction-test.ts @@ -1,3 +1,5 @@ +import { Buffer } from 'node:buffer'; + import type { Address } from '@solana/addresses'; import { fixEncoder } from '@solana/codecs-core'; import { getBase58Decoder, getBase58Encoder } from '@solana/codecs-strings'; @@ -6,7 +8,6 @@ import type { Rpc } from '@solana/rpc-spec'; import { RpcError } from '@solana/rpc-spec-types'; import type { Base58EncodedBytes, Commitment, SolanaRpcErrorCode } from '@solana/rpc-types'; import type { Base64EncodedWireTransaction } from '@solana/transactions'; -import fetchMock from 'jest-fetch-mock-fork'; import { GetLatestBlockhashApi, SimulateTransactionApi } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; @@ -125,8 +126,6 @@ async function getSecretKey() { describe('simulateTransaction', () => { let rpc: Rpc; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); }); diff --git a/packages/rpc-graphql/package.json b/packages/rpc-graphql/package.json index e3a5ddcf4b1..71d59a06311 100644 --- a/packages/rpc-graphql/package.json +++ b/packages/rpc-graphql/package.json @@ -89,7 +89,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "prettier": "^3.1", diff --git a/packages/rpc-graphql/src/__tests__/__setup__.ts b/packages/rpc-graphql/src/__tests__/__setup__.ts index cc3a02f32ee..00176fecebd 100644 --- a/packages/rpc-graphql/src/__tests__/__setup__.ts +++ b/packages/rpc-graphql/src/__tests__/__setup__.ts @@ -9,13 +9,6 @@ export function createLocalhostSolanaRpc(): Rpc { }); } -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export const mockRpcResponse = (result: any) => ({ - jsonrpc: '2.0', - result, - id: 1, -}); - export const mockTransactionBase58 = { blockTime: 1699617771, meta: { diff --git a/packages/rpc-graphql/src/__tests__/account-test.ts b/packages/rpc-graphql/src/__tests__/account-test.ts index 81bada4b815..8c4670d5147 100644 --- a/packages/rpc-graphql/src/__tests__/account-test.ts +++ b/packages/rpc-graphql/src/__tests__/account-test.ts @@ -6,17 +6,18 @@ import { GetTransactionApi, Rpc, } from '@solana/rpc'; -import fetchMock from 'jest-fetch-mock-fork'; import { createRpcGraphQL, RpcGraphQL } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; +type GraphQLCompliantRpc = Rpc< + GetAccountInfoApi & GetBlockApi & GetMultipleAccountsApi & GetProgramAccountsApi & GetTransactionApi +>; + describe('account', () => { - let rpc: Rpc; + let rpc: GraphQLCompliantRpc; let rpcGraphQL: RpcGraphQL; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); rpcGraphQL = createRpcGraphQL(rpc); }); diff --git a/packages/rpc-graphql/src/__tests__/block-tests.ts b/packages/rpc-graphql/src/__tests__/block-tests.ts index a74fddd95ce..8d1f56514d9 100644 --- a/packages/rpc-graphql/src/__tests__/block-tests.ts +++ b/packages/rpc-graphql/src/__tests__/block-tests.ts @@ -7,20 +7,17 @@ import { Rpc, } from '@solana/rpc'; import type { Slot } from '@solana/rpc-types'; -import fetchMock from 'jest-fetch-mock-fork'; import { createRpcGraphQL, RpcGraphQL } from '../index'; -import { - createLocalhostSolanaRpc, - mockBlockFull, - mockBlockFullBase58, - mockBlockFullBase64, - mockBlockSignatures, - mockRpcResponse, -} from './__setup__'; +import { mockBlockFull, mockBlockFullBase58, mockBlockFullBase64, mockBlockSignatures } from './__setup__'; + +type GraphQLCompliantRpc = Rpc< + GetAccountInfoApi & GetBlockApi & GetMultipleAccountsApi & GetProgramAccountsApi & GetTransactionApi +>; describe('block', () => { - let rpc: Rpc; + let mockRpcTransport: jest.Mock; + let rpc: GraphQLCompliantRpc; let rpcGraphQL: RpcGraphQL; // Random slot for testing. @@ -28,11 +25,21 @@ describe('block', () => { const slot = 511226n as Slot; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); - rpc = createLocalhostSolanaRpc(); + mockRpcTransport = jest.fn(); + rpc = new Proxy({} as GraphQLCompliantRpc, { + get(target, p) { + if (!target[p as keyof GraphQLCompliantRpc]) { + const pendingRpcRequest = { send: mockRpcTransport }; + target[p as keyof GraphQLCompliantRpc] = jest + .fn() + .mockReturnValue(pendingRpcRequest) as GraphQLCompliantRpc[keyof GraphQLCompliantRpc]; + } + return target[p as keyof GraphQLCompliantRpc]; + }, + }); rpcGraphQL = createRpcGraphQL(rpc); }); + // The `block` query takes a `BigInt` as a parameter. We need to test this // for various input types that might occur outside of a JavaScript // context, such as string or number. @@ -46,7 +53,7 @@ describe('block', () => { `; it('can accept a bigint parameter', async () => { expect.assertions(2); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const variables = { block: 511226n }; const result = await rpcGraphQL.query(source, variables); expect(result).not.toHaveProperty('errors'); @@ -60,7 +67,7 @@ describe('block', () => { }); it('can accept a number parameter', async () => { expect.assertions(2); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const variables = { block: 511226 }; const result = await rpcGraphQL.query(source, variables); expect(result).not.toHaveProperty('errors'); @@ -74,7 +81,7 @@ describe('block', () => { }); it('can accept a string parameter', async () => { expect.assertions(2); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const variables = { block: '511226' }; const result = await rpcGraphQL.query(source, variables); expect(result).not.toHaveProperty('errors'); @@ -90,7 +97,7 @@ describe('block', () => { describe('basic queries', () => { it("can query a block's block time", async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValue(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -109,7 +116,7 @@ describe('block', () => { }); it('can query multiple fields on a block', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValue(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -144,7 +151,7 @@ describe('block', () => { }); it("can query a block's transaction signatures", async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockSignatures))); // TODO: Mocks + mockRpcTransport.mockResolvedValueOnce(mockBlockSignatures); // TODO: Mocks const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -163,7 +170,7 @@ describe('block', () => { }); it("can query a block's transaction data as `base58`", async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFullBase58))); // TODO: Mocks + mockRpcTransport.mockResolvedValueOnce(mockBlockFullBase58); // TODO: Mocks const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -188,7 +195,7 @@ describe('block', () => { }); it("can query a block's transaction data as `base64`", async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFullBase64))); // TODO: Mocks + mockRpcTransport.mockResolvedValueOnce(mockBlockFullBase64); // TODO: Mocks const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -213,7 +220,7 @@ describe('block', () => { }); it("can query a block's parsed transaction message", async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -251,7 +258,7 @@ describe('block', () => { describe('instructions', () => { it('can query a block with a transaction containing a `GenericInstruction` instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -292,7 +299,7 @@ describe('block', () => { }); it('can query a block with a transaction containing a `ExtendLookupTable` instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -355,7 +362,7 @@ describe('block', () => { }); it('can query a block with a transaction containing a `CreateAccount` instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -414,7 +421,7 @@ describe('block', () => { }); it('can query a block with a transaction containing a `SplMemoInstruction` instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -453,7 +460,7 @@ describe('block', () => { }); it('can query a block with a transaction containing a `SplTokenInitializeMintInstruction` instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -516,7 +523,7 @@ describe('block', () => { describe('inner instructions', () => { it('can query a block with a transaction containing a `Allocate` inner instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -567,7 +574,7 @@ describe('block', () => { }); it('can query a block with a transaction containing a `Assign` inner instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -622,7 +629,7 @@ describe('block', () => { }); it('can query a block with a transaction containing a `Transfer` inner instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { @@ -679,7 +686,7 @@ describe('block', () => { }); it('can query a block with a transaction containing a `SplTokenTransfer` inner instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockBlockFull))); + mockRpcTransport.mockResolvedValueOnce(mockBlockFull); const source = /* GraphQL */ ` query testQuery($slot: Slot!) { block(slot: $slot) { diff --git a/packages/rpc-graphql/src/__tests__/program-accounts-test.ts b/packages/rpc-graphql/src/__tests__/program-accounts-test.ts index c38f44b0113..17865220082 100644 --- a/packages/rpc-graphql/src/__tests__/program-accounts-test.ts +++ b/packages/rpc-graphql/src/__tests__/program-accounts-test.ts @@ -6,17 +6,18 @@ import { GetTransactionApi, Rpc, } from '@solana/rpc'; -import fetchMock from 'jest-fetch-mock-fork'; import { createRpcGraphQL, RpcGraphQL } from '../index'; import { createLocalhostSolanaRpc } from './__setup__'; +type GraphQLCompliantRpc = Rpc< + GetAccountInfoApi & GetBlockApi & GetMultipleAccountsApi & GetProgramAccountsApi & GetTransactionApi +>; + describe('programAccounts', () => { - let rpc: Rpc; + let rpc: GraphQLCompliantRpc; let rpcGraphQL: RpcGraphQL; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpc(); rpcGraphQL = createRpcGraphQL(rpc); }); diff --git a/packages/rpc-graphql/src/__tests__/transaction-tests.ts b/packages/rpc-graphql/src/__tests__/transaction-tests.ts index cb32f093b29..fe0dc904468 100644 --- a/packages/rpc-graphql/src/__tests__/transaction-tests.ts +++ b/packages/rpc-graphql/src/__tests__/transaction-tests.ts @@ -7,12 +7,9 @@ import { GetTransactionApi, Rpc, } from '@solana/rpc'; -import fetchMock from 'jest-fetch-mock-fork'; import { createRpcGraphQL, RpcGraphQL } from '../index'; import { - createLocalhostSolanaRpc, - mockRpcResponse, mockTransactionAddressLookup, mockTransactionBase58, mockTransactionBase64, @@ -23,8 +20,13 @@ import { mockTransactionVote, } from './__setup__'; +type GraphQLCompliantRpc = Rpc< + GetAccountInfoApi & GetBlockApi & GetMultipleAccountsApi & GetProgramAccountsApi & GetTransactionApi +>; + describe('transaction', () => { - let rpc: Rpc; + let mockRpc: GraphQLCompliantRpc; + let mockRpcTransport: jest.Mock; let rpcGraphQL: RpcGraphQL; // Random signature for testing. @@ -33,16 +35,25 @@ describe('transaction', () => { '67rSZV97NzE4B4ZeFqULqWZcNEV2KwNfDLMzecJmBheZ4sWhudqGAzypoBCKfeLkKtDQBGnkwgdrrFM8ZMaS3pkk' as Signature; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); - rpc = createLocalhostSolanaRpc(); - rpcGraphQL = createRpcGraphQL(rpc); + mockRpcTransport = jest.fn(); + mockRpc = new Proxy({} as GraphQLCompliantRpc, { + get(target, p) { + if (!target[p as keyof GraphQLCompliantRpc]) { + const pendingRpcRequest = { send: mockRpcTransport }; + target[p as keyof GraphQLCompliantRpc] = jest + .fn() + .mockReturnValue(pendingRpcRequest) as GraphQLCompliantRpc[keyof GraphQLCompliantRpc]; + } + return target[p as keyof GraphQLCompliantRpc]; + }, + }); + rpcGraphQL = createRpcGraphQL(mockRpc); }); describe('basic queries', () => { it('can query a transaction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionVote))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionVote); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -63,7 +74,7 @@ describe('transaction', () => { }); it("can query a transaction's computeUnitsConsumed from it's meta", async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionVote))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionVote); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -86,7 +97,7 @@ describe('transaction', () => { }); it("can query several fields from a transaction's meta", async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionVote))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionVote); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -115,7 +126,7 @@ describe('transaction', () => { describe('transaction data queries', () => { it('can get a transaction as base58', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionBase58))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionBase58); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -134,7 +145,7 @@ describe('transaction', () => { }); it('can get a transaction as base64', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionBase64))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionBase64); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -153,8 +164,8 @@ describe('transaction', () => { }); it('can get a transaction as multiple encodings', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionBase58))); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionBase64))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionBase58); + mockRpcTransport.mockResolvedValueOnce(mockTransactionBase64); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -175,7 +186,7 @@ describe('transaction', () => { }); it('defaults to jsonParsed', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionVote))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionVote); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -215,7 +226,7 @@ describe('transaction', () => { describe('instructions', () => { it('can get a generic instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionGeneric))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionGeneric); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -250,7 +261,7 @@ describe('transaction', () => { }); it('can get a `ExtendLookupTable` instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionAddressLookup))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionAddressLookup); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -307,7 +318,7 @@ describe('transaction', () => { }); it('can get a `CreateAccount` instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionSystem))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionSystem); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -360,7 +371,7 @@ describe('transaction', () => { }); it('can get a `SplMemoInstruction` instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionMemo))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionMemo); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -393,7 +404,7 @@ describe('transaction', () => { }); it('can get a `SplTokenInitializeMintInstruction` instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionToken))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionToken); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -450,7 +461,7 @@ describe('transaction', () => { describe('inner instructions', () => { it('can get an `Allocate` inner instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionSystem))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionSystem); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -495,7 +506,7 @@ describe('transaction', () => { }); it('can get an `Assign` inner instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionSystem))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionSystem); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -544,7 +555,7 @@ describe('transaction', () => { }); it('can get a `Transfer` inner instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionSystem))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionSystem); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { @@ -595,7 +606,7 @@ describe('transaction', () => { }); it('can get a `SplTokenTransfer` inner instruction', async () => { expect.assertions(1); - fetchMock.mockOnce(JSON.stringify(mockRpcResponse(mockTransactionToken))); + mockRpcTransport.mockResolvedValueOnce(mockTransactionToken); const source = /* GraphQL */ ` query testQuery($signature: Signature!) { transaction(signature: $signature) { diff --git a/packages/rpc-spec-types/package.json b/packages/rpc-spec-types/package.json index 4f7a8b95846..31f8d76cdda 100644 --- a/packages/rpc-spec-types/package.json +++ b/packages/rpc-spec-types/package.json @@ -78,7 +78,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "prettier": "^3.1", diff --git a/packages/rpc-spec/package.json b/packages/rpc-spec/package.json index c5a6e67ec10..9ae62703246 100644 --- a/packages/rpc-spec/package.json +++ b/packages/rpc-spec/package.json @@ -81,7 +81,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "prettier": "^3.1", diff --git a/packages/rpc-subscriptions-api/package.json b/packages/rpc-subscriptions-api/package.json index e9a8e1f37c0..c0ca960fd96 100644 --- a/packages/rpc-subscriptions-api/package.json +++ b/packages/rpc-subscriptions-api/package.json @@ -87,7 +87,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "jest-websocket-mock": "^2.5.0", diff --git a/packages/rpc-subscriptions-api/src/__tests__/slot-notifications-test.ts b/packages/rpc-subscriptions-api/src/__tests__/slot-notifications-test.ts index 3c63cf95d68..2181d606c11 100644 --- a/packages/rpc-subscriptions-api/src/__tests__/slot-notifications-test.ts +++ b/packages/rpc-subscriptions-api/src/__tests__/slot-notifications-test.ts @@ -1,5 +1,4 @@ import { type RpcSubscriptions } from '@solana/rpc-subscriptions-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import type { SlotNotificationsApi } from '../slot-notifications'; import { createLocalhostSolanaRpcSubscriptions } from './__setup__'; @@ -7,8 +6,6 @@ import { createLocalhostSolanaRpcSubscriptions } from './__setup__'; describe('slotNotifications', () => { let rpc: RpcSubscriptions; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpcSubscriptions(); }); diff --git a/packages/rpc-subscriptions-api/src/__tests__/slots-updates-notifications-test.ts b/packages/rpc-subscriptions-api/src/__tests__/slots-updates-notifications-test.ts index ded1770bcf9..16a758bbf45 100644 --- a/packages/rpc-subscriptions-api/src/__tests__/slots-updates-notifications-test.ts +++ b/packages/rpc-subscriptions-api/src/__tests__/slots-updates-notifications-test.ts @@ -1,5 +1,4 @@ import { type RpcSubscriptions } from '@solana/rpc-subscriptions-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import type { SlotsUpdatesNotificationsApi } from '../slots-updates-notifications'; import { createLocalhostSolanaRpcSubscriptions } from './__setup__'; @@ -7,8 +6,6 @@ import { createLocalhostSolanaRpcSubscriptions } from './__setup__'; describe('slotsUpdatesNotifications', () => { let rpc: RpcSubscriptions; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpcSubscriptions(); }); diff --git a/packages/rpc-subscriptions-api/src/__tests__/vote-notifications-test.ts b/packages/rpc-subscriptions-api/src/__tests__/vote-notifications-test.ts index 447b81bece2..8d9ef55d9e2 100644 --- a/packages/rpc-subscriptions-api/src/__tests__/vote-notifications-test.ts +++ b/packages/rpc-subscriptions-api/src/__tests__/vote-notifications-test.ts @@ -1,5 +1,4 @@ import { type RpcSubscriptions } from '@solana/rpc-subscriptions-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import type { VoteNotificationsApi } from '../vote-notifications'; import { createLocalhostSolanaRpcSubscriptions } from './__setup__'; @@ -7,8 +6,6 @@ import { createLocalhostSolanaRpcSubscriptions } from './__setup__'; describe('voteNotifications', () => { let rpc: RpcSubscriptions; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); rpc = createLocalhostSolanaRpcSubscriptions(); }); diff --git a/packages/rpc-subscriptions-spec/package.json b/packages/rpc-subscriptions-spec/package.json index 41d8621e52a..e78b9e26931 100644 --- a/packages/rpc-subscriptions-spec/package.json +++ b/packages/rpc-subscriptions-spec/package.json @@ -81,7 +81,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "prettier": "^3.1", diff --git a/packages/rpc-subscriptions-transport-websocket/package.json b/packages/rpc-subscriptions-transport-websocket/package.json index 299a01bba4c..327a409c773 100644 --- a/packages/rpc-subscriptions-transport-websocket/package.json +++ b/packages/rpc-subscriptions-transport-websocket/package.json @@ -82,7 +82,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "jest-websocket-mock": "^2.5.0", diff --git a/packages/rpc-subscriptions/package.json b/packages/rpc-subscriptions/package.json index 10f39b2140b..fb6c5aad6ae 100644 --- a/packages/rpc-subscriptions/package.json +++ b/packages/rpc-subscriptions/package.json @@ -88,7 +88,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "jest-websocket-mock": "^2.5.0", diff --git a/packages/rpc-transformers/package.json b/packages/rpc-transformers/package.json index df522f7ad7c..d46ec8c9775 100644 --- a/packages/rpc-transformers/package.json +++ b/packages/rpc-transformers/package.json @@ -83,7 +83,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "prettier": "^3.1", diff --git a/packages/rpc-transport-http/package.json b/packages/rpc-transport-http/package.json index 2d64c411eba..0acddcc2a6c 100644 --- a/packages/rpc-transport-http/package.json +++ b/packages/rpc-transport-http/package.json @@ -82,7 +82,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "prettier": "^3.1", diff --git a/packages/rpc-transport-http/src/__tests__/http-transport-abort-test.ts b/packages/rpc-transport-http/src/__tests__/http-transport-abort-test.ts index facadfa096f..08659ca4bb3 100644 --- a/packages/rpc-transport-http/src/__tests__/http-transport-abort-test.ts +++ b/packages/rpc-transport-http/src/__tests__/http-transport-abort-test.ts @@ -1,52 +1,84 @@ import { RpcTransport } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; import { createHttpTransport } from '../http-transport'; describe('createHttpTransport and `AbortSignal`', () => { let makeHttpRequest: RpcTransport; beforeEach(() => { - fetchMock.once(JSON.stringify({ ok: true })); - makeHttpRequest = createHttpTransport({ url: 'fake://url' }); + makeHttpRequest = createHttpTransport({ url: 'http://localhost' }); }); describe('when invoked with an already-aborted `AbortSignal`', () => { - let abortSignal: AbortSignal; - beforeEach(() => { - const abortController = new AbortController(); - abortController.abort('I got bored waiting'); - abortSignal = abortController.signal; - }); - it('rejects with an `AbortError`', async () => { - expect.assertions(1); - await expect(() => makeHttpRequest({ payload: 123, signal: abortSignal })).rejects.toThrow(); + it('rejects with an `AbortError` when no reason is specified', async () => { + expect.assertions(3); + const sendPromise = makeHttpRequest({ payload: 123, signal: AbortSignal.abort() }); + await expect(sendPromise).rejects.toThrow(); + await expect(sendPromise).rejects.toBeInstanceOf(DOMException); + await expect(sendPromise).rejects.toHaveProperty('name', 'AbortError'); }); + // FIXME: https://github.com/JakeChampion/fetch/pull/1436 + // `whatwg-fetch` handles `reason` incorrectly; it unconditionally throws `AbortError` + if (!__BROWSER__) { + it("rejects with the `AbortSignal's` reason", async () => { + expect.assertions(1); + const sendPromise = makeHttpRequest({ + payload: 123, + signal: AbortSignal.abort('Already aborted'), + }); + await expect(sendPromise).rejects.toBe('Already aborted'); + }); + } }); describe('when it receives an abort signal mid-request', () => { let abortController: AbortController; let abortSignal: AbortSignal; beforeEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); abortController = new AbortController(); abortSignal = abortController.signal; }); - it('rejects with an `AbortError`', async () => { + it('rejects with an `AbortError` when no reason is specified', async () => { expect.assertions(1); const sendPromise = makeHttpRequest({ payload: 123, signal: abortSignal }); - abortController.abort('I got bored waiting'); + abortController.abort(); await expect(sendPromise).rejects.toThrow(); }); + // FIXME: https://github.com/JakeChampion/fetch/pull/1436 + // `whatwg-fetch` handles `reason` incorrectly; it unconditionally throws `AbortError` + if (!__BROWSER__) { + it("rejects with with the `AbortSignal's` reason", async () => { + expect.assertions(1); + const sendPromise = makeHttpRequest({ payload: 123, signal: abortSignal }); + abortController.abort('I got bored waiting'); + await expect(sendPromise).rejects.toBe('I got bored waiting'); + }); + } }); describe('when it receives an abort signal after responding', () => { let abortController: AbortController; let abortSignal: AbortSignal; - beforeEach(() => { - fetchMock.once(JSON.stringify({ ok: true })); + let fetchImpl: typeof import('@solana/fetch-impl').default; + beforeEach(async () => { + jest.mock('@solana/fetch-impl'); + await jest.isolateModulesAsync(async () => { + const [fetchImplModule, { createHttpTransport }] = await Promise.all([ + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + import('@solana/fetch-impl'), + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + import('../http-transport'), + ]); + fetchImpl = fetchImplModule.default; + makeHttpRequest = createHttpTransport({ url: 'http://localhost' }); + }); abortController = new AbortController(); abortSignal = abortController.signal; }); it('resolves with the response', async () => { expect.assertions(1); + jest.mocked(fetchImpl).mockResolvedValueOnce({ + json: async () => ({ ok: true }), + ok: true, + } as unknown as Response); const sendPromise = makeHttpRequest({ payload: 123, signal: abortSignal }); abortController.abort('I got bored waiting'); await expect(sendPromise).resolves.toMatchObject({ diff --git a/packages/rpc-transport-http/src/__tests__/http-transport-headers-test.ts b/packages/rpc-transport-http/src/__tests__/http-transport-headers-test.ts index 7b88da9b817..7c61f4fc727 100644 --- a/packages/rpc-transport-http/src/__tests__/http-transport-headers-test.ts +++ b/packages/rpc-transport-http/src/__tests__/http-transport-headers-test.ts @@ -1,8 +1,11 @@ import { RpcTransport } from '@solana/rpc-spec'; -import { createHttpTransport } from '../http-transport'; import { assertIsAllowedHttpRequestHeaders } from '../http-transport-headers'; +const FOREVER_PROMISE = new Promise(() => { + /* never resolve */ +}); + describe('assertIsAllowedHttpRequestHeader', () => { [ 'Accept-Charset', @@ -52,8 +55,22 @@ describe('assertIsAllowedHttpRequestHeader', () => { }); describe('createHttpRequest with custom headers', () => { - beforeEach(() => { - fetchMock.once(JSON.stringify({ ok: true })); + let createHttpTransport: typeof import('../http-transport').createHttpTransport; + let fetchImpl: jest.Mock; + beforeEach(async () => { + await jest.isolateModulesAsync(async () => { + jest.mock('@solana/fetch-impl'); + const [fetchImplModule, httpTransportModule] = await Promise.all([ + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + import('@solana/fetch-impl'), + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + import('../http-transport'), + ]); + createHttpTransport = httpTransportModule.createHttpTransport; + fetchImpl = jest.mocked(fetchImplModule.default).mockReturnValue(FOREVER_PROMISE as Promise); + }); }); it('is impossible to override the `Accept` header', () => { const makeHttpRequest = createHttpTransport({ @@ -61,7 +78,7 @@ describe('createHttpRequest with custom headers', () => { url: 'fake://url', }); makeHttpRequest({ payload: 123 }); - expect(fetchMock).toHaveBeenCalledWith( + expect(fetchImpl).toHaveBeenCalledWith( expect.anything(), expect.objectContaining({ headers: expect.objectContaining({ @@ -76,7 +93,7 @@ describe('createHttpRequest with custom headers', () => { url: 'fake://url', }); makeHttpRequest({ payload: 123 }); - expect(fetchMock).toHaveBeenCalledWith( + expect(fetchImpl).toHaveBeenCalledWith( expect.anything(), expect.objectContaining({ headers: expect.objectContaining({ @@ -91,7 +108,7 @@ describe('createHttpRequest with custom headers', () => { url: 'fake://url', }); makeHttpRequest({ payload: 123 }); - expect(fetchMock).toHaveBeenCalledWith( + expect(fetchImpl).toHaveBeenCalledWith( expect.anything(), expect.objectContaining({ headers: expect.objectContaining({ diff --git a/packages/rpc-transport-http/src/__tests__/http-transport-test.ts b/packages/rpc-transport-http/src/__tests__/http-transport-test.ts index fa1b441363a..baccb736958 100644 --- a/packages/rpc-transport-http/src/__tests__/http-transport-test.ts +++ b/packages/rpc-transport-http/src/__tests__/http-transport-test.ts @@ -1,17 +1,36 @@ import { RpcTransport } from '@solana/rpc-spec'; -import fetchMock from 'jest-fetch-mock-fork'; - -import { createHttpTransport } from '../http-transport'; -import { SolanaHttpError } from '../http-transport-errors'; describe('createHttpTransport', () => { + let fetchMock: jest.Mock; let makeHttpRequest: RpcTransport; - beforeEach(() => { - makeHttpRequest = createHttpTransport({ url: 'fake://url' }); + let oldFetch: typeof globalThis.fetch; + let SolanaHttpError: typeof import('../http-transport-errors').SolanaHttpError; + beforeEach(async () => { + oldFetch = globalThis.fetch; + globalThis.fetch = fetchMock = jest.fn(); + await jest.isolateModulesAsync(async () => { + const [{ createHttpTransport }, HttpTransportErrorsModule] = await Promise.all([ + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + import('../http-transport'), + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + import('../http-transport-errors'), + ]); + SolanaHttpError = HttpTransportErrorsModule.SolanaHttpError; + makeHttpRequest = createHttpTransport({ url: 'fake://url' }); + }); + }); + afterEach(() => { + globalThis.fetch = oldFetch; }); describe('when the endpoint returns a non-200 status code', () => { beforeEach(() => { - fetchMock.once('', { status: 404, statusText: 'We looked everywhere' }); + fetchMock.mockResolvedValue({ + ok: false, + status: 404, + statusText: 'We looked everywhere', + }); }); it('throws HTTP errors', async () => { expect.assertions(3); @@ -23,7 +42,7 @@ describe('createHttpTransport', () => { }); describe('when the transport fatals', () => { beforeEach(() => { - fetchMock.mockReject(new TypeError('Failed to fetch')); + fetchMock.mockRejectedValue(new TypeError('Failed to fetch')); }); it('passes the exception through', async () => { expect.assertions(1); @@ -32,7 +51,10 @@ describe('createHttpTransport', () => { }); describe('when the endpoint returns a well-formed JSON response', () => { beforeEach(() => { - fetchMock.once(JSON.stringify({ ok: true })); + fetchMock.mockResolvedValue({ + json: async () => ({ ok: true }), + ok: true, + }); }); it('calls fetch with the specified URL', () => { makeHttpRequest({ payload: 123 }); diff --git a/packages/rpc-types/package.json b/packages/rpc-types/package.json index d3a34190bdb..bee08882689 100644 --- a/packages/rpc-types/package.json +++ b/packages/rpc-types/package.json @@ -82,7 +82,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "prettier": "^3.1", diff --git a/packages/rpc/package.json b/packages/rpc/package.json index 4d7c4eb952e..1e74182cc13 100644 --- a/packages/rpc/package.json +++ b/packages/rpc/package.json @@ -88,7 +88,6 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.1.2", "jest-runner-prettier": "^1.0.0", "prettier": "^3.1", diff --git a/packages/test-config/jest-unit.config.browser.ts b/packages/test-config/jest-unit.config.browser.ts index 3f638c4b00f..cf9ac03c0cc 100644 --- a/packages/test-config/jest-unit.config.browser.ts +++ b/packages/test-config/jest-unit.config.browser.ts @@ -25,6 +25,8 @@ const config: Partial = { ...(commonConfig.setupFilesAfterEnv ?? []), path.resolve(__dirname, 'setup-secure-context.ts'), path.resolve(__dirname, 'setup-text-encoder.ts'), + path.resolve(__dirname, 'setup-web-buffer-global.ts'), + path.resolve(__dirname, 'setup-whatwg-fetch.ts'), ], testEnvironment: path.resolve(__dirname, 'browser-environment.ts'), testEnvironmentOptions: {}, diff --git a/packages/test-config/jest-unit.config.common.ts b/packages/test-config/jest-unit.config.common.ts index cb1e41c094b..c59fc8d6ee1 100644 --- a/packages/test-config/jest-unit.config.common.ts +++ b/packages/test-config/jest-unit.config.common.ts @@ -8,7 +8,6 @@ const config: Partial = { setupFilesAfterEnv: [ path.resolve(__dirname, 'setup-dev-mode.ts'), path.resolve(__dirname, 'setup-define-version-constant.ts'), - path.resolve(__dirname, 'setup-fetch-mock.ts'), path.resolve(__dirname, 'setup-webcrypto.ts'), ], testPathIgnorePatterns: ['__setup__.ts'], diff --git a/packages/test-config/jest-unit.config.node.ts b/packages/test-config/jest-unit.config.node.ts index d5cc92fa4cc..dc01aaf67c8 100644 --- a/packages/test-config/jest-unit.config.node.ts +++ b/packages/test-config/jest-unit.config.node.ts @@ -1,3 +1,5 @@ +import path from 'node:path'; + import { Config } from '@jest/types'; import commonConfig from './jest-unit.config.common'; @@ -14,6 +16,7 @@ const config: Partial = { __NODEJS__: true, __REACTNATIVE__: false, }, + setupFilesAfterEnv: [...(commonConfig.setupFilesAfterEnv ?? []), path.resolve(__dirname, 'setup-undici-fetch.ts')], }; export default config; diff --git a/packages/test-config/package.json b/packages/test-config/package.json index 8a65bcbb859..29640825c9e 100644 --- a/packages/test-config/package.json +++ b/packages/test-config/package.json @@ -15,12 +15,13 @@ "jest": "^29.7.0", "jest-dev-server": "^9.0.0", "jest-environment-jsdom": "^29.6.4", - "jest-fetch-mock-fork": "^3.0.4", "jest-runner-eslint": "^2.0.0", "jest-runner-prettier": "^1.0.0", "jest-watch-master": "^1.0.0", "jest-watch-select-projects": "^2.0.0", - "jest-watch-typeahead": "^2.2.2" + "jest-watch-typeahead": "^2.2.2", + "undici": "^6.6.2", + "whatwg-fetch": "^3.6.20" }, "devDependencies": { "@jest/types": "^29.6.3", @@ -28,6 +29,7 @@ "@types/jest": "^29.5.11", "jest": "^29.7.0", "jest-dev-server": "^9.0.0", - "jest-fetch-mock-fork": "^3.0.4" + "undici": "^6.6.2", + "whatwg-fetch": "^3.6.20" } } diff --git a/packages/test-config/setup-fetch-mock.ts b/packages/test-config/setup-fetch-mock.ts deleted file mode 100644 index c82fbd85681..00000000000 --- a/packages/test-config/setup-fetch-mock.ts +++ /dev/null @@ -1,11 +0,0 @@ -import fetchMock, { enableFetchMocks } from 'jest-fetch-mock-fork'; -enableFetchMocks(); - -beforeEach(() => { - fetchMock.doMock(); -}); - -afterEach(() => { - fetchMock.resetMocks(); - fetchMock.dontMock(); -}); diff --git a/packages/test-config/setup-undici-fetch.ts b/packages/test-config/setup-undici-fetch.ts new file mode 100644 index 00000000000..17de3f40586 --- /dev/null +++ b/packages/test-config/setup-undici-fetch.ts @@ -0,0 +1,3 @@ +import { fetch as undiciFetch } from 'undici'; + +globalThis.fetch = undiciFetch as unknown as typeof globalThis.fetch; diff --git a/packages/test-config/setup-web-buffer-global.ts b/packages/test-config/setup-web-buffer-global.ts new file mode 100644 index 00000000000..eac0c9885a6 --- /dev/null +++ b/packages/test-config/setup-web-buffer-global.ts @@ -0,0 +1,8 @@ +/** + * Browsers don't have a `Buffer` global, so delete it now. + */ +beforeEach(() => { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + delete globalThis.Buffer; +}); diff --git a/packages/test-config/setup-whatwg-fetch.ts b/packages/test-config/setup-whatwg-fetch.ts new file mode 100644 index 00000000000..4be3734a77f --- /dev/null +++ b/packages/test-config/setup-whatwg-fetch.ts @@ -0,0 +1 @@ +import 'whatwg-fetch'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2f3f2b24ce6..0b8ccd896c8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,7 +24,7 @@ importers: version: 0.0.4(prettier@3.1.0) commitlint: specifier: ^18.6.1 - version: 18.6.1(@types/node@18.11.19)(typescript@5.2.2) + version: 18.6.1(@types/node@20.11.20)(typescript@5.2.2) eslint-config-turbo: specifier: ^1.10.13 version: 1.10.13(eslint@8.51.0) @@ -88,7 +88,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.45.0)(jest@29.7.0) @@ -158,7 +158,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -221,7 +221,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -309,7 +309,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) prettier: specifier: ^3.1 version: 3.1.0 @@ -363,7 +363,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -436,7 +436,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -503,7 +503,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -670,7 +670,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -866,7 +866,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -926,7 +926,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.45.0)(jest@29.7.0) @@ -986,7 +986,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.45.0)(jest@29.7.0) @@ -1059,7 +1059,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -1168,7 +1168,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -1543,7 +1543,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -1612,7 +1612,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.45.0)(jest@29.7.0) @@ -1704,9 +1704,6 @@ importers: jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.51.0)(jest@29.7.0) @@ -1780,6 +1777,9 @@ importers: '@types/jest': specifier: ^29.5.11 version: 29.5.11 + '@types/node': + specifier: ^20.11.20 + version: 20.11.20 '@typescript-eslint/eslint-plugin': specifier: ^6.13.2 version: 6.13.2(@typescript-eslint/parser@6.8.0)(eslint@8.51.0)(typescript@5.2.2) @@ -1800,13 +1800,10 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.51.0)(jest@29.7.0) @@ -1897,13 +1894,10 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.45.0)(jest@29.7.0) @@ -1963,7 +1957,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) prettier: specifier: ^3.1 version: 3.1.0 @@ -2028,9 +2022,6 @@ importers: jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.51.0)(jest@29.7.0) @@ -2097,9 +2088,6 @@ importers: jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.51.0)(jest@29.7.0) @@ -2191,9 +2179,6 @@ importers: jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.51.0)(jest@29.7.0) @@ -2285,9 +2270,6 @@ importers: jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.51.0)(jest@29.7.0) @@ -2361,9 +2343,6 @@ importers: jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.51.0)(jest@29.7.0) @@ -2440,9 +2419,6 @@ importers: jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.51.0)(jest@29.7.0) @@ -2522,9 +2498,6 @@ importers: jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.51.0)(jest@29.7.0) @@ -2598,9 +2571,6 @@ importers: jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.51.0)(jest@29.7.0) @@ -2670,13 +2640,10 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 jest-runner-eslint: specifier: ^2.1.2 version: 2.1.2(eslint@8.51.0)(jest@29.7.0) @@ -2761,7 +2728,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -2816,13 +2783,16 @@ importers: version: 29.5.11 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-dev-server: specifier: ^9.0.0 version: 9.0.0 - jest-fetch-mock-fork: - specifier: ^3.0.4 - version: 3.0.4 + undici: + specifier: ^6.6.2 + version: 6.6.2 + whatwg-fetch: + specifier: ^3.6.20 + version: 3.6.20 packages/test-matchers: devDependencies: @@ -2874,7 +2844,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -2962,7 +2932,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -3125,7 +3095,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -3192,7 +3162,7 @@ importers: version: 1.1.2 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.11.19) + version: 29.7.0(@types/node@20.11.20) jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 @@ -4469,14 +4439,14 @@ packages: dev: true optional: true - /@commitlint/cli@18.6.1(@types/node@18.11.19)(typescript@5.2.2): + /@commitlint/cli@18.6.1(@types/node@20.11.20)(typescript@5.2.2): resolution: {integrity: sha512-5IDE0a+lWGdkOvKH892HHAZgbAjcj1mT5QrfA/SVbLJV/BbBMGyKN0W5mhgjekPJJwEQdVNvhl9PwUacY58Usw==} engines: {node: '>=v18'} hasBin: true dependencies: '@commitlint/format': 18.6.1 '@commitlint/lint': 18.6.1 - '@commitlint/load': 18.6.1(@types/node@18.11.19)(typescript@5.2.2) + '@commitlint/load': 18.6.1(@types/node@20.11.20)(typescript@5.2.2) '@commitlint/read': 18.6.1 '@commitlint/types': 18.6.1 execa: 5.1.1 @@ -4547,7 +4517,7 @@ packages: '@commitlint/types': 18.6.1 dev: true - /@commitlint/load@18.6.1(@types/node@18.11.19)(typescript@5.2.2): + /@commitlint/load@18.6.1(@types/node@20.11.20)(typescript@5.2.2): resolution: {integrity: sha512-p26x8734tSXUHoAw0ERIiHyW4RaI4Bj99D8YgUlVV9SedLf8hlWAfyIFhHRIhfPngLlCe0QYOdRKYFt8gy56TA==} engines: {node: '>=v18'} dependencies: @@ -4557,7 +4527,7 @@ packages: '@commitlint/types': 18.6.1 chalk: 4.1.2 cosmiconfig: 8.3.6(typescript@5.2.2) - cosmiconfig-typescript-loader: 5.0.0(@types/node@18.11.19)(cosmiconfig@8.3.6)(typescript@5.2.2) + cosmiconfig-typescript-loader: 5.0.0(@types/node@20.11.20)(cosmiconfig@8.3.6)(typescript@5.2.2) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 @@ -4886,6 +4856,11 @@ packages: resolution: {integrity: sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@fastify/busboy@2.1.0: + resolution: {integrity: sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==} + engines: {node: '>=14'} + dev: true + /@graphql-tools/merge@8.3.1(graphql@15.8.0): resolution: {integrity: sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==} peerDependencies: @@ -4985,7 +4960,7 @@ packages: resolution: {integrity: sha512-HOS/0zWc3yn7NM0RQFgBeepeTE8eAKtyOkcGL/TV6if5MAfr+3bH9rwCyAhbXbjlLVR3afeBRt8JYKEerDcygA==} engines: {node: '>=12.0.0'} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 dev: true /@httptoolkit/subscriptions-transport-ws@0.11.2(graphql@15.8.0): @@ -5068,7 +5043,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 18.11.19 + '@types/node': 20.11.20 chalk: 4.1.2 jest-message-util: 27.5.1 jest-util: 27.5.1 @@ -5079,7 +5054,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 @@ -5099,14 +5074,14 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@18.11.19) + jest-config: 29.7.0(@types/node@20.11.20) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -5140,7 +5115,7 @@ packages: dependencies: '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-mock: 27.5.1 /@jest/environment@29.6.4: @@ -5149,7 +5124,7 @@ packages: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-mock: 29.7.0 dev: false @@ -5159,7 +5134,7 @@ packages: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-mock: 29.7.0 /@jest/expect-utils@29.7.0: @@ -5183,7 +5158,7 @@ packages: dependencies: '@jest/types': 27.5.1 '@sinonjs/fake-timers': 8.1.0 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-message-util: 27.5.1 jest-mock: 27.5.1 jest-util: 27.5.1 @@ -5194,7 +5169,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -5206,7 +5181,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -5245,7 +5220,7 @@ packages: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.18 - '@types/node': 18.11.19 + '@types/node': 20.11.20 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 @@ -5365,7 +5340,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.19 + '@types/node': 20.11.20 '@types/yargs': 16.0.5 chalk: 4.1.2 @@ -5376,7 +5351,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.19 + '@types/node': 20.11.20 '@types/yargs': 17.0.32 chalk: 4.1.2 @@ -6414,12 +6389,12 @@ packages: /@types/connect@3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 /@types/cors@2.8.13: resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 dev: true /@types/estree@1.0.1: @@ -6442,7 +6417,7 @@ packages: /@types/graceful-fs@4.1.6: resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 /@types/hast@2.3.4: resolution: {integrity: sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g==} @@ -6472,7 +6447,7 @@ packages: /@types/jsdom@20.0.1: resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 '@types/tough-cookie': 4.0.2 parse5: 7.1.2 @@ -6514,6 +6489,12 @@ packages: /@types/node@18.11.19: resolution: {integrity: sha512-YUgMWAQBWLObABqrvx8qKO1enAvBUdjZOAWQ5grBAkp5LQv45jBvYKZ3oFS9iKRCQyFjqw6iuEa1vmFqtxYLZw==} + dev: true + + /@types/node@20.11.20: + resolution: {integrity: sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==} + dependencies: + undici-types: 5.26.5 /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} @@ -6545,7 +6526,7 @@ packages: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} dependencies: '@types/mime': 1.3.2 - '@types/node': 18.11.19 + '@types/node': 20.11.20 dev: true /@types/sinon-chai@3.2.12: @@ -6577,12 +6558,12 @@ packages: /@types/ws@7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 /@types/ws@8.5.5: resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 dev: true /@types/yargs-parser@21.0.0: @@ -8050,12 +8031,12 @@ packages: engines: {node: '>= 6'} dev: true - /commitlint@18.6.1(@types/node@18.11.19)(typescript@5.2.2): + /commitlint@18.6.1(@types/node@20.11.20)(typescript@5.2.2): resolution: {integrity: sha512-I10mj1OmBCrPUHItRqeCEj0uxCdWxL15sCfS1Poq8av2FcX/KvRoiH8jTNG0cVDA2ns7IftugTAM+nLvOavLsw==} engines: {node: '>=v18'} hasBin: true dependencies: - '@commitlint/cli': 18.6.1(@types/node@18.11.19)(typescript@5.2.2) + '@commitlint/cli': 18.6.1(@types/node@20.11.20)(typescript@5.2.2) '@commitlint/types': 18.6.1 transitivePeerDependencies: - '@types/node' @@ -8214,7 +8195,7 @@ packages: vary: 1.1.2 dev: true - /cosmiconfig-typescript-loader@5.0.0(@types/node@18.11.19)(cosmiconfig@8.3.6)(typescript@5.2.2): + /cosmiconfig-typescript-loader@5.0.0(@types/node@20.11.20)(cosmiconfig@8.3.6)(typescript@5.2.2): resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==} engines: {node: '>=v16'} peerDependencies: @@ -8222,7 +8203,7 @@ packages: cosmiconfig: '>=8.2' typescript: '>=4' dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 cosmiconfig: 8.3.6(typescript@5.2.2) jiti: 1.21.0 typescript: 5.2.2 @@ -8305,6 +8286,25 @@ packages: - babel-plugin-macros - supports-color - ts-node + dev: true + + /create-jest@29.7.0(@types/node@20.11.20): + resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0(@types/node@20.11.20) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node /create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} @@ -8555,7 +8555,7 @@ packages: resolution: {integrity: sha512-78rUr9j0b4bRWO0eBtqKqmb43htBwNbofRRukpo+R7PZqHD6llb7aQoNVt81U9NQGhINRKBHz7lkrxZJj9vyog==} engines: {node: '>=12.0.0'} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 dev: true /detect-newline@3.1.0: @@ -8610,13 +8610,6 @@ packages: dependencies: esutils: 2.0.3 - /domexception@2.0.1: - resolution: {integrity: sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==} - engines: {node: '>=8'} - dependencies: - webidl-conversions: 5.0.0 - dev: true - /domexception@4.0.0: resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==} engines: {node: '>=12'} @@ -8978,7 +8971,7 @@ packages: '@typescript-eslint/eslint-plugin': 6.13.2(@typescript-eslint/parser@6.3.0)(eslint@8.45.0)(typescript@5.1.6) '@typescript-eslint/utils': 5.61.0(eslint@8.45.0)(typescript@5.1.6) eslint: 8.45.0 - jest: 29.7.0(@types/node@18.11.19) + jest: 29.7.0(@types/node@20.11.20) transitivePeerDependencies: - supports-color - typescript @@ -9000,7 +8993,7 @@ packages: '@typescript-eslint/eslint-plugin': 6.13.2(@typescript-eslint/parser@6.3.0)(eslint@8.45.0)(typescript@5.2.2) '@typescript-eslint/utils': 5.61.0(eslint@8.45.0)(typescript@5.2.2) eslint: 8.45.0 - jest: 29.7.0(@types/node@18.11.19) + jest: 29.7.0(@types/node@20.11.20) transitivePeerDependencies: - supports-color - typescript @@ -9022,7 +9015,7 @@ packages: '@typescript-eslint/eslint-plugin': 6.13.2(@typescript-eslint/parser@6.8.0)(eslint@8.51.0)(typescript@5.2.2) '@typescript-eslint/utils': 5.61.0(eslint@8.51.0)(typescript@5.2.2) eslint: 8.51.0 - jest: 29.7.0(@types/node@18.11.19) + jest: 29.7.0(@types/node@20.11.20) transitivePeerDependencies: - supports-color - typescript @@ -10671,7 +10664,7 @@ packages: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.1 @@ -10717,6 +10710,34 @@ packages: - babel-plugin-macros - supports-color - ts-node + dev: true + + /jest-cli@29.7.0(@types/node@20.11.20): + resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0(@types/node@20.11.20) + exit: 0.1.2 + import-local: 3.1.0 + jest-config: 29.7.0(@types/node@20.11.20) + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node /jest-config@29.7.0(@types/node@18.11.19): resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} @@ -10756,6 +10777,46 @@ packages: transitivePeerDependencies: - babel-plugin-macros - supports-color + dev: true + + /jest-config@29.7.0(@types/node@20.11.20): + resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.23.7 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.11.20 + babel-jest: 29.7.0(@babel/core@7.23.7) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color /jest-dev-server@9.0.0: resolution: {integrity: sha512-N43EDJLy3JBHZwtTxqHy+6lxu7Zw5PLD8Jzq2+ePV3v90hQc4UoUA/fnxoKdTCgZY3P1qPl6Zmj8m/886APxoQ==} @@ -10820,7 +10881,7 @@ packages: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-mock: 27.5.1 jest-util: 27.5.1 jsdom: 22.1.0 @@ -10843,7 +10904,7 @@ packages: '@jest/fake-timers': 29.6.4 '@jest/types': 29.6.3 '@types/jsdom': 20.0.1 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-mock: 29.6.3 jest-util: 29.6.3 jsdom: 22.1.0 @@ -10883,7 +10944,7 @@ packages: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-mock: 27.5.1 jest-util: 27.5.1 @@ -10894,20 +10955,10 @@ packages: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-mock: 29.7.0 jest-util: 29.7.0 - /jest-fetch-mock-fork@3.0.4: - resolution: {integrity: sha512-1VNwBvy8j1JhSKpgY8fp1fM1CTN8p+0tjSzL00Z88y+s68r1tsOywDqDv0PdylEpMtd1h70281lKHMugvsi4tQ==} - dependencies: - cross-fetch: 3.1.6 - domexception: 2.0.1 - promise-polyfill: 8.3.0 - transitivePeerDependencies: - - encoding - dev: true - /jest-get-type@27.5.1: resolution: {integrity: sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -10922,7 +10973,7 @@ packages: dependencies: '@jest/types': 27.5.1 '@types/graceful-fs': 4.1.6 - '@types/node': 18.11.19 + '@types/node': 20.11.20 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -10941,7 +10992,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.6 - '@types/node': 18.11.19 + '@types/node': 20.11.20 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -11018,14 +11069,14 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 18.11.19 + '@types/node': 20.11.20 /jest-mock@29.6.3: resolution: {integrity: sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-util: 29.7.0 dev: false @@ -11034,7 +11085,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-util: 29.7.0 /jest-pnp-resolver@1.2.3(jest-resolve@27.5.1): @@ -11122,7 +11173,7 @@ packages: create-jest-runner: 0.11.2 dot-prop: 5.3.0 eslint: 8.51.0 - jest: 29.7.0(@types/node@18.11.19) + jest: 29.7.0(@types/node@20.11.20) transitivePeerDependencies: - '@jest/test-result' - jest-runner @@ -11140,7 +11191,7 @@ packages: create-jest-runner: 0.11.2 dot-prop: 6.0.1 eslint: 8.45.0 - jest: 29.7.0(@types/node@18.11.19) + jest: 29.7.0(@types/node@20.11.20) transitivePeerDependencies: - '@jest/test-result' - jest-runner @@ -11172,7 +11223,7 @@ packages: dependencies: create-jest-runner: 0.8.0 emphasize: 5.0.0 - jest: 29.7.0(@types/node@18.11.19) + jest: 29.7.0(@types/node@20.11.20) jest-diff: 27.5.1 jest-runner: 27.5.1 p-limit: 4.0.0 @@ -11192,7 +11243,7 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 18.11.19 + '@types/node': 20.11.20 chalk: 4.1.2 emittery: 0.8.1 graceful-fs: 4.2.11 @@ -11223,7 +11274,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -11282,7 +11333,7 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 chalk: 4.1.2 cjs-module-lexer: 1.2.3 collect-v8-coverage: 1.0.1 @@ -11304,7 +11355,7 @@ packages: resolution: {integrity: sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 graceful-fs: 4.2.11 /jest-snapshot@27.5.1: @@ -11368,7 +11419,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 18.11.19 + '@types/node': 20.11.20 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -11379,7 +11430,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -11391,7 +11442,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -11427,7 +11478,7 @@ packages: jest-validate: '>= 23.6.0' dependencies: chalk: 2.4.2 - jest: 29.7.0(@types/node@18.11.19) + jest: 29.7.0(@types/node@20.11.20) jest-validate: 29.7.0 dev: false @@ -11447,7 +11498,7 @@ packages: dependencies: ansi-escapes: 6.2.0 chalk: 5.2.0 - jest: 29.7.0(@types/node@18.11.19) + jest: 29.7.0(@types/node@20.11.20) jest-regex-util: 29.4.3 jest-watcher: 29.5.0 slash: 5.1.0 @@ -11461,7 +11512,7 @@ packages: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -11475,7 +11526,7 @@ packages: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 18.11.19 + '@types/node': 20.11.20 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -11493,7 +11544,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -11501,7 +11552,7 @@ packages: resolution: {integrity: sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -11509,7 +11560,7 @@ packages: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -11533,6 +11584,27 @@ packages: - babel-plugin-macros - supports-color - ts-node + dev: true + + /jest@29.7.0(@types/node@20.11.20): + resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.7.0 + '@jest/types': 29.6.3 + import-local: 3.1.0 + jest-cli: 29.7.0(@types/node@20.11.20) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node /jiti@1.21.0: resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} @@ -12888,10 +12960,6 @@ packages: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true - /promise-polyfill@8.3.0: - resolution: {integrity: sha512-H5oELycFml5yto/atYqmjyigJoAo3+OXwolYiH7OfQuYlAqhxNvTfiNMbV9hsC6Yp83yE5r2KTVmtrG6R9i6Pg==} - dev: true - /prompts@2.4.2: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} @@ -13045,7 +13113,7 @@ packages: resolution: {integrity: sha512-OvSzfVv6Y656ekUxB7aDhWkLW7y1ck16ChfLFNJhKNADFNweH2fvyiEZkGmmdtXbOtlNuH2zVXZoFCW349M+GA==} engines: {node: '>=12.0.0'} dependencies: - '@types/node': 18.11.19 + '@types/node': 20.11.20 dev: true /readable-stream@2.3.8: @@ -14542,6 +14610,16 @@ packages: which-boxed-primitive: 1.0.2 dev: true + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + + /undici@6.6.2: + resolution: {integrity: sha512-vSqvUE5skSxQJ5sztTZ/CdeJb1Wq0Hf44hlYMciqHghvz+K88U0l7D6u1VsndoFgskDcnU+nG3gYmMzJVzd9Qg==} + engines: {node: '>=18.0'} + dependencies: + '@fastify/busboy': 2.1.0 + dev: true + /unicode-canonical-property-names-ecmascript@2.0.0: resolution: {integrity: sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==} engines: {node: '>=4'} @@ -14743,11 +14821,6 @@ packages: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} dev: true - /webidl-conversions@5.0.0: - resolution: {integrity: sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==} - engines: {node: '>=8'} - dev: true - /webidl-conversions@7.0.0: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} @@ -14758,6 +14831,10 @@ packages: dependencies: iconv-lite: 0.6.3 + /whatwg-fetch@3.6.20: + resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==} + dev: true + /whatwg-mimetype@3.0.0: resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} engines: {node: '>=12'}