Skip to content

refactor: remove nock definition file#28031

Merged
Prithpal-Sooriya merged 1 commit into
mainfrom
refactor/remove-nock-definition-file
Mar 27, 2026
Merged

refactor: remove nock definition file#28031
Prithpal-Sooriya merged 1 commit into
mainfrom
refactor/remove-nock-definition-file

Conversation

@Prithpal-Sooriya

@Prithpal-Sooriya Prithpal-Sooriya commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

nock already has great types built in, we should not be overriding the limiting the type inference from nock with our own definitions file.

Description

Changelog

CHANGELOG entry: refactor: remove nock definition file

Related issues

Fixes: from a DX perspective, the definitions override is incredibly limiting which prevents us from fully utilising the nock API

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Low risk because this only removes a test-only TypeScript declaration override and relies on nock’s published types; primary risk is minor compile-time type changes in component-view test mocks.

Overview
Removes the local tests/component-view/api-mocking/nock.d.ts module declaration that was overriding nock typings, so component-view API mock helpers now use nock’s upstream TypeScript definitions and benefit from full type inference.

Written by Cursor Bugbot for commit 9bd94b4. This will update automatically on new commits. Configure here.

nock already has great types built in, we should not be overriding the limiting the type inference from nock with out own definitions file
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added size-S risk-low Low testing needed · Low bug introduction risk labels Mar 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
The only changed file is tests/component-view/api-mocking/nock.d.ts, which was deleted. This was a custom TypeScript declaration file (declare module 'nock') providing type definitions for the nock HTTP mocking library used in component-view tests.

Key analysis:

  1. Scope: This file is in tests/component-view/api-mocking/ — the component-view testing framework, which is entirely separate from the Detox E2E test suite.
  2. Nature of change: Deletion of a TypeScript type declaration file. This is likely because nock now ships its own types or @types/nock is available, making the custom declaration redundant.
  3. Impact on E2E tests: Zero. The nock library is only referenced in nockHelpers.ts and trending.ts within the component-view infrastructure. No Detox E2E tests use nock.
  4. Impact on app code: None. This is purely a test infrastructure TypeScript file.
  5. Runtime behavior: Unchanged. Type declaration files have no runtime effect.

No E2E Detox test tags need to run for this change.

Performance Test Selection:
The deleted file is a TypeScript type declaration for the nock HTTP mocking library used in component-view tests. It has no impact on app performance, UI rendering, data loading, or any runtime behavior. No performance tests are needed.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit a5a9ce3 Mar 27, 2026
85 of 89 checks passed
@Prithpal-Sooriya Prithpal-Sooriya deleted the refactor/remove-nock-definition-file branch March 27, 2026 12:17
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2026
@metamaskbot metamaskbot added the release-7.73.0 Issue or pull request that will be included in release 7.73.0 label Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.73.0 Issue or pull request that will be included in release 7.73.0 risk-low Low testing needed · Low bug introduction risk size-S team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants