Skip to content

Commit

Permalink
Add test for bizzare moduleName
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Dec 14, 2016
1 parent f43fd99 commit bb546d3
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/form/module-name-wat/_config.js
@@ -0,0 +1,6 @@
module.exports = {
description: 'properly dereferences properties on the global object regardless of nesting',
options: {
moduleName: 'foo.@scoped/npm-package.bar.why-would-you-do-this'
}
};
9 changes: 9 additions & 0 deletions test/form/module-name-wat/_expected/amd.js
@@ -0,0 +1,9 @@
define(['exports'], function (exports) { 'use strict';

let foo = 'foo';

exports.foo = foo;

Object.defineProperty(exports, '__esModule', { value: true });

});
7 changes: 7 additions & 0 deletions test/form/module-name-wat/_expected/cjs.js
@@ -0,0 +1,7 @@
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

let foo = 'foo';

exports.foo = foo;
3 changes: 3 additions & 0 deletions test/form/module-name-wat/_expected/es.js
@@ -0,0 +1,3 @@
let foo = 'foo';

export { foo };
11 changes: 11 additions & 0 deletions test/form/module-name-wat/_expected/iife.js
@@ -0,0 +1,11 @@
this.foo = this.foo || {};
this.foo['@scoped/npm-package'] = this.foo['@scoped/npm-package'] || {};
this.foo['@scoped/npm-package'].bar = this.foo['@scoped/npm-package'].bar || {};
(function (exports) {
'use strict';

let foo = 'foo';

exports.foo = foo;

}((this.foo['@scoped/npm-package'].bar['why-would-you-do-this'] = this.foo['@scoped/npm-package'].bar['why-would-you-do-this'] || {})));
13 changes: 13 additions & 0 deletions test/form/module-name-wat/_expected/umd.js
@@ -0,0 +1,13 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.foo = global.foo || {}, global.foo['@scoped/npm-package'] = global.foo['@scoped/npm-package'] || {}, global.foo['@scoped/npm-package'].bar = global.foo['@scoped/npm-package'].bar || {}, global.foo['@scoped/npm-package'].bar['why-would-you-do-this'] = global.foo['@scoped/npm-package'].bar['why-would-you-do-this'] || {})));
}(this, (function (exports) { 'use strict';

let foo = 'foo';

exports.foo = foo;

Object.defineProperty(exports, '__esModule', { value: true });

})));
1 change: 1 addition & 0 deletions test/form/module-name-wat/main.js
@@ -0,0 +1 @@
export let foo = 'foo';

0 comments on commit bb546d3

Please sign in to comment.