diff --git a/test/function/class-methods-not-renamed/_config.js b/test/function/class-methods-not-renamed/_config.js new file mode 100644 index 0000000..0b31fd0 --- /dev/null +++ b/test/function/class-methods-not-renamed/_config.js @@ -0,0 +1,7 @@ +module.exports = { + description: 'does not rename class methods incorrectly', + options: { + external: [ 'path' ] + }, + babel: true +}; diff --git a/test/function/class-methods-not-renamed/foo.js b/test/function/class-methods-not-renamed/foo.js new file mode 100644 index 0000000..f87c828 --- /dev/null +++ b/test/function/class-methods-not-renamed/foo.js @@ -0,0 +1,8 @@ +import { bar } from 'path'; // path, so the test doesn't fail for unrelated reasons... + +export default class Foo { + bar () { + if ( false ) return bar(); + return true; + } +} diff --git a/test/function/class-methods-not-renamed/main.js b/test/function/class-methods-not-renamed/main.js new file mode 100644 index 0000000..ec20461 --- /dev/null +++ b/test/function/class-methods-not-renamed/main.js @@ -0,0 +1,3 @@ +import Foo from './foo'; + +assert.ok( new Foo().bar() ); diff --git a/test/function/export-default-from-external/_config.js b/test/function/export-default-from-external/_config.js new file mode 100644 index 0000000..b5434aa --- /dev/null +++ b/test/function/export-default-from-external/_config.js @@ -0,0 +1,12 @@ +var path = require( 'path' ); +var assert = require( 'assert' ); + +module.exports = { + description: 'ensures external modules have correct names', + options: { + external: [ 'path' ] + }, + exports: function ( exports ) { + assert.equal( exports, path.sep ); + } +}; diff --git a/test/function/export-default-from-external/main.js b/test/function/export-default-from-external/main.js new file mode 100644 index 0000000..3c3ed41 --- /dev/null +++ b/test/function/export-default-from-external/main.js @@ -0,0 +1,2 @@ +import { sep } from 'path'; +export default sep;