Skip to content

Commit

Permalink
test: add test for --packages flag
Browse files Browse the repository at this point in the history
  • Loading branch information
codepunkt committed Jul 19, 2018
1 parent 0f53922 commit ed25d68
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/packages-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var assert = require('assert'),
path = require('path'),
spawn = require('child_process').spawn,
restrictedPackages = [
'[email protected]',
'[email protected]',
'[email protected]',
];

describe('bin/license-checker', function() {
this.timeout(8000);

it('should restrict the output to the provided packages', function(done) {
var node = spawn('node', [path.join(__dirname, '../bin/license-checker'), '--json', '--packages', restrictedPackages.join(';')], {
cwd: path.join(__dirname, '../'),
});

node.stdout.on('data', function(data) {
assert.deepEqual(Object.keys(JSON.parse(data.toString())), restrictedPackages);
done();
});
});
});

0 comments on commit ed25d68

Please sign in to comment.