Skip to content

Commit f0b0f61

Browse files
committedNov 9, 2015
repro; #3554
1 parent 73de49c commit f0b0f61

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎test/updateValidators.unit.test.js

+15
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,20 @@ describe('updateValidators', function() {
5353
done();
5454
});
5555
});
56+
57+
it('doesnt flatten empty arrays (gh-3554)', function(done) {
58+
var fn = updateValidators({}, schema, { test: [] }, {});
59+
schema.doValidate.emitter.on('called', function(args) {
60+
args.cb();
61+
});
62+
fn(function(err) {
63+
assert.ifError(err);
64+
assert.equal(schema._getSchema.calls.length, 1);
65+
assert.equal(schema.doValidate.calls.length, 1);
66+
assert.equal('test', schema._getSchema.calls[0]);
67+
assert.deepEqual(schema.doValidate.calls[0].v, []);
68+
done();
69+
});
70+
});
5671
});
5772
});

0 commit comments

Comments
 (0)
Please sign in to comment.