Skip to content

Commit

Permalink
repro; #3554
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Nov 9, 2015
1 parent 73de49c commit f0b0f61
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/updateValidators.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,20 @@ describe('updateValidators', function() {
done();
});
});

it('doesnt flatten empty arrays (gh-3554)', function(done) {
var fn = updateValidators({}, schema, { test: [] }, {});
schema.doValidate.emitter.on('called', function(args) {
args.cb();
});
fn(function(err) {
assert.ifError(err);
assert.equal(schema._getSchema.calls.length, 1);
assert.equal(schema.doValidate.calls.length, 1);
assert.equal('test', schema._getSchema.calls[0]);
assert.deepEqual(schema.doValidate.calls[0].v, []);
done();
});
});
});
});

0 comments on commit f0b0f61

Please sign in to comment.