Skip to content

Commit

Permalink
test: ✅ add test case for export named ased twice
Browse files Browse the repository at this point in the history
  • Loading branch information
stormslowly committed Jan 9, 2024
1 parent 3527cd9 commit 53f756d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const assert = require('assert');
const { parseBuildResult } = require('../../../scripts/test-utils');
const { files } = parseBuildResult(__dirname);

const content = files['index.js'];

assert(!content.includes('src/dep/proxy.js'), `should skip middle files`);

assert(content.match(/v1:\s+function\(\) {\s+return _dep\.default;\s+}/), `shoule export v1 ref to _dep.default`)

Check warning on line 9 in e2e/fixtures/tree-shaking.skip_module.reexport_same_name_twice/expect.js

View workflow job for this annotation

GitHub Actions / Spell Check

"shoule" should be "should".
assert(content.match(/v2:\s+function\(\) {\s+return _dep\.default;\s+}/), `shoule export v2 ref to _dep.default`)

Check warning on line 10 in e2e/fixtures/tree-shaking.skip_module.reexport_same_name_twice/expect.js

View workflow job for this annotation

GitHub Actions / Spell Check

"shoule" should be "should".
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"optimizePackageImports": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { default as v1, default as v2 } from './proxy.js';

console.log('sideEffects')
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './dep.js'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { v1, v2 } from './dep/index.js';

console.log(v1,v2);

0 comments on commit 53f756d

Please sign in to comment.