test(calendar): remove line ending normalization
This commit is contained in:
parent
c8f3771717
commit
2bd5c967af
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue