Skip to content

Commit

Permalink
Add test for when there are no packages (plugin)
Browse files Browse the repository at this point in the history
This adds a test to the plugin generator for when no packages are provided.
  • Loading branch information
matthewp committed Mar 30, 2017
1 parent 607ddd1 commit 95d87c3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/plugin.test.js
Expand Up @@ -34,7 +34,7 @@ describe('generator-donejs:plugin', function () {

child.on('exit', function (status) {
assert.equal(status, 0, 'Got correct exit status');

child = exec('npm run build', {
cwd: tmpDir
});
Expand Down Expand Up @@ -92,4 +92,19 @@ describe('generator-donejs:plugin', function () {
done();
});
});

it('fails if there are no packages', function(done) {
helpers.run(path.join(__dirname, '../plugin'))
.withOptions({
packages: null,
skipInstall: true
})
.withPrompts({
name: 'my-plugin'
})
.on('error', function(err){
assert(true, 'An error for not providing packages');
done();
});
});
});

0 comments on commit 95d87c3

Please sign in to comment.