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

Duns.assert should be able to take a message #49

Open
br0r opened this issue Jul 14, 2015 · 1 comment
Open

Duns.assert should be able to take a message #49

br0r opened this issue Jul 14, 2015 · 1 comment
Labels

Comments

@br0r
Copy link
Contributor

br0r commented Jul 14, 2015

Duns.assert('ninja', Duns.number(), 'Not a valid number');
// Error{name: 'Duns Error', message: 'Not a valid number'}

Otherwise you would have to do this in tests:

try {
  Duns.assert('ninja', Duns.number());
} catch (err) {
  throw new Error('Invalid number');
}

Kind of defeats the purpose with .assert

@br0r br0r added the Idea label Jul 14, 2015
@silfverstrom
Copy link
Member

+1

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

No branches or pull requests

2 participants