Skip to content

Commit 8fcba16

Browse files
🛠️Normalize test line endings (#355)
* 🛠️Normalize test line endings. * Moved normalizeLineEndings function declaration out of loop. * Simplify --------- Co-authored-by: Jordan Pittman <[email protected]>
1 parent c413c69 commit 8fcba16

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/fixtures.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { format, pluginPath } from './utils'
88

99
const __filename = fileURLToPath(import.meta.url)
1010
const __dirname = path.dirname(__filename)
11-
1211
const execAsync = promisify(exec)
1312

1413
let fixtures = [
@@ -127,8 +126,10 @@ describe('fixtures', () => {
127126

128127
test.concurrent(name, async ({ expect }) => {
129128
let results = await execAsync(cmd)
130-
let formatted = results.stdout
131-
let expected = await fs.readFile(outputPath, 'utf-8')
129+
let formatted = results.stdout.replace(/\r\n/g, '\n')
130+
let expected = await fs
131+
.readFile(outputPath, 'utf-8')
132+
.then((c) => c.replace(/\r\n/g, '\n'))
132133

133134
expect(formatted.trim()).toEqual(expected.trim())
134135
})

0 commit comments

Comments
 (0)