Fix: Support BCP 47 language codes without contry code (#73)

* Updated regex to support BCP 47 language codes without country code

* Updated whatsnew tests

Co-authored-by: Pablo A. Martínez <pamartinez@boiradev.com>
This commit is contained in:
Pablo A Martínez Andrés
2021-09-21 18:26:56 +02:00
committed by GitHub
parent 060a2efa0e
commit 8c2ebfdb6e
5 changed files with 20 additions and 4 deletions

1
__tests__/whatsnew-ca Normal file
View File

@@ -0,0 +1 @@
test_changelog_file_catalan

1
__tests__/whatsnew-es-ES Normal file
View File

@@ -0,0 +1 @@
test_changelog_file_spanish

1
__tests__/whatsnew-et Normal file
View File

@@ -0,0 +1 @@
test_changelog_file_estonian

View File

@@ -7,7 +7,7 @@ import LocalizedText = androidpublisher_v3.Schema$LocalizedText;
test("read localized whatsnew files", async () => {
let texts = await readLocalizedReleaseNotes("./__tests__");
expect(texts).toHaveLength(3);
expect(texts).toHaveLength(6);
expect(texts).toContainEqual({
language: "en-US",
text: "test_changelog_file"
@@ -20,4 +20,16 @@ test("read localized whatsnew files", async () => {
language: "ja-JP",
text: "test_changelog_file_japanese"
});
expect(texts).toContainEqual({
language: "ca",
text: "test_changelog_file_catalan"
});
expect(texts).toContainEqual({
language: "es-ES",
text: "test_changelog_file_spanish"
});
expect(texts).toContainEqual({
language: "et",
text: "test_changelog_file_estonian"
});
});