1414 * limitations under the License.
1515 */
1616
17- /* eslint-disable @typescript-eslint/no-unsafe-return */
18-
1917import { test , expect } from '@playwright/test' ;
2018import fs from 'node:fs' ;
2119import path from 'node:path' ;
@@ -138,7 +136,7 @@ foldersToTest.forEach((sampleFolder) => {
138136 test ( `test ${ sampleFolder } ` , async ( { page } ) => {
139137 // START run the preview
140138 // Get an available port
141- const port = 8080 ;
139+ const port = ' 8080' ;
142140 const url = `http://localhost:${ port } /` ;
143141
144142 const viteProcess = childProcess . spawn (
@@ -205,8 +203,9 @@ foldersToTest.forEach((sampleFolder) => {
205203
206204 // Wait for Google Maps to load.
207205 await page . waitForFunction (
208- // eslint-disable-next-line @typescript-eslint/no-explicit-any
209- ( ) => ( window as any ) . google ?. maps ,
206+ ( ) =>
207+ ( window as typeof window & { google ?: { maps ?: unknown } } )
208+ . google ?. maps ,
210209 { timeout : 500 }
211210 ) ;
212211
@@ -216,12 +215,10 @@ foldersToTest.forEach((sampleFolder) => {
216215 // Assertions. These must be met or the test will fail.
217216 // The sample must load the Google Maps API.
218217 const hasGoogleMaps = await page . evaluate ( ( ) => {
219- return (
220- // eslint-disable-next-line @typescript-eslint/no-explicit-any
221- typeof ( window as any ) . google !== 'undefined' &&
222- // eslint-disable-next-line @typescript-eslint/no-explicit-any
223- typeof ( window as any ) . google . maps !== 'undefined'
224- ) ;
218+ const w = window as typeof window & {
219+ google ?: { maps ?: unknown } ;
220+ } ;
221+ return typeof w . google ?. maps !== 'undefined' ;
225222 } ) ;
226223 expect ( hasGoogleMaps ) . toBeTruthy ( ) ;
227224
@@ -240,7 +237,7 @@ foldersToTest.forEach((sampleFolder) => {
240237 process . kill ( viteProcess . pid , 'SIGINT' ) ;
241238 } catch ( error ) {
242239 console . warn (
243- `Failed to kill Vite process for ${ sampleFolder } (PID: ${ viteProcess . pid } ):` ,
240+ `Failed to kill Vite process for ${ sampleFolder } (PID: ${ String ( viteProcess . pid ) } ):` ,
244241 error
245242 ) ;
246243 }
0 commit comments