Browse Source

switch tests from babel to buble

semi-dynamic-namespace-imports
Rich-Harris 9 years ago
parent
commit
c542325a58
  1. 2
      test/function/assignment-patterns/_config.js
  2. 2
      test/function/class-methods-not-renamed/_config.js
  3. 2
      test/function/cycles-pathological/_config.js
  4. 2
      test/function/deconstructed-exported-vars/_config.js
  5. 2
      test/function/export-destruction/_config.js
  6. 2
      test/function/import-default-class/_config.js
  7. 2
      test/function/import-named-class/_config.js
  8. 2
      test/function/import-nameless-class-expression/_config.js
  9. 2
      test/function/object-destructuring-renaming/_config.js
  10. 2
      test/function/top-level-arrow-function/_config.js
  11. 7
      test/sourcemaps/transforms/_config.js
  12. 20
      test/test.js

2
test/function/assignment-patterns/_config.js

@ -1,4 +1,4 @@
module.exports = {
description: 'allows reassigments to default parameters that shadow imports',
babel: true
buble: true
};

2
test/function/class-methods-not-renamed/_config.js

@ -3,5 +3,5 @@ module.exports = {
options: {
external: [ 'path' ]
},
babel: true
buble: true
};

2
test/function/cycles-pathological/_config.js

@ -4,7 +4,7 @@ var warned;
module.exports = {
description: 'resolves pathological cyclical dependencies gracefully',
babel: true,
buble: true,
options: {
onwarn: function ( message ) {
assert.ok( /Module .+B\.js may be unable to evaluate without .+A\.js, but is included first due to a cyclical dependency. Consider swapping the import statements in .+main\.js to ensure correct ordering/.test( message ) );

2
test/function/deconstructed-exported-vars/_config.js

@ -2,7 +2,7 @@ var assert = require( 'assert' );
module.exports = {
description: 'allows destructuring in exported variable declarations, synthetic or otherwise',
babel: true,
buble: true,
exports: function ( exports ) {
assert.equal( exports.a, 1 );
assert.equal( exports.d, 4 );

2
test/function/export-destruction/_config.js

@ -2,7 +2,7 @@ var assert = require( 'assert' );
module.exports = {
description: 'handle destruction patterns in export declarations',
babel: true,
buble: true,
exports: function ( exports ) {
assert.deepEqual( Object.keys( exports ), [ 'baz', 'quux' ] );

2
test/function/import-default-class/_config.js

@ -1,6 +1,6 @@
module.exports = {
description: 'imports a default class',
babel: true
buble: true
};
// test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-default-class

2
test/function/import-named-class/_config.js

@ -1,6 +1,6 @@
module.exports = {
description: 'imports a named class',
babel: true
buble: true
};
// test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-named-class

2
test/function/import-nameless-class-expression/_config.js

@ -1,6 +1,6 @@
module.exports = {
description: 'imports a nameless class expression',
babel: true
buble: true
};
// test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-class-expression

2
test/function/object-destructuring-renaming/_config.js

@ -4,7 +4,7 @@ module.exports = {
description: 'renaming destructured object properties should request the correct property (#527)',
// we must transpile the object destructuring to test it
babel: true,
buble: true,
exports: function ( exports ) {
assert.equal( exports.env, process.env );

2
test/function/top-level-arrow-function/_config.js

@ -1,4 +1,4 @@
module.exports = {
description: 'handles naked return value from top-level arrow function expression (#403)',
babel: true
buble: true
};

7
test/sourcemaps/transforms/_config.js

@ -1,4 +1,4 @@
var babel = require( 'babel-core' );
var buble = require( 'buble' );
var MagicString = require( 'magic-string' );
var assert = require( 'assert' );
var getLocation = require( '../../utils/getLocation' );
@ -10,9 +10,8 @@ module.exports = {
plugins: [
{
transform: function ( source, id ) {
return babel.transform( source, {
blacklist: [ 'es6.modules' ],
sourceMap: true
return buble.transform( source, {
transforms: { modules: false }
});
}
},

20
test/test.js

@ -6,7 +6,7 @@ var os = require( 'os' );
var sander = require( 'sander' );
var assert = require( 'assert' );
var exec = require( 'child_process' ).exec;
var babel = require( 'babel-core' );
var buble = require( 'buble' );
var rollup = require( '../dist/rollup' );
var FUNCTION = path.resolve( __dirname, 'function' );
@ -171,15 +171,12 @@ describe( 'rollup', function () {
if ( unintendedError ) throw unintendedError;
if ( config.error || config.generateError ) return;
var code;
var code = result.code;
if ( config.babel ) {
code = babel.transform( result.code, {
blacklist: [ 'es6.modules' ],
loose: [ 'es6.classes' ]
if ( config.buble ) {
code = buble.transform( code, {
transforms: { modules: false }
}).code;
} else {
code = result.code;
}
if ( config.code ) config.code( code );
@ -372,10 +369,9 @@ describe( 'rollup', function () {
if ( config.execute ) {
try {
if ( config.babel ) {
code = babel.transform( code, {
blacklist: [ 'es6.modules' ],
loose: [ 'es6.classes' ]
if ( config.buble ) {
code = buble.transform( code, {
transforms: { modules: false }
}).code;
}

Loading…
Cancel
Save