Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for chained reexports from a hybrid module #7980

Merged
merged 6 commits into from May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,3 @@
import b from './b';

output = b.foo + b.bar;
@@ -0,0 +1,2 @@
import * as c from './c';
export default c;
@@ -0,0 +1,2 @@
export foo from './d';
export const bar = require('./d');
@@ -0,0 +1 @@
module.exports = 1;
@@ -0,0 +1,3 @@
import {foo, bar} from './b';

output = foo + bar;
@@ -0,0 +1 @@
export * from './c';
@@ -0,0 +1,2 @@
export foo from './d';
export const bar = require('./d');
@@ -0,0 +1 @@
module.exports = 1;
22 changes: 22 additions & 0 deletions packages/core/integration-tests/test/scope-hoisting.js
Expand Up @@ -1997,6 +1997,28 @@ describe('scope hoisting', function () {
assert(new output[3]() instanceof output[2]);
});

it('should support chained reexports from hybrid modules', async function () {
let b = await bundle(
path.join(
__dirname,
'/integration/scope-hoisting/es6/re-export-hybrid/a.js',
),
);
let output = await run(b);
assert.strictEqual(output, 2);
});

it('should support chained reexports as default from hybrid modules', async function () {
let b = await bundle(
path.join(
__dirname,
'/integration/scope-hoisting/es6/re-export-default-hybrid/a.js',
),
);
let output = await run(b);
assert.strictEqual(output, 2);
});

it('support chained namespace reexports of CommonJS', async function () {
let b = await bundle(
path.join(
Expand Down