Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change assert function for correct test cases #277

Closed
diegonvs opened this issue Oct 16, 2017 · 2 comments
Closed

Change assert function for correct test cases #277

diegonvs opened this issue Oct 16, 2017 · 2 comments

Comments

@diegonvs
Copy link
Contributor

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.

@diegonvs
Copy link
Contributor Author

pr: #278

@robframpton
Copy link

#278 merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants