A powerful VS Code extension that automatically generates comprehensive unit tests for Angular components, services, pipes, directives, and guards with zero configuration.
Features
Automatic Test Generation: Generate complete, runnable tests with a single click or keyboard shortcut
Framework Auto-Detection: Automatically detects whether your project uses Jasmine or Jest
Comprehensive Coverage: Supports all Angular element types:
Components (with template binding tests)
Services (with HTTP testing support)
Pipes (with edge case testing)
Directives (with host listener/binding tests)
Guards (with route protection tests)
Smart Analysis: Uses TypeScript AST parsing for accurate code analysis
Intelligent Mocking: Auto-generates mocks for all dependencies
Multiple Activation Methods:
Right-click context menu on TypeScript files
Command Palette (Generate Tests)
Keyboard shortcut (Ctrl+Shift+T / Cmd+Shift+T)
Installation
Open VS Code
Press Ctrl+P / Cmd+P to open Quick Open
Type ext install ng-smart-test-gen
Press Enter
Usage
Method 1: Context Menu (Recommended)
Right-click any Angular TypeScript file (component, service, pipe, etc.)
Select "Generate Tests" from the context menu
Test file is created/updated automatically
Method 2: Keyboard Shortcut
Open any Angular TypeScript file
Press Ctrl+Shift+T (Windows/Linux) or Cmd+Shift+T (Mac)