-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create first "real" runtime test suite (#5794)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> ## Summary Previous tests were created to test and debug testing environment. <table> <tr><td width="50%">Changes</td><td width="50%">Why</td></tr> <tr><td> Increase max line width for all files in app/src/examples/RuntimeTests </td><td> It's convenient to have one set of test parameters in one line </td></tr> <tr><td> Disable prettier for all snapshot files ``` diff + app/**/*.snapshot.ts ``` </td><td>It allows to have one snapshot per line. The file is better organised and you can immediately see how many individual snapshots you have</td> </tr> <tr><td>Improve snapshot mismatch formatting, create the following function to have equal length for all the printed numbers ```jsx export function appendWhiteSpaceToMatchLength( message: string | number, length: number ) ``` > [!WARNING] > Temporarily the function throws an error when message has less characters than length </td> <td> It allows to quickly see the difference between the recorded and actual snapshot. <img width="443" alt="image" src="https://github.com/software-mansion/react-native-reanimated/assets/56199675/fd0ca951-c330-4f54-8856-da1ec968dc94"> </td> </tr> <tr><td>Change the way we render component in test - don't display anything if no component is provided</td><td>We can render invisible components (white views on white backgrounds) to reduce blinking and flickering </td></tr> <tr><td> Add test.each syntax like in jest <a href="https://jestjs.io/docs/api#testeachtablename-fn-timeout">LINK</a> </td><td> Possibility to create simpler tests </td></tr> </table> ## Recording https://github.com/software-mansion/react-native-reanimated/assets/56199675/eb923b01-226a-42c5-b6a2-d202e90414d1 ## Full test logs ![image](https://github.com/software-mansion/react-native-reanimated/assets/56199675/5516e257-9688-4986-9bc6-2c1f0ffc255d) <!-- Explain the motivation for this PR. Include "Fixes #<number>" if applicable. --> ## Test plan <!-- Provide a minimal but complete code snippet that can be used to test out this change along with instructions how to run it and a description of the expected behavior. --> --------- Co-authored-by: Latropos <aleksandracynk@Aleksandras-MacBook-Pro-3.local> Co-authored-by: Latropos <aleksandracynk@aleksandras-macbook-pro-3.home>
- Loading branch information
1 parent
3163572
commit 52c86f1
Showing
24 changed files
with
860 additions
and
570 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
plugin/**/*.js | ||
!plugin/**/*.json | ||
app/**/*.snapshot.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
arrowParens: 'avoid', | ||
bracketSameLine: true, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
printWidth: 120, // Increase line width to make test cases more compact | ||
}; |
14 changes: 4 additions & 10 deletions
14
app/src/examples/RuntimeTests/ReanimatedRuntimeTestsRunner/Asserts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
app/src/examples/RuntimeTests/ReanimatedRuntimeTestsRunner/LogMessageUtils.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.