text: const EmailValidator = require('./email-validator')
  const validator = require('validator')
  
  const makeSut = () => {
    return new EmailValidator()
  }
  
  describe('Email Validator', () => {
    test('Should return true if validator returns true', () => {
      const stu = makeSut()
      const isEmailValid = stu.isValid('valid_email@gmail.com')
      expect(isEmailValid).toBe(true)
    })
  
    test('Should return false if validator returns false', () => {
      validator.isEmailValid = false
      const stu = makeSut()
      const isEmailValid = stu.isValid('invalid_email@gmail.com')
      expect(isEmailValid).toBe(false)
    })
  
    test('Should call validator with correct email', () => {
      const stu = makeSut()
      stu.isValid('any_email@gmail.com')
      expect(validator.email).toBe('any_email@gmail.com')
    })
  })
  