polish-validators
Version:
A set of validator functions that check common polish numbers.
23 lines (22 loc) • 1.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const imei_1 = require("./imei");
describe('IMEI', () => {
describe('isImeiValid', () => {
it('should return true for a valid 15-digit IMEI', () => {
expect((0, imei_1.isImeiValid)('490154203237518')).toBe(true);
});
it('should return true for a valid IMEI with dashes, slashes, and whitespace', () => {
expect((0, imei_1.isImeiValid)('49-015420 32375/18')).toBe(true);
});
it('should return false for an IMEI with less than 15 digits', () => {
expect((0, imei_1.isImeiValid)('49015420323751')).toBe(false);
});
it('should return false for an IMEI with more than 15 digits', () => {
expect((0, imei_1.isImeiValid)('4901542032375189')).toBe(false);
});
it('should return false for an IMEI containing non-digit characters', () => {
expect((0, imei_1.isImeiValid)('49015420323751a')).toBe(false);
});
});
});