Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Nov 22, 2022
1 parent 711ae18 commit 22a98dc
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
@@ -0,0 +1,3 @@
import { foo, c } from "./b.js";

export default foo() + c;
@@ -0,0 +1,8 @@
import { foo as old } from "./c";
export * from "./c";

function foo() {
return "fooB" + old();
}

export { foo };
@@ -0,0 +1,5 @@
export function foo() {
return "fooC";
}

export const c = "C";
@@ -0,0 +1,3 @@
if (Date.now() > 0) {
output = require("./a.js").default;
}
12 changes: 12 additions & 0 deletions packages/core/integration-tests/test/scope-hoisting.js
Expand Up @@ -397,6 +397,18 @@ describe('scope hoisting', function () {
assert.equal(output, 15);
});

it('supports re-exporting all exports and overriding individual exports', async function () {
let b = await bundle(
path.join(
__dirname,
'/integration/scope-hoisting/es6/re-export-all-override/index.js',
),
);

let output = await run(b);
assert.strictEqual(output, 'fooBfooCC');
});

it('can import from a different bundle via a re-export (1)', async function () {
let b = await bundle(
path.join(
Expand Down

0 comments on commit 22a98dc

Please sign in to comment.