Commit 790f40c
Improve assertGenericTypeAnnotationHasExactlyOneTypeParameter tests (#34942)
Summary:
#34933 has been merged just after I pushed a new commit to the branch to improve tests of `assertGenericTypeAnnotationHasExactlyOneTypeParameter` function, but the last commit was not imported to the internal repository.
The `assertGenericTypeAnnotationHasExactlyOneTypeParameter` can throw different types of Error, and I believe that `.toThrow(Error)` is not specific enough. So I replaced it with `toThrowErrorMatchingInlineSnapshot()`.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Internal] [Changed] - Improve assertGenericTypeAnnotationHasExactlyOneTypeParameter tests in parsers-commons
Pull Request resolved: #34942
Test Plan: Some test cases were ok because the assertGenericTypeAnnotationHasExactlyOneTypeParameter function threw an Error, but for the wrong reason. I've made sure that the error displayed in the inline snapshot is the one we expect.
Reviewed By: cortinico
Differential Revision: D40384993
Pulled By: cipolleschi
fbshipit-source-id: aaa943be1e808af2c5131f7d06baf24bc3bffa311 parent aba6be6 commit 790f40c
File tree
1 file changed
+40
-12
lines changed- packages/react-native-codegen/src/parsers/__tests__
1 file changed
+40
-12
lines changedLines changed: 40 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
90 | 107 | | |
91 | | - | |
92 | 108 | | |
93 | 109 | | |
94 | 110 | | |
| |||
101 | 117 | | |
102 | 118 | | |
103 | 119 | | |
104 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
105 | 123 | | |
106 | 124 | | |
107 | | - | |
108 | | - | |
| 125 | + | |
109 | 126 | | |
110 | 127 | | |
111 | | - | |
| 128 | + | |
| 129 | + | |
112 | 130 | | |
113 | 131 | | |
114 | 132 | | |
| |||
120 | 138 | | |
121 | 139 | | |
122 | 140 | | |
123 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
124 | 145 | | |
| 146 | + | |
125 | 147 | | |
126 | 148 | | |
127 | | - | |
| 149 | + | |
| 150 | + | |
128 | 151 | | |
129 | 152 | | |
130 | 153 | | |
| |||
136 | 159 | | |
137 | 160 | | |
138 | 161 | | |
139 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
140 | 165 | | |
141 | 166 | | |
142 | 167 | | |
143 | | - | |
144 | 168 | | |
145 | 169 | | |
146 | 170 | | |
| |||
156 | 180 | | |
157 | 181 | | |
158 | 182 | | |
159 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
160 | 186 | | |
161 | 187 | | |
162 | 188 | | |
| |||
173 | 199 | | |
174 | 200 | | |
175 | 201 | | |
176 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
177 | 205 | | |
178 | 206 | | |
179 | 207 | | |
| |||
0 commit comments