-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve test specs and parallel logic.
- Loading branch information
Showing
10 changed files
with
269 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var expect = require('chai').expect | ||
, mktask = require('../../index'); | ||
|
||
describe('mktask:', function() { | ||
|
||
it('should get default task collection', function(done) { | ||
// static task() method | ||
var res = mktask.task(); | ||
expect(res).to.be.an('object'); | ||
done(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var expect = require('chai').expect | ||
, mktask = require('../../index'); | ||
|
||
describe('mktask:', function() { | ||
|
||
it('should get file write destination stream', function(done) { | ||
var res = mktask.dest('target/foo.txt'); | ||
expect(res).to.be.an('object'); | ||
done(); | ||
}); | ||
|
||
it('should get default destination stream', function(done) { | ||
var res = mktask.dest(); | ||
expect(res).to.be.an('object'); | ||
done(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
var expect = require('chai').expect | ||
, mktask = require('../../index'); | ||
|
||
describe('mktask:', function() { | ||
|
||
it('should iterate task function (each)', function(done) { | ||
var mk = mktask() | ||
, called = 0; | ||
|
||
function readme(cb) { | ||
called++; | ||
cb(); | ||
} | ||
|
||
mk.task(readme); | ||
|
||
var runner = mk.run(); | ||
runner.each([readme.name], function() { | ||
expect(called).to.eql(1); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should iterate all task functions (each)', function(done) { | ||
var mk = mktask() | ||
, called = 0; | ||
|
||
function api(cb) { | ||
called++; | ||
cb(); | ||
} | ||
|
||
function readme(cb) { | ||
called++; | ||
cb(); | ||
} | ||
|
||
mk.task(api); | ||
mk.task(readme); | ||
|
||
var runner = mk.run(); | ||
runner.each(function() { | ||
expect(called).to.eql(2); | ||
done(); | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.