NgTestThisFile is a lightweight, blazing-fast Visual Studio Code extension that helps Angular developers run individual spec files effortlessly with a single command or shortcut.
⚡ Made with ❤️ by Omar Faruk Pial
✨ Features
✅ One-click testing: Run ng test for the currently open .spec.ts file instantly.
🎯 Smart detection: Automatically detects the relative path for Angular CLI's --include option.
🔄 Auto-terminal handling: Opens a dedicated terminal, clears previous runs, and runs the new command.
⌨️ Keyboard shortcut ready: Default shortcut Ctrl + Alt + T.
💻 Cross-platform: Works seamlessly on Windows, macOS, and Linux.
🎯 Why Use This?
When working with Angular apps, testing individual files is common—but the Angular CLI doesn’t offer a native way to run one test file easily.
NgTestThisFile solves that by:
Avoiding full test suite execution
Boosting test–debug productivity
Simplifying workflows
Ideal for Test-Driven Development (TDD) and large Angular projects!
🚀 Usage
Open any Angular test file (e.g., example.component.spec.ts)
Press Ctrl + Alt + T (or use the Command Palette: “Ng Test This File”)
The extension runs:
ng test --include='src/app/example/example.component.spec.ts'