hygen-oja-generators
v2.0.11
Published
Module provides basic generators for backend and front-end
Downloads
16
Maintainers
Readme
hygen-oja-generators
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