Browse Source

normalise test output for benefit of windows

gh-109
Rich-Harris 10 years ago
parent
commit
ab3160a71f
  1. 8
      test/test.js

8
test/test.js

@ -32,6 +32,10 @@ function extend ( target ) {
return target; return target;
} }
function normaliseOutput ( code ) {
return code.toString().trim().replace( /\r\n/g, '\n' );
}
describe( 'rollup', function () { describe( 'rollup', function () {
describe( 'sanity checks', function () { describe( 'sanity checks', function () {
it( 'exists', function () { it( 'exists', function () {
@ -175,13 +179,13 @@ describe( 'rollup', function () {
}); });
return bundle.write( options ).then( 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 expectedCode;
var actualMap; var actualMap;
var expectedMap; var expectedMap;
try { try {
expectedCode = sander.readFileSync( FORM, dir, '_expected', profile.format + '.js' ).toString().trim(); expectedCode = normaliseOutput( sander.readFileSync( FORM, dir, '_expected', profile.format + '.js' ) );
} catch ( err ) { } catch ( err ) {
expectedCode = 'missing file'; expectedCode = 'missing file';
} }

Loading…
Cancel
Save