docs(best-practises): recommend no-floating-promises (#23487)

https://github.com/microsoft/playwright/issues/23339

Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Pavel Feldman <pavel.feldman@gmail.com>
This commit is contained in:
Max Schmitt 2023-06-06 20:45:46 +02:00 committed by GitHub
parent 8bc26a2b44
commit aab322f2a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -254,6 +254,10 @@ Setup CI/CD and run your tests frequently. The more often you run your tests the
Use Linux when running your tests on CI as it is cheaper. Developers can use whatever environment when running locally but use linux on CI. Use Linux when running your tests on CI as it is cheaper. Developers can use whatever environment when running locally but use linux on CI.
### Lint your tests
Linting the tests helps catching errors early. Use [`@typescript-eslint/no-floating-promises`](https://typescript-eslint.io/rules/no-floating-promises/) [ESLint](https://eslint.org) rule to make sure there are no missing awaits before the asynchronous calls to the Playwright API.
#### Use parallelism and sharding #### Use parallelism and sharding
Playwright runs tests in [parallel](./test-parallel.md) by default. Tests in a single file are run in order, in the same worker process. If you have many independent tests in a single file, you might want to run them in parallel Playwright runs tests in [parallel](./test-parallel.md) by default. Tests in a single file are run in order, in the same worker process. If you have many independent tests in a single file, you might want to run them in parallel