Skip to content

Commit

Permalink
test: message new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Ni55aN committed Aug 30, 2024
1 parent 2974f82 commit 68af5aa
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/lint/formatter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,40 @@ describe('Formatter', () => {
}
], expect.any(Object))
})

it('normalizes messages by replacing new lines', async () => {
const { format } = mockEslint()
const formatter = new Formatter()

await formatter.format([
{
...result1,
messages: [
{
...message1,
message: 'message\na\t\nb \nc'
}
]
}
])

expect(format).toHaveBeenCalledWith([
{
...result1,
messages: [
{
...message1,
message: 'message a b c'
}
],
errorCount: expect.any(Number),
fatalErrorCount: expect.any(Number),
fixableErrorCount: expect.any(Number),
fixableWarningCount: expect.any(Number),
suppressedMessages: expect.any(Array),
usedDeprecatedRules: expect.any(Array),
warningCount: expect.any(Number)
}
], expect.any(Object))
})
})

0 comments on commit 68af5aa

Please sign in to comment.