Skip to content

Commit 5e7b89d

Browse files
justinweathersbyfranciscocardoso
authored andcommitted
Add support for numbers to be in callback assert custom class
1 parent d105b9c commit 5e7b89d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/asserts/callback-assert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const { Violation } = require('validator.js');
1111
* Constants.
1212
*/
1313

14-
const expression = /^[a-zA-Z]+$/;
14+
const expression = /^[a-zA-Z\d]+$/;
1515

1616
/**
1717
* Export `CallbackAssert`.

test/asserts/callback-assert.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('CallbackAssert', () => {
2929
});
3030

3131
it('should throw an error if `customClass` is invalid', () => {
32-
['foo bar', 'foo 1', '1', '{}', 1].forEach(customClass => {
32+
['foo bar', 'foo 1', '%', '{}'].forEach(customClass => {
3333
try {
3434
Assert.callback(value => value === 'foobiz', customClass).validate('foobar');
3535
} catch (e) {

0 commit comments

Comments
 (0)