Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Nov 13, 2023
1 parent c88116a commit 029e8e3
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions packages/core/integration-tests/test/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -6428,6 +6428,43 @@ describe('javascript', function () {
}
});

it('should generate valid dependency specifiers for Node with dynamic imports and HMR', async function () {
await fsFixture(overlayFS, __dirname)`
node-dynamic-import-hmr
package.json:
{
"engines": {
"node": ">= 10.0.0"
}
}
index.js:
output(import("./foo"));
foo.js:
export const foo = 123;
yarn.lock:
`;

let b = await bundle(
path.join(__dirname, 'node-dynamic-import-hmr/index.js'),
{
inputFS: overlayFS,
hmrOptions: {},
},
);

let output;
await run(b, {
output(v) {
output = v;
},
});
assert.deepEqual(await output, {foo: 123});
});

for (let shouldScopeHoist of [false, true]) {
let options = {
defaultTargetOptions: {
Expand Down

0 comments on commit 029e8e3

Please sign in to comment.