UNPKG

@stacrypt/world-countries-info

Version:

List of countries with useful info, and search functions

30 lines (29 loc) 936 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var getCountryByDialCode_1 = __importDefault(require("./getCountryByDialCode")); var IR = { alpha2: "IR", alpha3: "IRN", name: { en: "Iran", fa: "ایران", }, dialCode: "+98", svgUrl: "/c/ca/Flag_of_Iran.svg", emoji: "🇮🇷", unicode: "U+1F1EE U+1F1F7", numericCode: "364", }; test("getCountryByDialCode tests", function () { var queries = ["+98", "98", 98]; var wrongQueries = ["1000", 1000, "abc"]; queries.forEach(function (query) { expect(getCountryByDialCode_1.default(query)).toStrictEqual(IR); }); wrongQueries.map(function (wrongQuery) { expect(getCountryByDialCode_1.default(wrongQuery)).toBe(undefined); }); });