@@ -11,6 +11,7 @@ import {
11
11
page ,
12
12
removeFile ,
13
13
untilBrowserLogAfter ,
14
+ untilUpdated ,
14
15
viteTestUrl ,
15
16
withRetry ,
16
17
} from '~utils'
@@ -131,6 +132,12 @@ test('unassigned import processes', async () => {
131
132
)
132
133
} )
133
134
135
+ test ( 'import glob in package' , async ( ) => {
136
+ expect ( await page . textContent ( '.in-package' ) ) . toBe (
137
+ JSON . stringify ( [ '/pkg-pages/foo.js' ] ) ,
138
+ )
139
+ } )
140
+
134
141
if ( ! isBuild ) {
135
142
test ( 'hmr for adding/removing files' , async ( ) => {
136
143
const resultElement = page . locator ( '.result' )
@@ -190,6 +197,22 @@ if (!isBuild) {
190
197
response = await request . catch ( ( ) => ( { status : ( ) => - 1 } ) )
191
198
expect ( response . status ( ) ) . toBe ( - 1 )
192
199
} )
200
+
201
+ test ( 'hmr for adding/removing files in package' , async ( ) => {
202
+ const resultElement = page . locator ( '.in-package' )
203
+
204
+ addFile ( 'pkg-pages/bar.js' , '// empty' )
205
+ await untilUpdated (
206
+ ( ) => resultElement . textContent ( ) ,
207
+ JSON . stringify ( [ '/pkg-pages/foo.js' , '/pkg-pages/bar.js' ] . sort ( ) ) ,
208
+ )
209
+
210
+ removeFile ( 'pkg-pages/bar.js' )
211
+ await untilUpdated (
212
+ ( ) => resultElement . textContent ( ) ,
213
+ JSON . stringify ( [ '/pkg-pages/foo.js' ] ) ,
214
+ )
215
+ } )
193
216
}
194
217
195
218
test ( 'tree-shake eager css' , async ( ) => {
0 commit comments