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

Jump to the Test

Miguel Cueva

|
50 installs
| (0) | Free
Open spec/test file based on current file name or back again
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Jump to the Test

Jump to the Test Logo

About the Extension

This extension registers a command that allows you to switch between the code and its respective test file. It does this based on the name of the current file and looks for a file that matches the pattern of its name.

Features

On MacOS, press Ctrl+Option+T.

On Windows / Linux, press Ctrl+Alt+T.

When the command is executed, your editor will jump to your test file..

My Image

If you cannot find your respective test file, then there will be an error message in the status bar.

My Image

The extension should successfully take you between files named in the following patterns (including Vue files), regardless of the extensions:

Vue file:

  • component.vue --> component.spec.js
  • component.spec.js --> component.vue
  • component.vue --> component.spec.ts
  • component.spec.ts --> component.vue

Javacript file:

  • FileName.js --> FileName.spec.js
  • FileName.spec.js --> FileName.js
  • FileName.js --> FileName.test.js
  • FileName.test.js --> FileName.js

Typescript file:

  • FileName.service.ts --> FileName.service.test.js
  • FileName.service.test.js --> FileName.service.ts
  • FileName.service.ts --> FileName.service.spec.js
  • FileName.service.spec.js --> FileName.service.ts

Ruby file:

  • file_name.rb --> file_name_test.rb
  • file_name_test.rb --> file_name.rb
  • file_name.rb --> file_name_spec.rb
  • file_name_spec.rb --> file_name.rb

Java file:

  • FileName.java --> FileNameTest.java
  • FileNameTest.java --> FileName.java
  • FileName.java --> FileNameSpec.java
  • FileNameSpec.java --> FileName.java

Rust file:

  • file-name.rs --> file-name-test.rs
  • file-name-test.rs --> file-name.rs
  • file-name.rs --> file-name-spec.rs
  • file-name-spec.rs --> file-name.rs

Release Notes

All releases are experimental and will improve with your suggestions.

Enjoy!

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