Skip to content

Commit

Permalink
Assert on task files.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpfs committed Mar 19, 2016
1 parent 52322f3 commit 1ff57ef
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ function task() {
if(!tasks) {
tasks = mk();
}

if(!arguments.length) {
return tasks;
}

return tasks.task.apply(tasks, arguments);
}

Expand Down
4 changes: 0 additions & 4 deletions test/fixtures/anonymous-error.js

This file was deleted.

File renamed without changes.
19 changes: 19 additions & 0 deletions test/spec/single-task.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var expect = require('chai').expect
, mktask = require('../../index')

require('../fixtures/single-task');

describe('mktask:', function() {

it('should exec single task in file', function(done) {
var mk = mktask.task();
var runner = mk.run();
expect(mk).to.be.an('object');
expect(mk.tasks).to.be.an('array')
.to.have.length(1);
runner.exec('readme', function() {
done();
});
});

});

0 comments on commit 1ff57ef

Please sign in to comment.