UNPKG

digipinjs

Version:

A comprehensive TypeScript library for encoding and decoding Indian geographic coordinates into DIGIPIN format (Indian Postal Digital PIN system). Features CLI tools, caching, batch processing, and Express middleware for seamless integration.

20 lines (19 loc) 885 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const chai_1 = require("chai"); const errors_1 = require("../errors"); describe('Validation Suggestions', () => { it('suggests corrections for common typos', () => { const error = new errors_1.InvalidCharacterError('O'); (0, chai_1.expect)(error.message).to.include("Did you mean '0'?"); }); it('suggests corrections for another typo', () => { const error = new errors_1.InvalidCharacterError('1'); (0, chai_1.expect)(error.message).to.include("Did you mean 'J'?"); }); it('does not suggest for unknown typos', () => { const error = new errors_1.InvalidCharacterError('X'); (0, chai_1.expect)(error.message).to.not.include("Did you mean"); (0, chai_1.expect)(error.message).to.equal("Invalid character 'X' in DIGIPIN"); }); });