VS Code Extension: single-click-unit-test-generation
single click Unit Test Generator
The single click Unit Test Generator extension allows developers to quickly generate unit tests based on selected code within their editor. Powered by the advanced Gemini 2.0 Multi-Modal LLM, this tool supports test generation for virtually any programming language.
Simply highlight the desired code snippet, select your preferred testing framework, and let the extension handle the rest — producing clean, high-quality unit tests in seconds.
📦 Features
Key Features
Quick Setup – Get started in just a few clicks
Gemini-Powered – Leverages Gemini 2.0 for accurate and intelligent test generation
Fast Execution – Generates tests in as little as 10–20 seconds
Privacy First – Your code stays safe; nothing is stored
🚀 Getting Started
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for single-click-unit-test-generation
- Click Install
Or install from the VS Code Marketplace.
Usage
- Open a file supported by the extension.
- Right-click and choose
Your Command Name
from the context menu.
- Alternatively, use the command palette (
Ctrl+Shift+P
) and run:
> Your Extension: Run Command
Example
// Input
import { Component, signal } from '@angular/core';
import { RouterOutlet } from '@angular/router';
@Component({
selector: 'app-root',
imports: [RouterOutlet],
templateUrl: './app.html',
styleUrl: './app.scss'
})
export class App {
protected readonly title = signal('my-new-app');
}
// Output (generated by extension)
import { TestBed } from '@angular/core/testing';
import { App } from './app';
describe('App', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [App]
});
});
it('should create the app', () => {
const fixture = TestBed.createComponent(App);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have the correct title`, () => {
const fixture = TestBed.createComponent(App);
const app = fixture.componentInstance;
expect(app.title()).toEqual('my-new-app');
});
it('should render title in a span tag', () => {
const fixture = TestBed.createComponent(App);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('span')?.textContent).toContain('my-new-app');
});
});