Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>KamehameNew to Visual Studio Code?Β Get it now.
Kamehame

Kamehame

Gokul Nair

|
18 installs
| (0) | Free
πŸ”₯ Generate Vitest unit tests for Angular components, services, directives, and pipes in seconds!
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VS Code Marketplace 💥 Kamehame - Angular Vitest Test Generator

Kamehame is a blazing-fast VS Code extension that auto-generates Vitest unit tests for Angular components, services, directives, and pipes. No more boilerplate β€” just hit the command and let Kamehame do the heavy lifting! 🧪✨

βΈ»

βš™οΈ Features

βœ… Supports Angular v14–v19 βœ… Generates tests for: β€’ 🧩 Components (with @Input() / @Output() binding tests) β€’ 🧭 Directives β€’ 🛠️ Services (with constructor dependency mocks) β€’ 🔁 Pipes (transform() logic)

βœ… Intelligent parameter mocking: β€’ string, number, boolean, functions, and nested objects βœ… Uses Angular’s TestBed βœ… Auto-calculates relative import paths βœ… Optional code coverage reminder βœ… Live spec preview before writing βœ… File overwrite strategy (Overwrite / Cancel / Preview) βœ… Workspace-level config via kamehame.config.json βœ… Status bar success notification

βΈ»

🚀 How to Use

📁 From File Context Menu:

Right-click a .ts file in the Explorer and choose:

💥 Generate Vitest Test (Kamehame)

🔍 From Command Palette: Cmd/Ctrl + Shift + P β†’ Kamehame: Generate Test

βš™οΈ Workspace Configuration

Create a kamehame.config.json at your project root:

{ "enableCoverageComment": true, "autoPreview": true }

Option Description

enableCoverageComment Appends a code coverage comment block at the end autoPreview Shows the generated spec in a preview tab before writing

🧪 Generated Test Preview

describe('MyComponent', () => { let component: MyComponent; let fixture: ComponentFixture;

beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [MyComponent] }).compileComponents();

fixture = TestBed.createComponent(MyComponent);
component = fixture.componentInstance;
fixture.detectChanges();

});

it('should create the component', () => { expect(component).toBeTruthy(); });

/*

  • 📊 Code Coverage: Aim for 100% method coverage.
  • Auto-generated by Kamehame. */ });

📁 Supported File Types

File Type Coverage

.component.ts βœ… Full coverage (inputs/outputs) .service.ts βœ… Dependency mocks & methods .pipe.ts βœ… transform() logic testing .directive.ts βœ… Inputs, outputs, and logic

💡 Smart Features β€’ 🎯 Detects and mocks method parameters β€’ 🧠 Special handling for ngOnInit() β€’ 🧱 Constructor dependency mocking β€’ 👀 Live spec preview before writing β€’ 🚫 Prevents test generation for .spec.ts files

βΈ»

👨‍💻 Maintainer

Built with ❀️ by Gokul Nair MIT Licensed | Open Source

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