Skip to content

Commit 00eab64

Browse files
committed
Simplify
1 parent 448ddf3 commit 00eab64

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/fixtures.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { format, pluginPath } from './utils'
99
const __filename = fileURLToPath(import.meta.url)
1010
const __dirname = path.dirname(__filename)
1111
const execAsync = promisify(exec)
12-
const normalizeLineEndings = (text: string) => text.replace(/\r\n/g, '\n')
1312

1413
let fixtures = [
1514
{
@@ -117,8 +116,10 @@ describe('fixtures', () => {
117116

118117
test.concurrent(name, async ({ expect }) => {
119118
let results = await execAsync(cmd)
120-
let formatted = normalizeLineEndings(results.stdout)
121-
let expected = normalizeLineEndings(await fs.readFile(outputPath, 'utf-8'))
119+
let formatted = results.stdout.replace(/\r\n/g, '\n')
120+
let expected = await fs
121+
.readFile(outputPath, 'utf-8')
122+
.then((c) => c.replace(/\r\n/g, '\n'))
122123

123124
expect(formatted.trim()).toEqual(expected.trim())
124125
})

0 commit comments

Comments
 (0)