Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>QUnit: AI Test GeneratorNew to Visual Studio Code? Get it now.
QUnit: AI Test Generator

QUnit: AI Test Generator

Q4US

|
1 install
| (0) | Free
Automatically generate high-quality unit and integration tests for Moleculer.js and Express.js services using AI. Smart test planning, deep mocking, and auto-validation included.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

QUnit — AI Test Generator for VS Code

Generate, run, and auto-fix unit tests for Moleculer.js and TypeScript projects — directly from your editor, powered by Google Gemini.

QUnit reads the function you're working on, proposes a structured test plan, writes idiomatic Mocha / Chai / Sinon specs into the matching test file, runs them for you, and automatically repairs any failures — using your own Gemini API key.


Overview

Supported Frameworks Moleculer.js, Express.js, generic TypeScript / JavaScript
AI Provider Google Gemini (user-supplied API key)

Key Features

Feature Description
AI test planning Proposes scenarios classified by priority — Critical, High, Medium, Low — so you choose what gets generated.
One-click generation A Generate Unit Test action appears inline above every function, method, or service action.
Mocha and Jest support Auto-detects your project's test runner. Generates Mocha + Chai + Sinon tests by default, or Jest tests for Jest projects.
Smart mocking Automatically handles service calls and database dependencies so your tests run in isolation.
Automatic self-repair Runs the generated tests, reads failures, refines the code, and re-runs — up to 5 attempts (configurable).
Non-destructive updates New cases are added to your existing test file without overwriting tests you've written by hand.
Interactive test panel Dedicated tabs for Input Context, Test Plan, Generated Test, and Execution Result — with one-click re-run.
Sidebar navigation Activity-bar view with Functions, Statistics, History, and API-key management.
Status bar indicator A live 🧪 Tests: X Passed, Y Failed summary in the VS Code status bar — click it to open the Statistics dashboard.
Statistics dashboard A full webview with pass/fail totals and per-function breakdown across the workspace.

Installation

  1. Open the Extensions view in VS Code (Ctrl+Shift+X).
  2. Search for QUnit.
  3. Click Install on QUnit — Test Generator by Q4US.

Marketplace listing

After installation, open the QUnit view from the activity bar (flask icon).

Activity-bar entry


Quick Start

Once installed, here's how to generate your first test with QUnit — from API key setup to a green test run.

1. Provide your Gemini API key

On first use, QUnit prompts for your Gemini API key.

API-key prompt

A free key is available at Google AI Studio.

2. Open a source file

QUnit scans the open file and shows a Generate Unit Test action directly above each function, method, or service action.

CodeLens detection on a Moleculer action

3. Review the proposed test plan

Before any code is written, Gemini returns a structured plan. Each scenario has a priority tag ([High], [Medium], [Low]) and a short description, and you can include or exclude individual cases.

Test-plan QuickPick

4. Smart merge with existing tests

If a test file already exists, QUnit asks before changing anything.

Smart-merge dialog

  • Apply Changes — add the new cases to your existing test file.
  • Show Diff — preview the change first.
  • Discard / Cancel — keep the file as it is.

5. Automatic validation and self-repair

After writing the tests, QUnit runs them. If anything fails, it reviews the error, fixes the code, and re-runs — automatically.

Auto-repair success notification

6. Live status in the editor

The inline action updates to show the latest result and quick follow-up options.

CodeLens showing PASSED badge

  • ✓ PASSED / ✗ FAILED — current status for that function.
  • ↻ Re-Generate — re-plan and rewrite the tests.
  • View Test Plan — open the detailed panel.

7. Test plan and execution panel

Open the dedicated panel to add more scenarios, review the generated tests, and watch test runs live.

Test-plan panel — Other Scenarios tab

Execution-result panel with test output

The Execution Result tab shows each test case pass/fail and the full output from the test run.

8. Clean, readable tests

QUnit produces well-structured Mocha specs that are easy to read and maintain.

Generated test file

9. Track progress across your workspace

As you generate tests for more functions, the QUnit sidebar collects everything in one place — detected functions with live ✓ / ✗ status, a statistics summary, a history of past generations, and API-key management.

QUnit sidebar panel — Functions, Statistics, History, API Key

Click Open Statistics Dashboard (or the status-bar 🧪 Tests indicator) to open a full workspace-wide view with a Test Execution Overview, pass/fail donut chart, and a detailed per-function results table.

Statistics Dashboard — totals, donut chart, and detailed test results


Configuration

QUnit works out of the box with sensible defaults. If you want to customize its behavior, you can do it in either of two places:

  • Settings UI — open File → Preferences → Settings (Ctrl+,) and search for ai-test-generator. Each option appears with its description, defaults, and dropdowns.
  • settings.json — open the Command Palette (Ctrl+Shift+P) → Preferences: Open User Settings (JSON) and add the keys directly. Handy if you want to share the same configuration across a team via workspace settings.

QUnit settings in VS Code

Setting Default What it does When you'd change it
ai-test-generator.autoValidateTests true After writing your tests, QUnit runs them automatically and tries to fix any failures. Turn off if you prefer QUnit to just write the tests and leave running and fixing to you.
ai-test-generator.maxFixAttempts 5 How many times QUnit will retry fixing a failing test before giving up. Lower this (1–2) if you don't want to wait long on failures; keep at 5 for the best chance of a clean pass.
ai-test-generator.framework auto Which style of tests to generate: auto, moleculer, express, or generic. auto picks the best fit based on your project. Force a specific style if auto-detect gets it wrong — for example, a mixed project where you want Moleculer tests.
ai-test-generator.testCommand npm test The command QUnit uses to run your tests. Change to yarn test, pnpm test, npx jest, or your project's custom script.

Example settings.json:

{
  "ai-test-generator.autoValidateTests": true,
  "ai-test-generator.maxFixAttempts": 3,
  "ai-test-generator.framework": "moleculer",
  "ai-test-generator.testCommand": "npm test"
}

Requirements

  • VS Code 1.85 or newer.
  • Node.js and npm available on your PATH.
  • A Google Gemini API key (the free tier is enough to get started).

Commands

Command Palette title
ai-test-generator.generateTests Generate Unit Tests
ai-test-generator.generateTestsForActiveFile QUnit: Generate Unit Tests for Active File
ai-test-generator.setApiKey QUnit: Set Gemini API Key
ai-test-generator.logout Clear Gemini API Key
ai-test-generator.runTest Run Test
ai-test-generator.showStatistics Show Statistics

Support

  • Repository — github.com/Q4US/qunit
  • Issues — github.com/Q4US/qunit/issues

Connect with Q4US

  • Website — q4us.dev
  • LinkedIn — linkedin.com/company/q4usdev
  • X (Twitter) — @Q4USdev

License

MIT — see LICENSE. Copyright © 2026 Q4US.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft