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;