Skip to content

Commit

Permalink
test: verify locale code is format in metadata (#2713)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmayer authored Mar 5, 2024
1 parent 660da4c commit 489bbc2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/locale-imports.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ describe.each(keys(allLocales))('locale imports', (locale) => {
expect(metadata.code).toBeTypeOf('string');
expect(metadata.code).toEqual(locale);
if (locale !== 'base') {
expect(metadata.code).toEqual(
[metadata.language, metadata.country, metadata.variant]
.filter((v) => v != null)
.join('_')
);
expect(metadata.language).toBeTypeOf('string');
expect(metadata.language).toMatch(/^[a-z]{2}$/);
expect(metadata.script).toBeTypeOf('string');
Expand Down

0 comments on commit 489bbc2

Please sign in to comment.