mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-03 02:21:05 +08:00
This CL simplifies the implementation of the test runner for e2e and interaction tests by moving the test helpers previously found in mocha-extensions.ts to a new mocha interface in mocha-interface.ts. The interface file is provided to mocha using the `-u` option and it will be used by the test runner to process test files. This allows more easily to control the test interface exposed to tests and implementing custom logic before the test is executed without resorting to interception and re-definition of built-in mocha interfaces. This change also eliminates the need to import mocha-extensions.js in every test file. The following features are now exposed to tests: 1) it/it.skip/it.only/it.skipOnPlatforms 2) describe/describe.skip/describe.only/describe.skipOnPlatforms 3) itScreenshot/itScreenshot.only/itScreenshot.skip/itScreenshot.skipOnPlatforms 4) AbortSignal to abort test operations is added to AsyncScope.abortSignal. 5) AsyncScope and screenshots are taken on timeout or error as previously. Cq-Include-Trybots: luci.devtools-frontend.try:cpp_debug_extension_e2e_dbg,cpp_debug_extension_e2e_rel Bug: none Change-Id: I03e3ef145a9bf527631ae99c03384b8ef0179c98 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5804334 Reviewed-by: Simon Zünd <szuend@chromium.org> Reviewed-by: Philip Pfaffe <pfaffe@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>