|
|
@ -77,7 +77,7 @@ describe( 'rollup', function () { |
|
|
|
return rollup.rollup({ entry: 'x', plUgins: [] }).then( function () { |
|
|
|
throw new Error( 'Missing expected error' ); |
|
|
|
}, function ( err ) { |
|
|
|
assert.equal( err.message, 'Unexpected key \'plUgins\' found, expected one of: banner, dest, entry, exports, external, footer, format, globals, indent, intro, moduleId, moduleName, noConflict, onwarn, outro, plugins, preferConst, sourceMap, treeshake, useStrict' ); |
|
|
|
assert.equal( err.message, 'Unexpected key \'plUgins\' found, expected one of: banner, dest, entry, exports, external, footer, format, globals, indent, intro, moduleId, moduleName, noConflict, onwarn, outro, plugins, preferConst, sourceMap, targets, treeshake, useStrict' ); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -154,7 +154,6 @@ describe( 'rollup', function () { |
|
|
|
|
|
|
|
// try to generate output
|
|
|
|
try { |
|
|
|
if(config.bundleOptions) { console.log(config.bundleOptions); } |
|
|
|
var result = bundle.generate( extend( {}, config.bundleOptions, { |
|
|
|
format: 'cjs' |
|
|
|
})); |
|
|
@ -253,7 +252,12 @@ describe( 'rollup', function () { |
|
|
|
if ( config.skipIfWindows && process.platform === 'win32' ) return; |
|
|
|
|
|
|
|
var options = extend( {}, config.options, { |
|
|
|
entry: FORM + '/' + dir + '/main.js' |
|
|
|
entry: FORM + '/' + dir + '/main.js', |
|
|
|
onwarn: msg => { |
|
|
|
if ( /No name was provided for/.test( msg ) ) return; |
|
|
|
if ( /as external dependency/.test( msg ) ) return; |
|
|
|
console.error( msg ); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
( config.skip ? describe.skip : config.solo ? describe.only : describe)( dir, function () { |
|
|
@ -309,7 +313,7 @@ describe( 'rollup', function () { |
|
|
|
var config = loadConfig( SOURCEMAPS + '/' + dir + '/_config.js' ); |
|
|
|
|
|
|
|
var entry = path.resolve( SOURCEMAPS, dir, 'main.js' ); |
|
|
|
var dest = path.resolve( SOURCEMAPS, dir, '_actual/bundle.js' ); |
|
|
|
var dest = path.resolve( SOURCEMAPS, dir, '_actual/bundle' ); |
|
|
|
|
|
|
|
var options = extend( {}, config.options, { |
|
|
|
entry: entry |
|
|
@ -321,7 +325,7 @@ describe( 'rollup', function () { |
|
|
|
var options = extend( {}, { |
|
|
|
format: profile.format, |
|
|
|
sourceMap: true, |
|
|
|
dest: dest |
|
|
|
dest: `${dest}.${profile.format}.js` |
|
|
|
}, config.options ); |
|
|
|
|
|
|
|
bundle.write( options ); |
|
|
@ -354,9 +358,13 @@ describe( 'rollup', function () { |
|
|
|
PATH: path.resolve( __dirname, '../bin' ) + path.delimiter + process.env.PATH |
|
|
|
} |
|
|
|
}, function ( err, code, stderr ) { |
|
|
|
if ( err || config.error ) { |
|
|
|
config.error( err ); |
|
|
|
return done(); |
|
|
|
if ( err ) { |
|
|
|
if ( config.error ) { |
|
|
|
config.error( err ); |
|
|
|
return done(); |
|
|
|
} else { |
|
|
|
throw err; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ( stderr ) console.error( stderr ); |
|
|
@ -410,6 +418,20 @@ describe( 'rollup', function () { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if ( sander.existsSync( '_expected' ) && sander.statSync( '_expected' ).isDirectory() ) { |
|
|
|
var error = null; |
|
|
|
sander.readdirSync( '_expected' ).forEach( child => { |
|
|
|
var expected = sander.readFileSync( path.join( '_expected', child ) ).toString(); |
|
|
|
var actual = sander.readFileSync( path.join( '_actual', child ) ).toString(); |
|
|
|
try { |
|
|
|
assert.equal( normaliseOutput( actual ), normaliseOutput( expected ) ); |
|
|
|
} catch ( err ) { |
|
|
|
error = err; |
|
|
|
} |
|
|
|
}); |
|
|
|
done( error ); |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
var expected = sander.readFileSync( '_expected.js' ).toString(); |
|
|
|
try { |
|
|
|