File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ function pluginTester({
188
188
} else {
189
189
assert . equal (
190
190
result . trim ( ) ,
191
- code . trim ( ) ,
191
+ fixLineEndings ( code , endOfLine ) ,
192
192
'Expected output to not change, but it did' ,
193
193
)
194
194
}
@@ -224,8 +224,8 @@ function pluginTester({
224
224
}
225
225
}
226
226
227
- function fixLineEndings ( code , endOfLine , input ) {
228
- return code . replace ( / \r ? \n / g, getReplacement ( ) )
227
+ function fixLineEndings ( string , endOfLine , input = string ) {
228
+ return String ( string ) . replace ( / \r ? \n / g, getReplacement ( ) ) . trim ( )
229
229
230
230
function getReplacement ( ) {
231
231
switch ( endOfLine ) {
@@ -356,7 +356,7 @@ const createFixtureTests = (fixturesDir, options) => {
356
356
357
357
assert . equal (
358
358
actual . trim ( ) ,
359
- output . trim ( ) ,
359
+ fixLineEndings ( output , endOfLine ) ,
360
360
`actual output does not match ${ fixtureOutputName } ${ ext } ` ,
361
361
)
362
362
} )
You can’t perform that action at this time.
0 commit comments