Skip to content

Commit

Permalink
add test for no name passed to build
Browse files Browse the repository at this point in the history
  • Loading branch information
doowb committed Jan 27, 2016
1 parent 6d60950 commit a12d79b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ describe('composer', function() {
composer.task();
done(new Error('Expected an error to be thrown'));
} catch (err) {
assert(err);
assert.equal(err.message, 'expected `name` to be a string');
done();
}
});
Expand Down Expand Up @@ -99,6 +101,20 @@ describe('composer', function() {
});
});

it('should run the `default` task when no task is given', function(done) {
var count = 0;
composer.task('default', function(cb) {
count++;
cb();
});

composer.build(function(err) {
if (err) return done(err);
assert.equal(count, 1);
done();
});
});

it('should throw an error when a task with unregistered dependencies is built', function(done) {
var count = 0;
composer.task('default', ['foo', 'bar'], function(cb) {
Expand Down

0 comments on commit a12d79b

Please # to comment.