-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yuyuehui.yyh
committed
Mar 19, 2024
1 parent
a44b42f
commit a6f4f12
Showing
4 changed files
with
11 additions
and
20 deletions.
There are no files selected for viewing
25 changes: 8 additions & 17 deletions
25
e2e/fixtures/tree-shaking.side-effects-true.unused-specifier/expect.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,14 @@ | ||
const assert = require("assert"); | ||
const { parseBuildResult } = require("../../../scripts/test-utils"); | ||
const { parseBuildResult, moduleReg } = require("../../../scripts/test-utils"); | ||
const { files } = parseBuildResult(__dirname); | ||
|
||
const content = files["index.js"]; | ||
|
||
assert( | ||
content.includes("/a.js") && | ||
!content.includes("_a"), | ||
`should remove default specifier` | ||
assert.match( | ||
content, | ||
moduleReg( | ||
"src/index.js", | ||
`__mako_require__\\("src/a.js"\\);[\\s\\S]*__mako_require__\\("src/b.js"\\);[\\s\\S]*__mako_require__\\("src/c.js"\\);` | ||
), | ||
`should remove namespace specifier` | ||
); | ||
|
||
assert( | ||
content.includes("/b.js") && | ||
!content.includes("_b"), | ||
`should remove namespace specifier` | ||
); | ||
|
||
assert( | ||
content.includes("/c.js") && | ||
!content.includes("_c"), | ||
`should remove namespace specifier` | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ const a = 'a'; | |
|
||
console.log('aaa'); | ||
|
||
export default a; | ||
export default a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ const b = 'b'; | |
|
||
console.log('bbb'); | ||
|
||
export default b; | ||
export default b; |
2 changes: 1 addition & 1 deletion
2
e2e/fixtures/tree-shaking.side-effects-true.unused-specifier/src/c.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
console.log('ccc'); | ||
|
||
export const c = 'c'; | ||
export const cc = 'cc'; | ||
export const cc = 'cc'; |