hygen-oja-generators

2.0.11 • Public • Published

hygen-oja-generators

Downloads

The module provides hygen generators for eBay Oja framework and more specifically for Action layer.

This module is a subset of .

Given the fact that all actions have the same style and API, we now can use a simple code generation based on hygen to speed up action creation, including generation of unit tests for the new action using jest test framework.

Installation

npm install hygen hygen-add -g
hygen-add oja-generators

Usage

hygen <command>
# or for help just type 
hygen

Steps

Init oja

$ hygen oja init

Add action

$ hygen action new <ACTION_NAMESPACE> [--target {output dir}] [--mocha]

Note: By default command will generate jest unit tests, if you need mocha tests, you can use --mocha option

Example:

# New action generation
# will generate a new action with jest tests
$ hygen action new selling/actions/buy --target src/selling

# will generate a new action with mochs tests
$ hygen action new selling/actions/buy --target src/selling --mocha

# Run unit tests
npm run test:actions
# Run test coverage
npm run test:actions:coverage

Package Sidebar

Install

npm i hygen-oja-generators

Weekly Downloads

1

Version

2.0.11

License

MIT

Unpacked Size

29.9 kB

Total Files

18

Last publish

Collaborators

  • dimichgh