File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ function pluginTester({
188188 } else {
189189 assert . equal (
190190 result . trim ( ) ,
191- code . trim ( ) ,
191+ fixLineEndings ( code , endOfLine ) ,
192192 'Expected output to not change, but it did' ,
193193 )
194194 }
@@ -224,8 +224,8 @@ function pluginTester({
224224 }
225225}
226226
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 ( )
229229
230230 function getReplacement ( ) {
231231 switch ( endOfLine ) {
@@ -356,7 +356,7 @@ const createFixtureTests = (fixturesDir, options) => {
356356
357357 assert . equal (
358358 actual . trim ( ) ,
359- output . trim ( ) ,
359+ fixLineEndings ( output , endOfLine ) ,
360360 `actual output does not match ${ fixtureOutputName } ${ ext } ` ,
361361 )
362362 } )
You can’t perform that action at this time.
0 commit comments