Merge branch 'julius-dev' of Software_Engineering_I/greenvironment-server into master
commit
80cc35d601
@ -0,0 +1,20 @@
|
|||||||
|
import {expect} from "chai";
|
||||||
|
import {describe, it} from "mocha";
|
||||||
|
import {is} from "../../lib/regex";
|
||||||
|
|
||||||
|
describe("regex", () => {
|
||||||
|
describe("email", () => {
|
||||||
|
it("identifies right emails", () => {
|
||||||
|
const result = is.email("trivernis@mail.com");
|
||||||
|
expect(result).to.equal(true);
|
||||||
|
});
|
||||||
|
it("identifies non-email urls", () => {
|
||||||
|
const result = is.email("notanemail.com");
|
||||||
|
expect(result).to.equal(false);
|
||||||
|
});
|
||||||
|
it("identifies malformed emails", () => {
|
||||||
|
const result = is.email("trivernis@mail.");
|
||||||
|
expect(result).to.equal(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue