Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("Should return normalized BCP 47 tag", function() {
asyncLocaleData = new AsyncLocaleData(
log,
createMockTryCatchUtils("fr-FR") as any,
chromeFileService,
mockServices as any,
);
let result = asyncLocaleData.getAppLocale();
expect(result).to.equal("fr-fr");
});
it("Should throw RangeError if not a valid BCP 47 tag", function() {
asyncLocaleData = new AsyncLocaleData(
log,
createMockTryCatchUtils("-invalid tag") as any,
chromeFileService,
mockServices as any,
);
let fn = function() {
return asyncLocaleData.getAppLocale();
};
expect(fn).to.throws(RangeError);
});
});
beforeEach(function() {
asyncLocaleData = new AsyncLocaleData(
log, mockTryCatchUtils, chromeFileService, mockServices as any,
);
});