File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
test/bundler/vite-bundle-test Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,10 @@ describe('vite-bundle', () => {
6767 const page = await browser . newPage ( ) ;
6868
6969 try {
70- await page . goto ( `http://localhost:${ PORT } /` , { waitUntil : 'networkidle0' } ) ;
70+ await page . goto ( `http://localhost:${ PORT } /index.html` , { waitUntil : 'networkidle0' } ) ;
71+
72+ // Ensure the custom element is defined
73+ await page . waitForFunction ( ( ) => ! ! customElements . get ( 'my-component' ) , { timeout : 20000 } ) ;
7174
7275 // Wait for the element to be present
7376 await page . waitForSelector ( 'my-component' , { timeout : 20000 } ) ;
@@ -76,7 +79,12 @@ describe('vite-bundle', () => {
7679 await page . waitForFunction (
7780 ( ) => {
7881 const el = document . querySelector ( 'my-component' ) ;
79- return ! ! el && ! ! ( el as any ) . shadowRoot && ! ! ( el as any ) . shadowRoot . textContent && ( el as any ) . shadowRoot . textContent . trim ( ) . length > 0 ;
82+ return (
83+ ! ! el &&
84+ ! ! ( el as any ) . shadowRoot &&
85+ ! ! ( el as any ) . shadowRoot . textContent &&
86+ ( el as any ) . shadowRoot . textContent . trim ( ) . length > 0
87+ ) ;
8088 } ,
8189 { timeout : 20000 } ,
8290 ) ;
You can’t perform that action at this time.
0 commit comments