diff --git a/test/function/export-default-as/_config.js b/test/function/export-default-as/_config.js new file mode 100644 index 0000000..b470928 --- /dev/null +++ b/test/function/export-default-as/_config.js @@ -0,0 +1,10 @@ +var assert = require( 'assert' ); + +module.exports = { + description: 'exports default-as-named from sibling module', + exports: function ( exports ) { + assert.equal( exports.foo, 'FOO' ); + assert.equal( exports.namespace.baz, 'BAZ' ); + }, + //solo: true +}; diff --git a/test/function/export-default-as/bar.js b/test/function/export-default-as/bar.js new file mode 100644 index 0000000..5ede27d --- /dev/null +++ b/test/function/export-default-as/bar.js @@ -0,0 +1 @@ +export { default as baz } from './baz'; diff --git a/test/function/export-default-as/baz.js b/test/function/export-default-as/baz.js new file mode 100644 index 0000000..cf4b80d --- /dev/null +++ b/test/function/export-default-as/baz.js @@ -0,0 +1 @@ +export default 'BAZ'; diff --git a/test/function/export-default-as/foo.js b/test/function/export-default-as/foo.js new file mode 100644 index 0000000..20fc97b --- /dev/null +++ b/test/function/export-default-as/foo.js @@ -0,0 +1 @@ +export default 'FOO'; diff --git a/test/function/export-default-as/main.js b/test/function/export-default-as/main.js new file mode 100644 index 0000000..d2c2ab1 --- /dev/null +++ b/test/function/export-default-as/main.js @@ -0,0 +1,8 @@ +import { baz } from './bar'; +import * as namespace from './namespace'; + +assert.equal( baz, 'BAZ' ); +assert.equal( namespace.baz, 'BAZ' ); + +export { default as foo } from './foo'; +export { namespace }; diff --git a/test/function/export-default-as/namespace.js b/test/function/export-default-as/namespace.js new file mode 100644 index 0000000..5ede27d --- /dev/null +++ b/test/function/export-default-as/namespace.js @@ -0,0 +1 @@ +export { default as baz } from './baz';