From aab322f2a182bb27fc5eddf42940a50fcc61f385 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 6 Jun 2023 20:45:46 +0200 Subject: [PATCH] docs(best-practises): recommend no-floating-promises (#23487) https://github.com/microsoft/playwright/issues/23339 Signed-off-by: Max Schmitt Co-authored-by: Pavel Feldman --- docs/src/best-practices-js.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/src/best-practices-js.md b/docs/src/best-practices-js.md index af814f5dca..fbe82c5015 100644 --- a/docs/src/best-practices-js.md +++ b/docs/src/best-practices-js.md @@ -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. +### 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 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