Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/metal-bottles-travel.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@lingo.dev/_spec": major
"@lingo.dev/_spec": patch
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to patch

---

Add unit test for utility function in locales.ts
5 changes: 2 additions & 3 deletions packages/spec/src/locales.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ describe("resolveLocaleCode", () => {
});

it("should return first code for locales with multiple variants", () => {
expect(resolveLocaleCode("sr")).toEqual("sr-RS");
expect(resolveLocaleCode("sr")).toEqual("sr-RS");
expect(resolveLocaleCode("zh")).toEqual("zh-CN");
});
});


describe("getLocaleCodeDelimiter", () => {
it("should return '-' for locale codes with hyphen delimiter", () => {
expect(getLocaleCodeDelimiter("en-US")).toEqual("-");
Expand Down Expand Up @@ -82,4 +81,4 @@ describe("resolveOverridenLocale", () => {
expect(resolveOverridenLocale("enUS", "_")).toEqual("enUS");
expect(resolveOverridenLocale("frFR", "-")).toEqual("frFR");
});
});
});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done @mathio