-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Description
I'm reviewing the tests on validators and i’ve saw a problem that the usage of assert.ok() is probably not adequate in our tests, maybe we can use assert.isTrue().
Taking this hypothesis:
it('should validate any type', function() {
const validator = validators.any();
assert.ok(validator('testString'));
assert.ok(validator(false));
assert.ok(validator({}));
assert.ok(validator(1));
assert.ok(validator(function() {}));
assert.ok(new Error(“something”));
});
If validators.any() function is broken, these tests will pass no matter what that function returns (unless it returns false - which we never return). I suggest we change from assert.ok to assert.isTrue to verify cases that passes/corrects.
Metadata
Metadata
Assignees
Labels
No labels