UNPKG

arb-convert

Version:

Convert Application Resource Bundle (ARB) translation files to other translation formats and back

15 lines (14 loc) 787 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var parseLocale_1 = __importDefault(require("../parseLocale")); test('locales are parsed correctly from strings', function () { expect(parseLocale_1.default()).toBeUndefined(); expect(parseLocale_1.default(undefined)).toBeUndefined(); expect(parseLocale_1.default('nothing valid')).toBeUndefined(); expect(parseLocale_1.default('de_DE')).toBe('de-DE'); expect(parseLocale_1.default('some string with a en-US locale inside')).toBe('en-US'); expect(parseLocale_1.default('multiple', 'candidates', 'it-IT', 'this is not matched')).toBe('it-IT'); });