@@ -87,6 +87,48 @@ describe("scalaJSPlugin", () => {
87
87
. toBeNull ( ) ;
88
88
} , testOptions ) ;
89
89
90
+ it ( "works with a project that aggregates other ScalaJS enabled projects) (development)" , async ( ) => {
91
+ const [ plugin , fakePluginContext ] = setup ( {
92
+ projectID : "aggregatedProject" ,
93
+ } ) ;
94
+
95
+ await plugin . configResolved . call ( undefined , { mode : MODE_DEVELOPMENT } ) ;
96
+ await plugin . buildStart . call ( fakePluginContext , { } ) ;
97
+
98
+ const path = normalizeSlashes ( await plugin . resolveId . call ( fakePluginContext , 'scalajs:main.js' ) ) ;
99
+
100
+ expect ( path )
101
+ . toContain ( '/testproject/aggregated-project/target/scala-3.2.2/aggregatedproject-fastopt/main.js' ) ;
102
+
103
+ expect ( path )
104
+ . toMatch ( / ^ [ ^ \t ] / ) ; // Should not start with whitespace
105
+
106
+ expect ( await plugin . resolveId . call ( fakePluginContext , 'scalajs/main.js' ) )
107
+ . toBeNull ( ) ;
108
+ } , testOptions ) ;
109
+
110
+ it ( "works with a project that aggregates other ScalaJS enabled projects) (production)" , async ( ) => {
111
+ const [ plugin , fakePluginContext ] = setup ( {
112
+ projectID : "aggregatedProject" ,
113
+ } ) ;
114
+
115
+ await plugin . configResolved . call ( undefined , { mode : MODE_PRODUCTION } ) ;
116
+ await plugin . buildStart . call ( fakePluginContext , { } ) ;
117
+
118
+ const path = normalizeSlashes ( await plugin . resolveId . call ( fakePluginContext , 'scalajs:main.js' ) ) ;
119
+
120
+ console . log ( "Found path: " + path ) ;
121
+
122
+ expect ( path )
123
+ . toContain ( '/testproject/aggregated-project/target/scala-3.2.2/aggregatedproject-opt/main.js' ) ;
124
+
125
+ expect ( path )
126
+ . toMatch ( / ^ [ ^ \t ] / ) ; // Should not start with whitespace
127
+
128
+ expect ( await plugin . resolveId . call ( fakePluginContext , 'scalajs/main.js' ) )
129
+ . toBeNull ( ) ;
130
+ } , testOptions ) ;
131
+
90
132
it ( "works with a custom URI prefix (development)" , async ( ) => {
91
133
const [ plugin , fakePluginContext ] = setup ( {
92
134
uriPrefix : "customsjs" ,
0 commit comments