Home

Awesome

Jasmine unit test generator

Travis CI build

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

Supported types:

Preview

Basic input/output example:

Basic

With custom event bus service dependency handler:

With custom event service dependency handler

Usage

Installation

run npm i jasmine-unit-test-generator

Basic

run jasmine-unit-test-generator <path-to-file>

With custom dependency handlers:

run jasmine-unit-test-generator --handlers <path-to-handlers-dir> <path-to-file>

With dependency handlers written in typescript:

install ts-node

run jasmine-unit-test-generator --require ts-node/register --handlers <path-to-handlers-dir> <path-to-file>

At the moment argument order is important!

And note that if you install generator globally, ts-node must be installed globally as well. Otherwise both need to be installed locally in the project.

Dependency handlers

You can extend formatting of resulting spec files for each dependency by making a dependency handler. See default-dependency-handler.ts and event-bus.service.handler.ts

It is possible to add extra declarations, initializers and dependencies.

Development

It's probably best to:

Alternavely, you can:

Release

run npm run build

run npm publish