Does Playwright Test support globalThis? (typescript/javascript)

  1. I defined in global.d.ts file as the following
declare global {
  var some: string
}

  1. I assigned the value in global.setup.ts as the following
globalThis.some="fff"
  1. I referred it in test file as the following
console.log(globalThis.some)

And I did not see fff in console log, and neither it reports any error.

Any clue?

expecting seeing fff in console log.

  • Is global.setup.ts being run

    – 

Leave a Comment