test(calendar): remove line ending normalization

This commit is contained in:
xeruf 2024-11-25 13:01:23 +01:00
parent c8f3771717
commit 2bd5c967af
4 changed files with 5 additions and 15 deletions

View File

@ -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);
});

View File

@ -13,4 +13,4 @@ UID:6tbrvsitniuu72li7kk15gou2b@google.com
SUMMARY:progodessey
SEQUENCE:0
END:VEVENT
END:VCALENDAR
END:VCALENDAR

View File

@ -41,4 +41,4 @@ STATUS:CONFIRMED
SUMMARY:do
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
END:VCALENDAR

View File

@ -30,4 +30,4 @@ RRULE:FREQ=WEEKLY;BYDAY=WE
SUMMARY:JR Weekly Check-In
SEQUENCE:0
END:VEVENT
END:VCALENDAR
END:VCALENDAR