From 86fcbc23d02697177c8e0afa2676859be4826b55 Mon Sep 17 00:00:00 2001 From: Mara-Li Date: Fri, 21 Feb 2025 22:19:28 +0100 Subject: [PATCH] feat(tests): add test for error handling with insufficient columns in CSV --- tests/parse_csv.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/parse_csv.test.ts b/tests/parse_csv.test.ts index 6e202e1..265a7dd 100644 --- a/tests/parse_csv.test.ts +++ b/tests/parse_csv.test.ts @@ -137,3 +137,13 @@ describe("Unordered columns", () => { }); }); }); + +describe("not enough columns", () => { + const csvContent = "Term\nword1,word2"; + const separator: Separator = ","; + it("should error", () => { + expect(() => + getThesaurus(csvContent, separator, mockTranslation, columnNames) + ).toThrow(mockTranslation("error.csv.malformed")); + }); +});