Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One way to make sure that Playwright fails when encountering TypeScript errors is to use a TypeScript compiler that has the --noEmit flag enabled. This flag prevents TypeScript from generating output files when there are errors, causing the build to fail.

To enable this flag, add the following script to your package.json file:

"scripts": {
  "build": "tsc --noEmit"
}

Then, use the npm run build command to build your project. If there are any TypeScript errors, the build will fail and Playwright will not execute.

Additionally, it is recommended to use a TypeScript linter such as eslint to catch errors earlier in the development process.