-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure default exports snapshot synthetic named exports
- Loading branch information
1 parent
683cc6a
commit 84cf854
Showing
9 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
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
2 changes: 1 addition & 1 deletion
2
test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/lib-reexport.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,3 +1,3 @@ | ||
import { named } from './lib-reexport2.js'; | ||
console.log('side-effect', named); | ||
export default named; | ||
export { named as default }; |
2 changes: 1 addition & 1 deletion
2
test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/lib-reexport2.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,3 +1,3 @@ | ||
import { named } from './lib.js'; | ||
console.log('side-effect', named); | ||
export default named; | ||
export { named as default }; |
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
3 changes: 1 addition & 2 deletions
3
test/function/samples/synthetic-named-exports/circular-synthetic-exports/dep.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,2 +1 @@ | ||
import { foo } from './main.js'; | ||
export default foo; | ||
export { foo as default } from './main.js'; |
10 changes: 10 additions & 0 deletions
10
test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/_config.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,10 @@ | ||
module.exports = { | ||
description: 'makes sure default exports of synthetic named exports are snapshots', | ||
options: { | ||
plugins: { | ||
transform() { | ||
return { syntheticNamedExports: '__synthetic' }; | ||
} | ||
} | ||
} | ||
}; |
2 changes: 2 additions & 0 deletions
2
test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/dep.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,2 @@ | ||
import { foo } from './synthetic'; | ||
export default foo; |
6 changes: 6 additions & 0 deletions
6
test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/main.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,6 @@ | ||
import foo from './dep'; | ||
import { update } from './synthetic'; | ||
|
||
assert.strictEqual(foo, 'original'); | ||
update(); | ||
assert.strictEqual(foo, 'original'); |
2 changes: 2 additions & 0 deletions
2
test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/synthetic.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,2 @@ | ||
export const __synthetic = { foo: 'original' }; | ||
export const update = () => (__synthetic.foo = 'reassigned'); |