describe('Email validator', function() {
    let Email = require('../../validators/email');
    let validEmail = 'test@example.com';
    let invalidEmail = 'test@';
    let attribute = 'email';

    it('Valid email', () => {
        let model = {};
        model[attribute] = validEmail;
        let errors = {};
        let validator = new Email(attribute, {
            model,
            errors,
        });
        validator
            .validate()
            .then(res => {
                expect(res).toBe(validEmail);
                expect(errors[attribute]).toBeUndefined();
                done();
            })
            .catch(err => {});
    });

    it('Invalid email', (done) => {
        let model = {};
        model[attribute] = invalidEmail;
        let errors = {};
        let validator = new Email(attribute, {
            model,
            errors,
        });
        validator.validate().then(res => {}, err => {
            expect(errors.email[0]).toBe('{attribute} is not a valid email address.');
            done();
        });
    });
});

@@ -964,14 +964,19 @@
 rors
-.email
+%5Battribute%5D
 %5B0%5D)

Refactor email test