Skip to content
Mickael Daniel edited this page Jan 16, 2013 · 1 revision

test-generators

Generators

yeoman.generators

should have a Base object to extend from.

assert.ok(generators.Base);

should have a NamedBase object to extend from.

assert.ok(generators.NamedBase);

yeoman.generators.Base

should be an EventEmitter.

assert.ok(this.generator instanceof events.EventEmitter);
assert.ok(typeof this.generator.on === 'function');
assert.ok(typeof this.generator.emit === 'function');
this.generator.on('yay-o-man', done);
this.generator.emit('yay-o-man');

yeoman.generators.NamedBase

should be a Base generator.

assert.ok(this.generator instanceof generators.Base);

and it should have a name property.

assert.equal(this.generator.name, 'namedArg');
Clone this wiki locally