diff --git a/.vscode/settings.json b/.vscode/settings.json index aa10261..c233ed3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,7 @@ "editor.defaultFormatter": "esbenp.prettier-vscode", "[typescript]": { "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit" } }, "jest.jestCommandLine": "yarn test", diff --git a/packages/plugin-iobroker/src/tools.test.ts b/packages/plugin-iobroker/src/tools.test.ts new file mode 100644 index 0000000..38b1baf --- /dev/null +++ b/packages/plugin-iobroker/src/tools.test.ts @@ -0,0 +1,27 @@ +import { cleanChangelogForNews } from "./tools"; + +describe("cleanChangelogForNews", () => { + it("removes author names with umlauts", () => { + const input = ` +* (Jürgen) Line 1 +* (Jérôme) Line 2 +* (René) Line 3 +* (Burić) Line 4 +* (Çoban) Line 5 +* (Jörg) Line 6 +* (Keßler) Line 7 +`.trim(); + + const expected = ` +Line 1 +Line 2 +Line 3 +Line 4 +Line 5 +Line 6 +Line 7 +`.trim(); + + expect(cleanChangelogForNews(input)).toBe(expected); + }); +}); diff --git a/packages/plugin-iobroker/src/tools.ts b/packages/plugin-iobroker/src/tools.ts index 8618f1f..e24a2e1 100644 --- a/packages/plugin-iobroker/src/tools.ts +++ b/packages/plugin-iobroker/src/tools.ts @@ -14,7 +14,7 @@ export function limitKeys(obj: Record, count: number): Record