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

QUnit - Test Generator

q4usdev

|
1 install
| (0) | Free
Automatically generate high-quality unit and integration tests for Moleculer.js microservices 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 Moleculer.js

Qunit generates unit and integration tests for Moleculer.js microservices using Google's Gemini AI. It proposes a test plan for each function, writes Mocha/Sinon/Chai tests into the matching spec file, runs them, and repairs the ones that fail.

Everything runs on your machine with your own Gemini API key. There is no account, no login, and no backend server.

Features

  • Function detection — finds service actions, methods, and standalone functions in your TypeScript files and shows a "Generate Test" CodeLens above each one.
  • Test planning — Gemini proposes scenarios grouped as Critical, Logical, Error, and Edge. You choose which ones to generate.
  • Deep mocking — stubs broker.call() for inter-service calls and database queries, so tests run without external services.
  • Merging into existing tests — new tests are added to the existing spec file without overwriting what is already there.
  • Auto-validation and repair — generated tests run immediately; failures are analyzed and a fix is generated automatically.
  • Sidebar — a Qunit view in the activity bar lists detected functions, statistics, and generation history.

Requirements

  • VS Code 1.85 or later
  • A Moleculer.js project written in TypeScript, with Mocha, Sinon, and Chai installed
  • A Gemini API key — free from Google AI Studio

Getting started

  1. Install the extension. It asks for your Gemini API key the first time it activates.
  2. Open a TypeScript file in your project, such as a .service.ts file.
  3. Click Generate Test above a function.
  4. Select the scenarios you want from the proposed test plan.
  5. Qunit writes the tests to the matching spec file (src/foo.ts → test/foo.spec.ts) and runs them.

To set or change the key later, use the API Key panel in the Qunit sidebar or the Qunit: Set Gemini API Key command.

Commands

Command Description
Qunit: Generate Unit Tests for Active File Generate tests for the file in the active editor
Qunit: Set Gemini API Key Set or replace the stored API key
Clear Gemini API Key Remove the stored API key

Settings

Setting Default Description
ai-test-generator.autoValidateTests true Run generated tests and fix failures automatically
ai-test-generator.maxFixAttempts 3 Maximum number of attempts to fix failing tests (1–5)
ai-test-generator.testCommand npm test Command used to run tests

Privacy

  • Your API key is stored with VS Code's SecretStorage, which is backed by the OS keychain.
  • Source code for the function under test is sent to the Gemini API to generate tests. It is sent nowhere else.
  • Generation history is stored locally in .qunit/history.json in your workspace. You may want to add .qunit/ to .gitignore.

License

MIT — see LICENSE.

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