SwitchIt is a Visual Studio Code extension designed to streamline navigation between your test and implementation files. This tool helps you maintain proper test coverage by seamlessly switching between the two and prompting you when a test or implementation file is missing.
Features
Quick Switch
Move effortlessly between your test files and implementation files with a simple command.
Missing File Detection
If the test file or implementation file doesn’t exist, SwitchIt prompts you to create one.
Customizable File Conventions
Adapt the extension to your project by configuring your file naming conventions. Whether you're working with .test.ts, .spec.ts, or any other format, SwitchIt has you covered.
Default Configuration
By default, SwitchIt uses the following file conventions for navigation:
Test File:.spec.ts
Implementation File:.ts
You can modify these to fit your project needs.
Configuring the Extension
Open Settings:
Go to Preferences > Settings (UI) in Visual Studio Code.
Find Settings:
Search for fileNamingConvention in the settings menu.
Set Your Naming Conventions:
Change the configuration to match your project structure. For example:
Set testFile for your preferred test file pattern (e.g., .test.ts).
Set implementationFile for your implementation file format (e.g., .js or .ts).
Usage
Open either a test or implementation file.
Use the "Switch" command via the command palette (Ctrl+Shift+P) or by setting a custom keyboard shortcut.
If the target file is missing, you'll be prompted to create it!
Requirements
Visual Studio Code version 1.60.0 or higher.
Contribution
Contributions are welcome! Feel free to submit issues or pull requests to improve this extension.
License
This extension is licensed under the [MIT License]
Happy Coding!
Now, go forth and let your code and tests stay in sync like never before! 🚀