Skip to content

Commit

Permalink
add test for #1317
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Mar 9, 2017
1 parent 05c44e5 commit c8a980a
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 1 deletion.
7 changes: 7 additions & 0 deletions test/form/no-treeshake-conflict/_config.js
@@ -0,0 +1,7 @@
module.exports = {
description: 'does not introduce conflicting variables with treeshake: false',
options: {
moduleName: /* not shaken, but */ 'stirred',
treeshake: false
}
};
7 changes: 7 additions & 0 deletions test/form/no-treeshake-conflict/_expected/amd.js
@@ -0,0 +1,7 @@
define(function () { 'use strict';

const other = {
something: 'here'
};

});
5 changes: 5 additions & 0 deletions test/form/no-treeshake-conflict/_expected/cjs.js
@@ -0,0 +1,5 @@
'use strict';

const other = {
something: 'here'
};
3 changes: 3 additions & 0 deletions test/form/no-treeshake-conflict/_expected/es.js
@@ -0,0 +1,3 @@
const other = {
something: 'here'
};
20 changes: 20 additions & 0 deletions test/form/no-treeshake-conflict/_expected/es6.js
@@ -0,0 +1,20 @@
import * as external from 'external';

var foo = 'unused';

const quux = 1;

const other = () => quux;

function bar () {
return foo;
}

function baz () {
return 13 + external.value;
}

var create = Object.create;
var getPrototypeOf = Object.getPrototypeOf;

export { baz, create, getPrototypeOf, quux as strange };
8 changes: 8 additions & 0 deletions test/form/no-treeshake-conflict/_expected/iife.js
@@ -0,0 +1,8 @@
(function () {
'use strict';

const other = {
something: 'here'
};

}());
11 changes: 11 additions & 0 deletions test/form/no-treeshake-conflict/_expected/umd.js
@@ -0,0 +1,11 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';

const other = {
something: 'here'
};

})));
1 change: 1 addition & 0 deletions test/form/no-treeshake-conflict/main.js
@@ -0,0 +1 @@
import other from './other';
5 changes: 5 additions & 0 deletions test/form/no-treeshake-conflict/other.js
@@ -0,0 +1,5 @@
const other = {
something: 'here'
};

export default other;
1 change: 0 additions & 1 deletion test/sourcemaps/names-transformed/_config.js
Expand Up @@ -5,7 +5,6 @@ var getLocation = require( '../../utils/getLocation' );
var SourceMapConsumer = require( 'source-map' ).SourceMapConsumer;

module.exports = {
solo: true,
description: 'names are recovered if transforms are used',
options: {
plugins: [
Expand Down

0 comments on commit c8a980a

Please sign in to comment.