From 5e09e6b72c4e0b2e69d4f3281d49330cd69b80a0 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 30 Sep 2015 15:13:37 -0400 Subject: [PATCH] add test for namespace issue in #149 --- test/function/pass-namespace-to-function/_config.js | 3 +++ test/function/pass-namespace-to-function/bar.js | 1 + test/function/pass-namespace-to-function/foo.js | 7 +++++++ test/function/pass-namespace-to-function/main.js | 5 +++++ 4 files changed, 16 insertions(+) create mode 100644 test/function/pass-namespace-to-function/_config.js create mode 100644 test/function/pass-namespace-to-function/bar.js create mode 100644 test/function/pass-namespace-to-function/foo.js create mode 100644 test/function/pass-namespace-to-function/main.js diff --git a/test/function/pass-namespace-to-function/_config.js b/test/function/pass-namespace-to-function/_config.js new file mode 100644 index 0000000..d93fddb --- /dev/null +++ b/test/function/pass-namespace-to-function/_config.js @@ -0,0 +1,3 @@ +module.exports = { + description: 'allows a namespace to be passed to a function' +}; diff --git a/test/function/pass-namespace-to-function/bar.js b/test/function/pass-namespace-to-function/bar.js new file mode 100644 index 0000000..8d5a2a2 --- /dev/null +++ b/test/function/pass-namespace-to-function/bar.js @@ -0,0 +1 @@ +// this space left intentionally blank diff --git a/test/function/pass-namespace-to-function/foo.js b/test/function/pass-namespace-to-function/foo.js new file mode 100644 index 0000000..29e1da1 --- /dev/null +++ b/test/function/pass-namespace-to-function/foo.js @@ -0,0 +1,7 @@ +import * as bar from './bar'; + +export default function foo () {} + +foo.x = function () { + doSomethingWith( bar ); +}; diff --git a/test/function/pass-namespace-to-function/main.js b/test/function/pass-namespace-to-function/main.js new file mode 100644 index 0000000..505e20b --- /dev/null +++ b/test/function/pass-namespace-to-function/main.js @@ -0,0 +1,5 @@ +import foo from './foo'; + +export default function () { + foo(); +}