{"size": 689, "ext": "js", "max_stars_repo_path": "src/test/verifyEmail.js", "max_stars_repo_name": "meiremans/mailCollectorApi", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/test/verifyEmail.js", "max_issues_repo_name": "meiremans/mailCollectorApi", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/test/verifyEmail.js", "max_forks_repo_name": "meiremans/mailCollectorApi", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 36.2631578947, "max_line_length": 162, "alphanum_fraction": 0.6603773585}
import { describe, it } from 'mocha';
import chai from 'chai';
import { verifyEmail } from '../modules';

const { expect } = chai;

const verifiedEmails = ['bob123@gmail.com', 'gibson@yahoo.com', '23stacys14Mom@nyc.rr.com'];
const fakeEmails = ['fake input', 'test', 'j203f02', '_DJ*@(#', 'gmail @com.gmail', 'emailWithComma,@gmail.com', ',anotherCommaEmail@test.com', 'test@gmail,com'];

describe('verifyEmail', () => {
  it('should validate valid emails', () => {
    verifiedEmails.forEach(email => expect(verifyEmail(email)).to.equal(true));
  });

  it('should invalidate invalid emails', () => {
    fakeEmails.forEach(email => expect(verifyEmail(email)).to.equal(false));
  });
});
