{"size": 777, "ext": "js", "max_stars_repo_path": "src/isEmail.test.js", "max_stars_repo_name": "tsevdos/validatus", "max_stars_repo_stars_event_min_datetime": "2019-11-20T23:38:07.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-22T13:15:38.000Z", "max_issues_repo_path": "src/isEmail.test.js", "max_issues_repo_name": "tsevdos/validatus", "max_issues_repo_issues_event_min_datetime": "2020-01-15T15:40:49.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T12:17:19.000Z", "max_forks_repo_path": "src/isEmail.test.js", "max_forks_repo_name": "tsevdos/validatus", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 13, "max_forks_count": null, "avg_line_length": 37.0, "max_line_length": 59, "alphanum_fraction": 0.6306306306}
import { isEmail } from "./isEmail";

describe("isEmail", () => {
  it("returns true if email is valid", () => {
    expect(isEmail("john@gmail.com")).toEqual(true);
    expect(isEmail("john@test.co")).toEqual(true);
    expect(isEmail("JOHN@test.com")).toEqual(true);
    expect(isEmail("JOHN@GMAIL.CO")).toEqual(true);
    expect(isEmail("john123@gmail123.com")).toEqual(true);
    expect(isEmail("j1oh2n@gm3ai4l.com")).toEqual(true);
  });

  it("returns false if not email", () => {
    expect(isEmail("john")).toEqual(false);
    expect(isEmail("john@gmail")).toEqual(false);
    expect(isEmail("john@gmail.c")).toEqual(false);
    expect(isEmail("j1oh2n@gm3ai4l.123")).toEqual(false);
    expect(isEmail("j1oh2n@gm3ai4l.1")).toEqual(false);
  });
});
