Skip to content

Commit

Permalink
use nodeback/errback
Browse files Browse the repository at this point in the history
  • Loading branch information
bengl committed Jun 20, 2016
1 parent 7101c77 commit 26ffc6f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bin/license-checker
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if (args.version) {
process.exit(1);
}

checker.init(args, function(json, err) {
checker.init(args, function(err, json) {

var formattedOutput = '';

Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ exports.init = function(options, callback) {
}

//Return the callback and variables nicely
callback(filtered, inputError);
callback(inputError, filtered);
});
};

Expand Down
24 changes: 12 additions & 12 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('main tests', function() {
before(function(done) {
checker.init({
start: path.join(__dirname, '../')
}, function (sorted) {
}, function (err, sorted) {
output = sorted;
done();
});
Expand Down Expand Up @@ -55,7 +55,7 @@ describe('main tests', function() {
checker.init({
start: path.join(__dirname, '../'),
customFormat: format
}, function (sorted) {
}, function (err, sorted) {
output = sorted;
done();
});
Expand Down Expand Up @@ -96,7 +96,7 @@ describe('main tests', function() {
checker.init({
start: path.join(__dirname, '../'),
unknown: true
}, function (sorted) {
}, function (err, sorted) {
output = sorted;
done();
});
Expand All @@ -114,7 +114,7 @@ describe('main tests', function() {
checker.init({
start: path.join(__dirname, '../'),
exclude: "MIT, ISC"
}, function (filtered) {
}, function (err, filtered) {
output = filtered;
done();
});
Expand All @@ -135,7 +135,7 @@ describe('main tests', function() {
checker.init({
start: path.join(__dirname, '../'),
development: true
}, function (sorted, err) {
}, function (err) {
assert.equal(err, null);
done();
});
Expand All @@ -144,7 +144,7 @@ describe('main tests', function() {
it('should init with errors (npm packages not found)', function(done) {
checker.init({
start: 'C:\\'
}, function (sorted, err) {
}, function (err) {
assert.ok(util.isError(err));
done();
});
Expand Down Expand Up @@ -190,7 +190,7 @@ describe('main tests', function() {
'description': '<<Default Description>>',
'pewpew': '<<Should Never be set>>'
}
}, function (d) {
}, function (err, d) {
Object.keys(d).forEach(function(item) {
assert.notEqual(d[item].name, undefined);
assert.notEqual(d[item].description, undefined);
Expand All @@ -211,7 +211,7 @@ describe('main tests', function() {
process.argv.pop();
process.argv.pop();

checker.init(args, function (filtered) {
checker.init(args, function (err, filtered) {
var customFormatContent = fs.readFileSync(path.join(__dirname, './../customFormatExample.json'), 'utf8');

assert.notEqual(customFormatContent, undefined);
Expand All @@ -236,7 +236,7 @@ describe('main tests', function() {
it('as absolute paths', function (done) {
checker.init({
start: path.join(__dirname, '../')
}, function (output) {
}, function (err, output) {
Object.keys(output).map(function (key) {
return output[key];
}).filter(function (dep) {
Expand All @@ -254,7 +254,7 @@ describe('main tests', function() {
checker.init({
start: path.join(__dirname, '../'),
relativeLicensePath: true
}, function (filtered) {
}, function (err, filtered) {
Object.keys(filtered).map(function (key) {
return filtered[key];
}).filter(function (dep) {
Expand All @@ -273,7 +273,7 @@ describe('main tests', function() {
checker.init({
start: path.join(__dirname, '../'),
onlyunknown: true
}, function (sorted) {
}, function (err, sorted) {
output = sorted;
done();
});
Expand All @@ -300,7 +300,7 @@ describe('main tests', function() {
checker.init({
start: path.join(__dirname, '../'),
production: true
}, function (sorted) {
}, function (err, sorted) {
output = sorted;
done();
});
Expand Down

0 comments on commit 26ffc6f

Please sign in to comment.