Skip to content

Commit

Permalink
fix cli crash introduced in #1830
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkettner committed Jan 15, 2016
1 parent 95fdd83 commit 2d54fd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/modernizr
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ if (argv.o || argv.f) {
.replace(/-/g, ',')
.split(',')
.map(function(prop) {
var obj = _.findWhere(source, {property: prop});
var obj = _.find(source, {property: prop});

if (_.isUndefined(obj)) {
throw new Error('invalid key value name - ' + prop);
Expand Down
5 changes: 5 additions & 0 deletions test/node/lib/cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var root = require('find-parent-dir').sync(__dirname, 'package.json');
var expect = require('expect.js');
var cp = require('child_process');
var Modernizr = require(root + 'lib/cli');


Expand All @@ -13,4 +14,8 @@ describe('cli', function() {
expect(Modernizr.metadata).to.be.a('function');
});

it('does not throw when being executed', function(done) {
cp.exec('node ' + root + '/bin/modernizr -f adownload', done);
});

});

0 comments on commit 2d54fd7

Please sign in to comment.