Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>SpectreNew to Visual Studio Code? Get it now.
Spectre

Spectre

Jared Corker

|
135 installs
| (2) | Free
VSCode command to open your spec files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

spectre README

This is a simple extension to make switching between code and spec files easier

Features

Spectre Test Open

spectre.spectre

  • From a ts/tsx file, open the corresponding spec file code-to-spec
  • From a spec file, open the corresponding ts/tsx file spec-to-code
  • If no spec file is found, offer to create one create-spec

Spectre Test Run

spectre.test & spectre.test-watch

  • Run test on currently opened spec file
  • Run test on the corresponding spec file for a currently opened ts/tsx file

Spectre Mock Open

spectre.mock

  • Open a mock file from a code/spec file
  • Open a spec file from a mock file

NOTE I strongly suggest you bind these commands to keyboard shortcuts in vscode

e.g. shortcuts

Limitatations

  • File system must use unix style paths (i.e. my/current/path)
  • Only works for files with extensions .ts, .tsx, .spec.tsx
  • Spec file must be located in a __tests__/ folder in the same folder as the code file
  • Yarn is installed with jest
  • Yarn script is setup to run tests with yarn run test
├── __tests__
│   └── spectre.spec.tsx
└── spectre.tsx

Release Notes

1.0.0

Initial release of Spectre

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