Skip to content

Commit 489bbc2

Browse files
authored
test: verify locale code is format in metadata (#2713)
1 parent 660da4c commit 489bbc2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/locale-imports.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ describe.each(keys(allLocales))('locale imports', (locale) => {
3535
expect(metadata.code).toBeTypeOf('string');
3636
expect(metadata.code).toEqual(locale);
3737
if (locale !== 'base') {
38+
expect(metadata.code).toEqual(
39+
[metadata.language, metadata.country, metadata.variant]
40+
.filter((v) => v != null)
41+
.join('_')
42+
);
3843
expect(metadata.language).toBeTypeOf('string');
3944
expect(metadata.language).toMatch(/^[a-z]{2}$/);
4045
expect(metadata.script).toBeTypeOf('string');

0 commit comments

Comments
 (0)