Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Hop to TestNew to Visual Studio Code? Get it now.
Hop to Test

Hop to Test

Kevin Braun

|
1 install
| (0) | Free
Quickly hop between source files and their related test files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Hop to Test

A VS Code extension that allows you to quickly hop between source files and their corresponding test files.

demo

Features

  • Hop from source to test: When viewing a source file (e.g., SomeComponent.jsx), hop to its test file (e.g., SomeComponent.test.js)
  • Hop from test to source: When viewing a test file (e.g., useFancyHook.test.js), hop back to the source file (e.g., useFancyHook.js)
  • Multiple file patterns: Supports .test.js, .test.ts, .spec.js, .spec.ts, and more
  • Multiple extensions: Works with .js, .jsx, .ts, .tsx, .mjs, .cjs

Usage

  1. Open a source file or test file in VS Code
  2. Press Ctrl+Shift+T (or Cmd+Shift+T on macOS) to hop to the corresponding test/source file
  3. Alternatively, use the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and search for "Hop to Test/Source"

Supported Patterns

Source Files

  • Component.jsx → Component.test.js or Component.test.jsx
  • useHook.ts → useHook.test.ts
  • MyComponent.js → MyComponent.test.js or MyComponent.spec.js

Test Files

  • Component.test.js → Component.js or Component.jsx
  • useHook.test.ts → useHook.ts or useHook.tsx
  • MyComponent.spec.js → MyComponent.js or MyComponent.jsx

Development

Setup

npm install

Build

npm run compile

Watch Mode

npm run watch

Testing

  1. Press F5 to open a new Extension Development Host window
  2. Open a JavaScript/TypeScript file or test file
  3. Press Ctrl+Shift+T (or Cmd+Shift+T) to test the extension

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft