Browse Source

tidy up tests, squelch nuisance warnings

ghi-672
Rich-Harris 8 years ago
parent
commit
3264378330
  1. 1
      test/function/export-default-anonymous-function/_config.js
  2. 1
      test/function/import-chain-as/main.js
  3. 2
      test/sourcemaps/basic-support/_config.js
  4. 12
      test/test.js

1
test/function/export-default-anonymous-function/_config.js

@ -9,7 +9,6 @@ module.exports = {
return path.basename( importee ).replace( /\..+/, '' );
},
load: function ( id ) {
console.log( 'id', id )
return fs.readFileSync( path.join( __dirname, id + '.js' ), 'utf-8' );
}
}]

1
test/function/import-chain-as/main.js

@ -1,5 +1,4 @@
import * as second from './second';
assert.equal( second.first.value, 42 );
console.log( 'second', second )
assert.deepEqual( second, { first: { value: 42 } });

2
test/sourcemaps/basic-support/_config.js

@ -7,7 +7,7 @@ module.exports = {
description: 'basic sourcemap support',
test: function ( code, map ) {
assert.equal( map.version, 3 );
assert.equal( map.file, 'bundle.js' );
assert.ok( /^bundle\.(\w+)\.js/.test( map.file ) );
var smc = new SourceMapConsumer( map );
var generatedLoc, originalLoc;

12
test/test.js

@ -153,7 +153,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'
}));
@ -252,7 +251,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 () {
@ -308,7 +312,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
@ -320,7 +324,7 @@ describe( 'rollup', function () {
var options = extend( {}, {
format: profile.format,
sourceMap: true,
dest: dest
dest: `${dest}.${profile.format}.js`
}, config.options );
bundle.write( options );

Loading…
Cancel
Save