Skip to content

Commit e16813b

Browse files
author
Rodrigo Solis
committed
update dependencies
1 parent 37faffc commit e16813b

File tree

5 files changed

+6320
-4825
lines changed

5 files changed

+6320
-4825
lines changed

.eslintrc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ module.exports = {
55
sourceType: 'module'
66
},
77
env: {
8-
browser: true
8+
browser: true,
9+
jest: true
910
},
1011
extends: 'airbnb-base',
1112
rules: {

tests/proxy-validator.js __tests__/proxy-validator.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import ProxyValidator from '../src/index';
2-
import { ValidationError } from '../src/error';
1+
import ProxyValidator from '../src/index';
2+
import ValidationError from '../src/error';
33

44
const validators = {
55
name: {
@@ -10,8 +10,8 @@ const validators = {
1010
errorMessage: 'Minimum length 6 characters.'
1111
},
1212
isUppercase: true,
13-
isAlphanumeric: true,
14-
},
13+
isAlphanumeric: true
14+
}
1515
};
1616

1717
const sanitizers = {
@@ -20,13 +20,13 @@ const sanitizers = {
2020
}
2121
};
2222

23+
const ContactValidator = ProxyValidator(validators, sanitizers);
24+
const contact = ContactValidator();
25+
2326
function assignName(name) {
2427
contact.name = name;
2528
}
2629

27-
const ContactValidator = ProxyValidator(validators, sanitizers);
28-
const contact = ContactValidator();
29-
3030
test('one validation rule fails', () => {
3131
expect(() => assignName('MIKE')).toThrow(ValidationError);
3232
});
@@ -52,7 +52,3 @@ test('validation succeed w/ sanitizing', () => {
5252
assignName(' MICHAEL');
5353
expect(contact.name).toBe('MICHAEL');
5454
});
55-
56-
57-
58-

0 commit comments

Comments
 (0)