Browse Source

tests for #42

contingency-plan
Rich-Harris 10 years ago
parent
commit
77452031ac
  1. 7
      test/function/class-methods-not-renamed/_config.js
  2. 8
      test/function/class-methods-not-renamed/foo.js
  3. 3
      test/function/class-methods-not-renamed/main.js
  4. 12
      test/function/export-default-from-external/_config.js
  5. 2
      test/function/export-default-from-external/main.js

7
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
};

8
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;
}
}

3
test/function/class-methods-not-renamed/main.js

@ -0,0 +1,3 @@
import Foo from './foo';
assert.ok( new Foo().bar() );

12
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 );
}
};

2
test/function/export-default-from-external/main.js

@ -0,0 +1,2 @@
import { sep } from 'path';
export default sep;
Loading…
Cancel
Save