UNPKG

@deposits/validators

Version:

A collection of Fintech-specific and general-purpose validators, designed to extend popular validation libraries like Vuelidate, Zod, and yup.

17 lines (14 loc) 447 B
import { ein } from "./index.js"; import { expect, test, describe } from "@jest/globals"; describe("ein", () => { test("Test valid EINs", () => { expect(ein("12-3456789")).toBe(true); expect(ein("98-7654321")).toBe(true); }); test("Test invalid EINs", () => { expect(ein("abc")).toBe(false); expect(ein("98-754321")).toBe(false); expect(ein("987-54321")).toBe(false); expect(ein("98754321")).toBe(false); }); });