File tree Expand file tree Collapse file tree 5 files changed +29
-5
lines changed
turbopack/crates/turbopack-tests/tests/execution/turbopack/collect/basic Expand file tree Collapse file tree 5 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 1+ export function unusedHelper ( ) {
2+ return 'this is unused helper'
3+ }
Original file line number Diff line number Diff line change 1+ import { unusedHelper } from './c-unused'
2+
3+ export function c ( ) {
4+ return 'this is c.js'
5+ }
6+
7+ export function unused ( ) {
8+ return unusedHelper ( )
9+ }
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ const getList = __turbopack_collect__({
77it ( 'should work' , async ( ) => {
88 const list = getList ( )
99 expect ( list ) . toEqual ( [
10+ expect . objectContaining ( {
11+ id : '[project]/turbopack/crates/turbopack-tests/tests/execution/turbopack/collect/basic/input/c.js [test] (ecmascript)' ,
12+ data : 'data-for-c' ,
13+ } ) ,
1014 expect . objectContaining ( {
1115 id : '[project]/turbopack/crates/turbopack-tests/tests/execution/turbopack/collect/basic/input/a.js [test] (ecmascript)' ,
1216 data : 'data-for-a' ,
@@ -17,6 +21,10 @@ it('should work', async () => {
1721 } ) ,
1822 ] )
1923
20- expect ( ( await list [ 0 ] . import ( ) ) . a ( ) ) . toEqual ( 'this is a.js' )
21- expect ( ( await list [ 1 ] . import ( ) ) . b ( ) ) . toEqual ( 'this is b.js' )
24+ expect ( ( await list [ 0 ] . import ( ) ) . c ( ) ) . toEqual ( 'this is c.js' )
25+ expect ( ( await list [ 1 ] . import ( ) ) . a ( ) ) . toEqual ( 'this is a.js' )
26+ expect ( ( await list [ 2 ] . import ( ) ) . b ( ) ) . toEqual ( 'this is b.js' )
27+
28+ const modules = Array . from ( __turbopack_modules__ . keys ( ) )
29+ expect ( modules ) . not . toContainEqual ( expect . stringMatching ( / i n p u t \/ c - u n u s e d / ) )
2230} )
Original file line number Diff line number Diff line change @@ -3,7 +3,12 @@ __turbopack_emit__('./a.js', {
33 data : 'data-for-a' ,
44} )
55
6- console . log ( 'this is lib.js' )
6+ __turbopack_emit__ ( './c.js' , {
7+ namespace : 'my-test' ,
8+ data : 'data-for-c' ,
9+ exports : [ 'c' ] ,
10+ } )
11+
712export default function ( ) {
813 import ( './async' )
914}
Original file line number Diff line number Diff line change 11{
2- "inferModuleSideEffects" : false ,
3- "removeUnusedExports" : false
2+ "scopeHoisting" : false
43}
You can’t perform that action at this time.
0 commit comments