Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wix-incubator/namoey
Yeoman generator tester
https://github.com/wix-incubator/namoey
generator testing-tools yeoman
Last synced: 2 months ago
JSON representation
Yeoman generator tester
- Host: GitHub
- URL: https://github.com/wix-incubator/namoey
- Owner: wix-incubator
- License: mit
- Created: 2016-07-17T10:56:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-13T08:53:21.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T17:35:57.929Z (3 months ago)
- Topics: generator, testing-tools, yeoman
- Language: JavaScript
- Size: 105 KB
- Stars: 4
- Watchers: 158
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
namoey
[![Build Status](https://travis-ci.org/wix/namoey.svg?branch=master)](https://travis-ci.org/wix/namoey)
> Yeoman generators tester`namoey` (yeoman spelled backwards) runs your generator and some additional shell scripts in a sandbox to make sure your generated projects won't fail at start.
The idea here is to check if the generated project generated correctly - not by the files, but by their functionality. For example, you may include some dummy tests in your generator. To make sure they are working correctly, you can run the test runner manually, or automate this process with `nemoey`.
## Install
```console
npm install namoey --save
```## Simple usage
```javascript
const namoey = require('namoey');
const generatorWebapp = require('./generators/app');// Basic settings
const test = namoey({silent: true})
.setGenerators([{namespace: 'webapp:app', generator: generatorWebapp}]) // Make sure to add sub-generator for composability
.setPrompts({name: 'my-cool-project', description: 'awesome stuff'})
.setArgs('my-app')
.setOptions({coffescript: true});// Those shell commands will be run after yeoman is done
test.setShellCommands([
'npm install',
'npm run build && npm run test'
]);// Start the madness
const runner = test.createRunner();
runner.run('webapp:app').then(() => { ... }).catch((err) => { ... });// If you care about logging, you can tag a runner
// by simply providing a tag string. The following example
// will print something like this for each log made
// by a shell script:
// `----->[NAMOEY:'second run']`
runner.run('webapp:app', 'second run');
```### Notes:
- Avoid `&&`, `||` and `&` in a shell command to improve debugging.
- You can `cd` inside a shell command, just make sure to stay within the generated location