From 2bd5c967afb821b199367d0d86634c3428961f00 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Mon, 25 Nov 2024 13:01:23 +0100 Subject: [PATCH] test(calendar): remove line ending normalization --- test/calendar.test.js | 14 ++------------ test/test_calendars/google-calendar-minimal.ics | 2 +- test/test_calendars/google-calendar.ics | 2 +- test/test_calendars/nextcloud-minimal.ics | 2 +- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/test/calendar.test.js b/test/calendar.test.js index 108c539..b61a367 100644 --- a/test/calendar.test.js +++ b/test/calendar.test.js @@ -15,8 +15,6 @@ let server; process.chdir(__dirname) const app = await import('../src/server'); -const normalizeLineEndings = (str) => str.replace(/\r\n/g, '\r\n').trimEnd(); // Normalize to CRLF - describe('Calendar Merging API', () => { beforeAll(async () => { // Start the server @@ -63,12 +61,8 @@ describe('Calendar Merging API', () => { const expectedOutput = fs.readFileSync(input, 'utf8'); const actualOutput = fs.readFileSync(filePath, 'utf8'); - // Normalize line endings - const normalizedActual = normalizeLineEndings(actualOutput); - const normalizedExpected = normalizeLineEndings(expectedOutput); - //compare - expect(normalizedActual).toBe(normalizedExpected); + expect(actualOutput).toBe(expectedOutput); }); test('Preserve google calendar', async () => { @@ -95,12 +89,8 @@ describe('Calendar Merging API', () => { const expectedOutput = fs.readFileSync(input, 'utf8'); const actualOutput = fs.readFileSync(filePath, 'utf8'); - // Normalize line endings - const normalizedActual = normalizeLineEndings(actualOutput); - const normalizedExpected = normalizeLineEndings(expectedOutput); - //compare - expect(normalizedActual).toBe(normalizedExpected); + expect(actualOutput).toBe(expectedOutput); }); diff --git a/test/test_calendars/google-calendar-minimal.ics b/test/test_calendars/google-calendar-minimal.ics index 9c34571..0eb70db 100644 --- a/test/test_calendars/google-calendar-minimal.ics +++ b/test/test_calendars/google-calendar-minimal.ics @@ -13,4 +13,4 @@ UID:6tbrvsitniuu72li7kk15gou2b@google.com SUMMARY:progodessey SEQUENCE:0 END:VEVENT -END:VCALENDAR +END:VCALENDAR \ No newline at end of file diff --git a/test/test_calendars/google-calendar.ics b/test/test_calendars/google-calendar.ics index ca0a7b7..65d57e1 100644 --- a/test/test_calendars/google-calendar.ics +++ b/test/test_calendars/google-calendar.ics @@ -41,4 +41,4 @@ STATUS:CONFIRMED SUMMARY:do TRANSP:OPAQUE END:VEVENT -END:VCALENDAR +END:VCALENDAR \ No newline at end of file diff --git a/test/test_calendars/nextcloud-minimal.ics b/test/test_calendars/nextcloud-minimal.ics index 23684ab..1cc135d 100644 --- a/test/test_calendars/nextcloud-minimal.ics +++ b/test/test_calendars/nextcloud-minimal.ics @@ -30,4 +30,4 @@ RRULE:FREQ=WEEKLY;BYDAY=WE SUMMARY:JR Weekly Check-In SEQUENCE:0 END:VEVENT -END:VCALENDAR +END:VCALENDAR \ No newline at end of file