-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Add and improve code coverage
- Loading branch information
Showing
6 changed files
with
70 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
lib-cov | ||
*.seed | ||
# Logs | ||
logs | ||
*.log | ||
*.csv | ||
*.dat | ||
*.out | ||
*.pid | ||
*.gz | ||
|
||
# Runtime data | ||
pids | ||
logs | ||
results | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
npm-debug.log | ||
# Dependency directory | ||
# Deployed apps should consider commenting this line out: | ||
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git | ||
node_modules |
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,3 @@ | ||
'use strict'; | ||
|
||
require('require-dir')('../'); |
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,17 @@ | ||
'use strict'; | ||
|
||
var test = require('tap').test; | ||
|
||
var getExtensions = require('../lib/helpers').getExtensions; | ||
|
||
test('should return the argument if it is an object', function(t){ | ||
var obj = {}; | ||
t.equal(getExtensions(obj), obj, 'should be the same object'); | ||
t.end(); | ||
}); | ||
|
||
test('should return a new object if argument is not an object', function(t){ | ||
var fn = function(){}; | ||
t.deepEqual(getExtensions(fn), {}, 'should be an object'); | ||
t.end(); | ||
}); |
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,23 @@ | ||
'use strict'; | ||
|
||
var test = require('tap').test; | ||
|
||
var onSettled = require('../lib/helpers').onSettled; | ||
|
||
var errors = [ | ||
{ state: 'error', value: new Error('Error 1') }, | ||
{ state: 'error', value: new Error('Error 2') } | ||
]; | ||
|
||
test('should group all errors', function(t){ | ||
onSettled(function(errs, results){ | ||
t.equal(errs.length, 2, 'errors should contain both errors'); | ||
t.notOk(results, 'results should contain nothing'); | ||
t.end(); | ||
})(null, errors); | ||
}); | ||
|
||
test('should handle the no callback case', function(t){ | ||
onSettled()(null, errors); | ||
t.end(); | ||
}); |