From ab3160a71ff32a23b4ffdc5d6ef9cc1ae388e182 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sat, 19 Sep 2015 23:23:56 +0200 Subject: [PATCH] normalise test output for benefit of windows --- test/test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 1139505..7d8631d 100644 --- a/test/test.js +++ b/test/test.js @@ -32,6 +32,10 @@ function extend ( target ) { return target; } +function normaliseOutput ( code ) { + return code.toString().trim().replace( /\r\n/g, '\n' ); +} + describe( 'rollup', function () { describe( 'sanity checks', function () { it( 'exists', function () { @@ -175,13 +179,13 @@ describe( 'rollup', function () { }); return bundle.write( options ).then( function () { - var actualCode = sander.readFileSync( FORM, dir, '_actual', profile.format + '.js' ).toString().trim(); + var actualCode = normaliseOutput( sander.readFileSync( FORM, dir, '_actual', profile.format + '.js' ) ); var expectedCode; var actualMap; var expectedMap; try { - expectedCode = sander.readFileSync( FORM, dir, '_expected', profile.format + '.js' ).toString().trim(); + expectedCode = normaliseOutput( sander.readFileSync( FORM, dir, '_expected', profile.format + '.js' ) ); } catch ( err ) { expectedCode = 'missing file'; }