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) process.chdir(__dirname)
const app = await import('../src/server'); const app = await import('../src/server');
const normalizeLineEndings = (str) => str.replace(/\r\n/g, '\r\n').trimEnd(); // Normalize to CRLF
describe('Calendar Merging API', () => { describe('Calendar Merging API', () => {
beforeAll(async () => { beforeAll(async () => {
// Start the server // Start the server
@ -63,12 +61,8 @@ describe('Calendar Merging API', () => {
const expectedOutput = fs.readFileSync(input, 'utf8'); const expectedOutput = fs.readFileSync(input, 'utf8');
const actualOutput = fs.readFileSync(filePath, 'utf8'); const actualOutput = fs.readFileSync(filePath, 'utf8');
// Normalize line endings
const normalizedActual = normalizeLineEndings(actualOutput);
const normalizedExpected = normalizeLineEndings(expectedOutput);
//compare //compare
expect(normalizedActual).toBe(normalizedExpected); expect(actualOutput).toBe(expectedOutput);
}); });
test('Preserve google calendar', async () => { test('Preserve google calendar', async () => {
@ -95,12 +89,8 @@ describe('Calendar Merging API', () => {
const expectedOutput = fs.readFileSync(input, 'utf8'); const expectedOutput = fs.readFileSync(input, 'utf8');
const actualOutput = fs.readFileSync(filePath, 'utf8'); const actualOutput = fs.readFileSync(filePath, 'utf8');
// Normalize line endings
const normalizedActual = normalizeLineEndings(actualOutput);
const normalizedExpected = normalizeLineEndings(expectedOutput);
//compare //compare
expect(normalizedActual).toBe(normalizedExpected); expect(actualOutput).toBe(expectedOutput);
}); });