Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
@babel/traverse
tests for re-exported bindings (#12429)
- Loading branch information
1 parent
285402d
commit b5b95f8
Showing
5 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
packages/babel-traverse/test/fixtures/rename/re-export/input.mjs
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// https://github.com/babel/babel/issues/9266 | ||
|
||
export function x() { | ||
return "YES"; | ||
} | ||
|
||
export { x as someFunction } from './lib2.js' |
3 changes: 3 additions & 0 deletions
3
packages/babel-traverse/test/fixtures/rename/re-export/options.json
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["./plugin"] | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/babel-traverse/test/fixtures/rename/re-export/output.mjs
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// https://github.com/babel/babel/issues/9266 | ||
function a() { | ||
return "YES"; | ||
} | ||
|
||
export { a as x }; | ||
export { x as someFunction } from './lib2.js'; |
9 changes: 9 additions & 0 deletions
9
packages/babel-traverse/test/fixtures/rename/re-export/plugin.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = function() { | ||
return { | ||
visitor: { | ||
Function(path) { | ||
path.scope.rename("x", "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