Home

Awesome

JestTestGen

badgenpm badgenpm

🚀 Try jest-test-gen as a VS Code Extension

The VS Code extension is the fastest way to generate a unit test file from a source file directly from the IDE

Install jest-test-gen Extension

About

Automates creation of initial unit test files taking dependencies into account.

Parsing and test generation is avaialable for the following exports:

This tool will take a js/ts file as input and generate a jest unit test file next to it with all imports mocked and tests stubs for every class method and function exported.

This project is inspired and started as a fork of jasmine-unit-test-generator

Preview

Basic ES6 Class example:

Basic

React Component example:

ReactComponent

Usage

Installation

run npm i -g jest-test-gen

Basic Usage

run jest-test-gen <path-to-file>

Development

It's probably best to:

Alternavely, you can:

Release

run npm run build run npm publish