@@ -67,93 +67,93 @@ if (!isBuild) {
6767 await untilUpdated ( ( ) => el . textContent ( ) , '3' )
6868 } )
6969
70- if ( ! process . env . VITE_TEST_FULL_BUNDLE_MODE ) {
71- test ( 'accept dep' , async ( ) => {
72- const el = await page . $ ( '.dep' )
73- await untilBrowserLogAfter (
74- ( ) =>
75- editFile ( 'hmrDep.js' , ( code ) =>
76- code . replace ( 'const foo = 1' , 'const foo = 2' ) ,
77- ) ,
78- [
79- '>>> vite:beforeUpdate -- update' ,
80- '(dep) foo was: 1' ,
81- '(dep) foo from dispose: 1' ,
82- '(single dep) foo is now: 2' ,
83- '(single dep) nested foo is now: 1' ,
84- '(multi deps) foo is now: 2' ,
85- '(multi deps) nested foo is now: 1' ,
86- '[vite] hot updated: /hmrDep.js via /hmr.ts' ,
87- '>>> vite:afterUpdate -- update' ,
88- ] ,
89- true ,
90- )
91- await untilUpdated ( ( ) => el . textContent ( ) , '2' )
70+ test ( 'accept dep' , async ( ) => {
71+ const el = await page . $ ( '.dep' )
72+ await untilBrowserLogAfter (
73+ ( ) =>
74+ editFile ( 'hmrDep.js' , ( code ) =>
75+ code . replace ( 'const foo = 1' , 'const foo = 2' ) ,
76+ ) ,
77+ [
78+ '>>> vite:beforeUpdate -- update' ,
79+ '(dep) foo was: 1' ,
80+ '(dep) foo from dispose: 1' ,
81+ '(single dep) foo is now: 2' ,
82+ '(single dep) nested foo is now: 1' ,
83+ '(multi deps) foo is now: 2' ,
84+ '(multi deps) nested foo is now: 1' ,
85+ '[vite] hot updated: /hmrDep.js via /hmr.ts' ,
86+ '>>> vite:afterUpdate -- update' ,
87+ ] ,
88+ true ,
89+ )
90+ await untilUpdated ( ( ) => el . textContent ( ) , '2' )
9291
93- await untilBrowserLogAfter (
94- ( ) =>
95- editFile ( 'hmrDep.js' , ( code ) =>
96- code . replace ( 'const foo = 2' , 'const foo = 3' ) ,
97- ) ,
98- [
99- '>>> vite:beforeUpdate -- update' ,
100- '(dep) foo was: 2' ,
101- '(dep) foo from dispose: 2' ,
102- '(single dep) foo is now: 3' ,
103- '(single dep) nested foo is now: 1' ,
104- '(multi deps) foo is now: 3' ,
105- '(multi deps) nested foo is now: 1' ,
106- '[vite] hot updated: /hmrDep.js via /hmr.ts' ,
107- '>>> vite:afterUpdate -- update' ,
108- ] ,
109- true ,
110- )
111- await untilUpdated ( ( ) => el . textContent ( ) , '3' )
112- } )
92+ await untilBrowserLogAfter (
93+ ( ) =>
94+ editFile ( 'hmrDep.js' , ( code ) =>
95+ code . replace ( 'const foo = 2' , 'const foo = 3' ) ,
96+ ) ,
97+ [
98+ '>>> vite:beforeUpdate -- update' ,
99+ '(dep) foo was: 2' ,
100+ '(dep) foo from dispose: 2' ,
101+ '(single dep) foo is now: 3' ,
102+ '(single dep) nested foo is now: 1' ,
103+ '(multi deps) foo is now: 3' ,
104+ '(multi deps) nested foo is now: 1' ,
105+ '[vite] hot updated: /hmrDep.js via /hmr.ts' ,
106+ '>>> vite:afterUpdate -- update' ,
107+ ] ,
108+ true ,
109+ )
110+ await untilUpdated ( ( ) => el . textContent ( ) , '3' )
111+ } )
113112
114- test ( 'nested dep propagation' , async ( ) => {
115- const el = await page . $ ( '.nested' )
116- await untilBrowserLogAfter (
117- ( ) =>
118- editFile ( 'hmrNestedDep.js' , ( code ) =>
119- code . replace ( 'const foo = 1' , 'const foo = 2' ) ,
120- ) ,
121- [
122- '>>> vite:beforeUpdate -- update' ,
123- '(dep) foo was: 3' ,
124- '(dep) foo from dispose: 3' ,
125- '(single dep) foo is now: 3' ,
126- '(single dep) nested foo is now: 2' ,
127- '(multi deps) foo is now: 3' ,
128- '(multi deps) nested foo is now: 2' ,
129- '[vite] hot updated: /hmrDep.js via /hmr.ts' ,
130- '>>> vite:afterUpdate -- update' ,
131- ] ,
132- true ,
133- )
134- await untilUpdated ( ( ) => el . textContent ( ) , '2' )
113+ test ( 'nested dep propagation' , async ( ) => {
114+ const el = await page . $ ( '.nested' )
115+ await untilBrowserLogAfter (
116+ ( ) =>
117+ editFile ( 'hmrNestedDep.js' , ( code ) =>
118+ code . replace ( 'const foo = 1' , 'const foo = 2' ) ,
119+ ) ,
120+ [
121+ '>>> vite:beforeUpdate -- update' ,
122+ '(dep) foo was: 3' ,
123+ '(dep) foo from dispose: 3' ,
124+ '(single dep) foo is now: 3' ,
125+ '(single dep) nested foo is now: 2' ,
126+ '(multi deps) foo is now: 3' ,
127+ '(multi deps) nested foo is now: 2' ,
128+ '[vite] hot updated: /hmrDep.js via /hmr.ts' ,
129+ '>>> vite:afterUpdate -- update' ,
130+ ] ,
131+ true ,
132+ )
133+ await untilUpdated ( ( ) => el . textContent ( ) , '2' )
135134
136- await untilBrowserLogAfter (
137- ( ) =>
138- editFile ( 'hmrNestedDep.js' , ( code ) =>
139- code . replace ( 'const foo = 2' , 'const foo = 3' ) ,
140- ) ,
141- [
142- '>>> vite:beforeUpdate -- update' ,
143- '(dep) foo was: 3' ,
144- '(dep) foo from dispose: 3' ,
145- '(single dep) foo is now: 3' ,
146- '(single dep) nested foo is now: 3' ,
147- '(multi deps) foo is now: 3' ,
148- '(multi deps) nested foo is now: 3' ,
149- '[vite] hot updated: /hmrDep.js via /hmr.ts' ,
150- '>>> vite:afterUpdate -- update' ,
151- ] ,
152- true ,
153- )
154- await untilUpdated ( ( ) => el . textContent ( ) , '3' )
155- } )
135+ await untilBrowserLogAfter (
136+ ( ) =>
137+ editFile ( 'hmrNestedDep.js' , ( code ) =>
138+ code . replace ( 'const foo = 2' , 'const foo = 3' ) ,
139+ ) ,
140+ [
141+ '>>> vite:beforeUpdate -- update' ,
142+ '(dep) foo was: 3' ,
143+ '(dep) foo from dispose: 3' ,
144+ '(single dep) foo is now: 3' ,
145+ '(single dep) nested foo is now: 3' ,
146+ '(multi deps) foo is now: 3' ,
147+ '(multi deps) nested foo is now: 3' ,
148+ '[vite] hot updated: /hmrDep.js via /hmr.ts' ,
149+ '>>> vite:afterUpdate -- update' ,
150+ ] ,
151+ true ,
152+ )
153+ await untilUpdated ( ( ) => el . textContent ( ) , '3' )
154+ } )
156155
156+ if ( ! process . env . VITE_TEST_FULL_BUNDLE_MODE ) {
157157 test ( 'invalidate' , async ( ) => {
158158 const el = await page . $ ( '.invalidation-parent' )
159159 await untilBrowserLogAfter (
0 commit comments