I think testing a generator can be a little headache. Sure there's missing documentation, but also, it requires a lot of boilerplate code.
For example, my usual setup for testing a config in Generator-BBB looks like this:
before(function (done) {
helpers.testDirectory(path.join(__dirname, "temp"), function() {
this.app = helpers.createGenerator("bbb:app", [
path.join(__dirname, "../lib/generators/app")
]);
this.app.options["skip-install"] = true;
helpers.mockPrompt(this.app);
this.app.run({}, function () { done(); });
}.bind(this));
});
I believe we should refactor our testing methods to be friendlier to use. I'd suggest this API:
before(function (done) {
helpers
.run('../app/index.js')
.inDir('./temp')
.withArguments('foo')
.withOptions({ 'skip-install' : true })
.withPrompt({ bootstrap: false })
.then(done);
});
I think testing a generator can be a little headache. Sure there's missing documentation, but also, it requires a lot of boilerplate code.
For example, my usual setup for testing a config in Generator-BBB looks like this:
I believe we should refactor our testing methods to be friendlier to use. I'd suggest this API: