Rename Jest snapshots to be platform agnostic #1247
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Platforms Impacted
Description of changes
Previously, most of our snapshot tests were of the form
<component>.test.win32.tsx
. As it turns out, this doesn't actually test win32 specifically, jest doesn't use the platform suffix to test per platform. When I did aconsole.log(Platform)
inside a win32 jest test (running on a macOS machine), it printed outandroid
. This behavior seems to be inline with this upstream issue (jestjs/jest#1370 (comment)) that confirms that jest doesn't actually run tests platform specifically.As such, let's rename our snapshot tests to make it more clear they are actually not win32 tests, but platform agnostic tests, seemingly defaulting to either iOS or Android (not sure which one, I've seen conflicting reports). Worth noting the issue I linked details a solution to get platform specific tests, but that seemed like a larger change than what I wanted to achieve with this PR.
Verification
yarn test
locally passes. CI passing should be good enough confirmation.Pull request checklist
This PR has considered (when applicable):