From 843298e9299ef33c9f40b646435d789c37327000 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Sat, 4 Aug 2018 15:26:57 -0400 Subject: [PATCH] Attempt to reproduce issue #209. --- test/import-tests.js | 5 +++++ test/import/issue-209/child.js | 3 +++ test/import/issue-209/parent.js | 2 ++ test/import/issue-209/parent.js~ | 1 + 4 files changed, 11 insertions(+) create mode 100644 test/import/issue-209/child.js create mode 100644 test/import/issue-209/parent.js create mode 100644 test/import/issue-209/parent.js~ diff --git a/test/import-tests.js b/test/import-tests.js index 7c4c8328..c7126311 100644 --- a/test/import-tests.js +++ b/test/import-tests.js @@ -160,4 +160,9 @@ describe("import declarations", () => { assert.strictEqual(d, _d); assert.strictEqual(e, _e); }); + + it("`import module from ...` should work (issue #209)", () => { + import { childId } from "./import/issue-209/parent"; + assert.strictEqual(childId, __dirname + "/import/issue-209/child.js"); + }); }); diff --git a/test/import/issue-209/child.js b/test/import/issue-209/child.js new file mode 100644 index 00000000..7333a404 --- /dev/null +++ b/test/import/issue-209/child.js @@ -0,0 +1,3 @@ +export default function () { + return module; +} diff --git a/test/import/issue-209/parent.js b/test/import/issue-209/parent.js new file mode 100644 index 00000000..7cb3f654 --- /dev/null +++ b/test/import/issue-209/parent.js @@ -0,0 +1,2 @@ +import module from "./child.js"; +export const childId = module().id; diff --git a/test/import/issue-209/parent.js~ b/test/import/issue-209/parent.js~ new file mode 100644 index 00000000..0cb53317 --- /dev/null +++ b/test/import/issue-209/parent.js~ @@ -0,0 +1 @@ +import module from "./child.js";