Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decouple isTesting Platform flag from disabling/enabling animations w…
…hen testing (#38490) Summary: Pull Request resolved: #38490 ## Changelog [Internal] - The internal `Platform.isTesting` is tightly coupled to animations being disabled, which in turn can lead to subtle problems in some of the corner cases: * Since `isTesting` is force override to `false` on JS side in non-dev builds, it means that e2e tests, that would like to use release builds, are out of luck when animation disabling is desired * Conversely, some of the e2e tests may actually rely on animations being enabled in order to work, which means they are also out of luck if trying to test a dev build * Finally, we have cases of hybrid builds, which are build in release on native side, but also have `__DEV__=true` on the native side To both cover the above scenarios, but also to be backwards compatible to all the existing once, this change introduces another flag, `Platform.isDisableAnimations`. The way it works is: * If it's not specified, the e2e tests behaviour will be exactly the same as before, since by default `isDisableAnimations` will be true when `isTesting` is true * If it's specified and is equal to `false`, it means that animations will be still enabled, even if `isTesting` is true (for those e2e tests that rely on animations being enabled) * If it's specified and is equal to 'true', it means that animations will be force disabled, no matter whether we test a release or a dev build Note that this only specifies the JS side of things, defaulting `Platform.isDisableAnimations` to "not specified" (i.e. all the tests will behave as before). Pulling it through for different platforms is done as a separate follow-up. Differential Revision: D47516800 fbshipit-source-id: efcb78f68f9102fec025ecce9a475c9c0bc1ecca
- Loading branch information