Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@
"execa": "^10.0.1",
"knip": "^6.39.0",
"lodash": "^4.18.1",
"nock": "^13.5.6",
"node-fetch": "^2.7.0",
"nock": "^15.0.5",
"oxfmt": "^0.72.0",
"oxlint": "^1.85.0",
"oxlint-tsgolint": "^7.0.2002",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/assets-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"@metamask/eth-json-rpc-provider": "^7.0.0",
"@types/lodash-es": "^4.17.12",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const V3_ASSETS_BY_LOWER_ID = v3Assets as unknown as Record<
export function mockSuggestedOccurrenceFloors(): nock.Scope {
return nock(API_URLS.TOKEN)
.get('/v1/suggestedOccurrenceFloors')
.reply(200, suggestedOccurrenceFloors as Record<string, number>);
.reply(200, suggestedOccurrenceFloors);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"@types/node": "^22.13.14",
"@typescript/native": "npm:typescript@^7.0.2",
"jsdom": "^27.0.0",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/authenticated-user-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/base-data-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@metamask/auto-changelog": "^6.2.1",
"@types/lodash-es": "^4.17.12",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"@metamask/superstruct": "^3.4.1",
"@typescript/native": "npm:typescript@^7.0.2",
"lodash-es": "^4.18.1",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-status-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@typescript/native": "npm:typescript@^7.0.2",
"@vitest/coverage-v8": "^5.0.0",
"lodash-es": "^4.18.1",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/chomp-api-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/chomp-api-service/src/chomp-api-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ describe('ChompApiService', () => {
const { service } = createService();

await expect(service.disassociateAddress('0xabc')).rejects.toThrow(
'network down',
'fetch failed',
);
expect(scope.pendingMocks()).toHaveLength(1);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/compliance-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/config-registry-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@lavamoat/allow-scripts": "^5.1.0",
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/controller-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@types/lodash-es": "^4.17.12",
"@typescript/native": "npm:typescript@^7.0.2",
"jsdom": "^27.0.0",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/foundryup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@types/yargs": "^17.0.35",
"@types/yargs-parser": "^21.0.3",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/gas-fee-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@babel/runtime": "^7.29.7",
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/kyc-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"chokidar-cli": "^3.0.0",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/local-node-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/money-account-api-data-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/money-account-balance-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/multichain-network-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@types/lodash-es": "^4.17.12",
"@typescript/native": "npm:typescript@^7.0.2",
"immer": "^11.1.18",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/network-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"deep-freeze-strict": "^1.1.1",
"deepmerge": "^4.3.1",
"lodash-es": "^4.18.1",
"nock": "^13.5.6",
"nock": "^15.0.5",
"node-fetch": "^2.7.0",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ function buildScopeForMockingRequests(
rpcUrl: string,
headers: Record<string, string>,
): nock.Scope {
return nock(rpcUrl, { reqheaders: headers }).filteringRequestBody((body) => {
// The types for nock 15 only declare the form of `filteringRequestBody` that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nock 15's types only declare filteringRequestBody() with no arguments, but it still accepts a function at runtime, and that form is documented in the README under "Request Body filtering": https://github.com/nock/nock#request-body-filtering
The cast just lets us keep passing the function (it logs each request body through debug), since the typings don't expose that overload anymore.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the source makes use of arguments as any to accept the function :( https://github.com/nock/nock/blob/415fc645e663aa79d3f9aaa8abbb82f4229ee524/lib/scope.ts#L310. So that must be why. Seems like an acceptable fix to me.

// takes no arguments, although it still accepts a function at runtime.
const scope = nock(rpcUrl, { reqheaders: headers }) as unknown as {
filteringRequestBody: (filter: (body: string) => string) => nock.Scope;
};
return scope.filteringRequestBody((body) => {
debug('Nock Received Request: ', body);
return body;
});
Expand Down
2 changes: 1 addition & 1 deletion packages/notification-services-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@typescript/native": "npm:typescript@^7.0.2",
"contentful": "^11.12.10",
"jsdom": "^27.0.0",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/phishing-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@metamask/auto-changelog": "^6.2.1",
"@metamask/eth-sig-util": "^9.0.0",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/profile-metrics-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@metamask/auto-changelog": "^6.2.1",
"@metamask/keyring-internal-api": "^12.1.2",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/profile-sync-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"@typescript/native": "npm:typescript@^7.0.2",
"ethers": "^6.17.0",
"jsdom": "^27.0.0",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const handleMockSocialLogin = (
// Body and header matchers capture the request, because the arguments
// passed to `.reply()` callbacks differ between nock versions.
let requestBody: unknown;
let authorization: string | undefined;
let authorization: string | null | undefined;
const interceptor = nock(MOCK_SOCIAL_LOGIN_URL)
.persist()
.post('', (body) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ramps-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-data-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@metamask/auto-changelog": "^6.2.1",
"@metamask/messenger": "^3.0.0",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/remote-feature-flag-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@lavamoat/allow-scripts": "^5.1.0",
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/sample-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@metamask/auto-changelog": "^6.2.1",
"@metamask/controller-utils": "^13.0.0",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/seedless-onboarding-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@types/elliptic": "^6",
"@types/json-stable-stringify-without-jsonify": "^1.0.2",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/selected-network-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"immer": "^11.1.18",
"jsdom": "^27.0.0",
"lodash-es": "^4.18.1",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/sentinel-api-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"devDependencies": {
"@metamask/auto-changelog": "^6.2.1",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-transactions-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@metamask/auto-changelog": "^6.2.1",
"@metamask/json-rpc-engine": "^11.0.0",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/transaction-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"@typescript/native": "npm:typescript@^7.0.2",
"immer": "^11.1.18",
"jsdom": "^27.0.0",
"nock": "^13.5.6",
"nock": "^15.0.5",
"rimraf": "^6.1.3",
"typedoc": "^0.28.20",
"typedoc-plugin-missing-exports": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-framework-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@metamask/auto-changelog": "^6.2.1",
"@types/react": "^19.0.0",
"@typescript/native": "npm:typescript@^7.0.2",
"nock": "^13.5.6",
"nock": "^15.0.5",
"prism-react-renderer": "^2.4.1",
"raw-loader": "^4.0.2",
"react": "^19.3.0",
Expand Down
12 changes: 0 additions & 12 deletions tests/vitest/setup.ts

This file was deleted.

12 changes: 1 addition & 11 deletions tsc-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -622,11 +622,6 @@
"count": 3
}
},
"packages/notification-services-controller/src/NotificationServicesController/__fixtures__/mockServices.ts": {
"TS2769": {
"count": 3
}
},
"packages/passkey-controller/tests/mocks/passkey-controller-messenger.ts": {
"TS2322": {
"count": 1
Expand Down Expand Up @@ -882,11 +877,6 @@
"count": 7
}
},
"packages/profile-sync-controller/src/controllers/authentication/__fixtures__/mockServices.ts": {
"TS2769": {
"count": 3
}
},
"packages/profile-sync-controller/src/controllers/user-storage/__fixtures__/mockMessenger.ts": {
"TS2741": {
"count": 1
Expand Down Expand Up @@ -1277,7 +1267,7 @@
},
"packages/wallet-framework-docs/content/data-services/writing-data-services/02-read-only-requests/orders-service.test.ts": {
"TS1479": {
"count": 2
"count": 3
},
"TS1541": {
"count": 1
Expand Down
Loading
Loading