-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.perf.js
More file actions
35 lines (30 loc) · 979 Bytes
/
Copy pathindex.perf.js
File metadata and controls
35 lines (30 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { describe, test, measure } from 'toofast';
import * as formatjs from '@formatjs/intl-localematcher';
import * as localeMatcher from '../../lib/index.js';
const requestedAlpha2Locales = ['ru-RU'];
const requestedAlpha3Locales = ['rus-RU'];
const supportedLocales = ['en-GB', 'ru', 'cz', 'ru-RU'];
describe('ISO 639-1 (alpha2)', () => {
test('@formatjs/intl-localematcher', () => {
measure(() => {
formatjs.match(requestedAlpha2Locales, supportedLocales, 'ru');
});
});
test('locale-matcher', () => {
measure(() => {
localeMatcher.pickLocale(requestedAlpha2Locales, supportedLocales);
});
});
});
describe('ISO 639-2 (alpha3)', () => {
test('@formatjs/intl-localematcher', () => {
measure(() => {
formatjs.match(requestedAlpha3Locales, supportedLocales, 'ru');
});
});
test('locale-matcher', () => {
measure(() => {
localeMatcher.pickLocale(requestedAlpha3Locales, supportedLocales);
});
});
});