UNPKG

french-ssn

Version:

🇫🇷 A parser / validator for French Social Security Number

31 lines • 1.08 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const addApproximateAge_1 = __importDefault(require("./addApproximateAge")); it("adds approximate age", () => { Date.now = jest.fn(() => new Date("2018-01-02").valueOf()); const data = { birth: { approximateDate: new Date("1980-01-01"), }, }; (0, addApproximateAge_1.default)(data); // @ts-ignore FIXME expect(data.approximateAge).toBe(38); }); describe("birthDate is soon to come", () => { it("adds approximate age", () => { Date.now = jest.fn(() => new Date("2018-01-02").valueOf()); const data = { birth: { approximateDate: new Date("1980-02-01"), }, }; (0, addApproximateAge_1.default)(data); // @ts-ignore FIXME expect(data.approximateAge).toBe(37); }); }); //# sourceMappingURL=addApproximateAge.test.js.map