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 = { module.exports = {
description: 'allows reassigments to default parameters that shadow imports', 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: { options: {
external: [ 'path' ] external: [ 'path' ]
}, },
babel: true buble: true
}; };

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

@ -4,7 +4,7 @@ var warned;
module.exports = { module.exports = {
description: 'resolves pathological cyclical dependencies gracefully', description: 'resolves pathological cyclical dependencies gracefully',
babel: true, buble: true,
options: { options: {
onwarn: function ( message ) { 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 ) ); 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 = { module.exports = {
description: 'allows destructuring in exported variable declarations, synthetic or otherwise', description: 'allows destructuring in exported variable declarations, synthetic or otherwise',
babel: true, buble: true,
exports: function ( exports ) { exports: function ( exports ) {
assert.equal( exports.a, 1 ); assert.equal( exports.a, 1 );
assert.equal( exports.d, 4 ); assert.equal( exports.d, 4 );

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

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

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

@ -1,6 +1,6 @@
module.exports = { module.exports = {
description: 'imports a default class', 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 // 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 = { module.exports = {
description: 'imports a named class', 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 // 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 = { module.exports = {
description: 'imports a nameless class expression', 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 // 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)', description: 'renaming destructured object properties should request the correct property (#527)',
// we must transpile the object destructuring to test it // we must transpile the object destructuring to test it
babel: true, buble: true,
exports: function ( exports ) { exports: function ( exports ) {
assert.equal( exports.env, process.env ); assert.equal( exports.env, process.env );

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

@ -1,4 +1,4 @@
module.exports = { module.exports = {
description: 'handles naked return value from top-level arrow function expression (#403)', 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 MagicString = require( 'magic-string' );
var assert = require( 'assert' ); var assert = require( 'assert' );
var getLocation = require( '../../utils/getLocation' ); var getLocation = require( '../../utils/getLocation' );
@ -10,9 +10,8 @@ module.exports = {
plugins: [ plugins: [
{ {
transform: function ( source, id ) { transform: function ( source, id ) {
return babel.transform( source, { return buble.transform( source, {
blacklist: [ 'es6.modules' ], transforms: { modules: false }
sourceMap: true
}); });
} }
}, },

20
test/test.js

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

Loading…
Cancel
Save