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

tests: fix assert.throws() usage #1468

Merged
merged 1 commit into from
Aug 16, 2016

Conversation

stephenplusplus
Copy link
Contributor

So, I was using mocha wrong in regards to testing thrown errors.

Wrong:

assert.throw(function() {
  new Bucket();
}, 'You need a name for this bucket.'); // <-- not the real error message

Right:

assert.throw(function() {
  new Bucket();
}, /You need a name for this bucket\./); // <-- not the real error message

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 5, 2016
@coveralls
Copy link

coveralls commented Aug 5, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 5c4191a on stephenplusplus:spp--throwing-regex into 143f120 on GoogleCloudPlatform:master.

@stephenplusplus
Copy link
Contributor Author

@callmehiphop how's this one look?

@callmehiphop callmehiphop merged commit 3cfc68c into googleapis:master Aug 16, 2016
@callmehiphop
Copy link
Contributor

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants