mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 19:13:14 -04:00
## Summary This PR enforces ESLint rules in FTR tests, in particular: - `no-floating-promises` rule to catch unawaited Promises in tests/services/page objects _Why is it important?_ - Keep correct test execution order: cleanup code may run before the async operation is completed, leading to unexpected behavior in subsequent tests - Accurate test results: If a test completes before an async operation (e.g., API request) has finished, Mocha might report the test as passed or failed based on incomplete context. ``` 198:11 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises ``` <img width="716" alt="Screenshot 2024-08-20 at 14 04 43" src="https://github.com/user-attachments/assets/9afffe4c-4b51-4790-964c-c44a76baed1e"> - recommended rules from [eslint-mocha-plugin](https://www.npmjs.com/package/eslint-plugin-mocha) including: - [no-async-describe](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-async-describe.md) - [no-identical-title.md](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-identical-title.md) - [no-sibling-hooks.md](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-sibling-hooks.md) and others Note for reviewers: some tests were skipped due to failures after missing `await` was added. Most likely is a "false positive" case when test is finished before async operation is actually completed. Please work on fixing and re-enabling it --------- Co-authored-by: Tiago Costa <tiago.costa@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
bootstrap_synthtrace.ts | ||
config.ts | ||
ftr_provider_context.ts | ||
obs_api_supertest.ts |