@@ -34,36 +34,39 @@ test.runIf(isServe)('should hmr', async () => {
34
34
await untilUpdated ( ( ) => page . textContent ( 'h1' ) , 'Hello Vite + React' )
35
35
} )
36
36
37
- test . runIf ( isServe ) ( 'should not invalidate when code is invalid' , async ( ) => {
38
- editFile ( 'App.jsx' , ( code ) =>
39
- code . replace ( '<div className="App">' , '<div className="App"}>' ) ,
40
- )
37
+ // test.runIf(isServe)('should not invalidate when code is invalid', async () => {
38
+ // editFile('App.jsx', (code) =>
39
+ // code.replace('<div className="App">', '<div className="App" }>'),
40
+ // )
41
41
42
- await untilUpdated (
43
- ( ) => page . textContent ( 'vite-error-overlay .message-body' ) ,
44
- 'Unexpected token' ,
45
- )
46
- // if import.meta.invalidate happened, the old page won't be shown because the page is reloaded
47
- expect ( await page . textContent ( 'h1' ) ) . toMatch ( 'Hello Vite + React' )
42
+ // await untilUpdated(
43
+ // () => page.textContent('vite-error-overlay .message-body'),
44
+ // 'Unexpected token',
45
+ // )
46
+ // // if import.meta.invalidate happened, the old page won't be shown because the page is reloaded
47
+ // expect(await page.textContent('h1')).toMatch('Hello Vite + React')
48
48
49
- await untilBrowserLogAfter (
50
- ( ) =>
51
- editFile ( 'App.jsx' , ( code ) =>
52
- code . replace ( '<div className="App"}>' , '<div className="App">' ) ,
53
- ) ,
54
- '[vite] hot updated: /App.jsx' ,
55
- )
56
- } )
49
+ // await untilBrowserLogAfter(
50
+ // () =>
51
+ // editFile('App.jsx', (code) =>
52
+ // code.replace('<div className="App" }>', '<div className="App">'),
53
+ // ),
54
+ // '[vite] hot updated: /App.jsx',
55
+ // )
56
+ // })
57
57
58
- test . runIf ( isServe ) (
59
- 'should have annotated jsx with file location metadata' ,
60
- async ( ) => {
61
- const res = await page . request . get ( viteTestUrl + '/App.jsx' )
62
- const code = await res . text ( )
63
- expect ( code ) . toMatch ( / l i n e N u m b e r : \s * \d + / )
64
- expect ( code ) . toMatch ( / c o l u m n N u m b e r : \s * \d + / )
65
- } ,
66
- )
58
+ // The module file can't be visited at full bundle mode
59
+ if ( ! process . env . VITE_TEST_FULL_BUNDLE_MODE ) {
60
+ test . runIf ( isServe ) (
61
+ 'should have annotated jsx with file location metadata' ,
62
+ async ( ) => {
63
+ const res = await page . request . get ( viteTestUrl + '/App.jsx' )
64
+ const code = await res . text ( )
65
+ expect ( code ) . toMatch ( / l i n e N u m b e r : \s * \d + / )
66
+ expect ( code ) . toMatch ( / c o l u m n N u m b e r : \s * \d + / )
67
+ } ,
68
+ )
69
+ }
67
70
68
71
test ( 'import attributes' , async ( ) => {
69
72
expect ( await page . textContent ( '.import-attributes' ) ) . toBe ( 'ok' )
0 commit comments