Commit 34d102e
ref(tests): Refactor snapshotter and simplify header (#103243)
This is a small refactor to the snapshotter we use in tests, including the following changes:
- Rename a few variables for clarity.
- Stop capturing the header when reading a snapshot file, since we never use it.
- Remove timestamp and creator from the header. The timestamp often causes merge conflicts (and the same information can be gleaned from the commit date), and the creator is hard-coded as 'sentry', which... yeah, okay, but is that news?
- Add test name to `source` entry in header. Yes, by default the test name is included in the snapshot file's path, but that's configurable, so might not always be true. Putting it in the header guarantees the information is easily available.
Note that this PR doesn't actually change the contents of any snapshots. Because snapshot files are only written when they change, and the header isn't actually anything we match on, we have the option to let the dates be removed organically, or to remove them in batches in separate PRs, but either way, this change won't make any current snapshot tests fail in the meantime.1 parent 0a635e9 commit 34d102e
1 file changed
+12
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
179 | 178 | | |
180 | 179 | | |
181 | 180 | | |
182 | | - | |
| 181 | + | |
183 | 182 | | |
184 | 183 | | |
185 | | - | |
| 184 | + | |
186 | 185 | | |
187 | 186 | | |
188 | 187 | | |
| |||
200 | 199 | | |
201 | 200 | | |
202 | 201 | | |
203 | | - | |
| 202 | + | |
204 | 203 | | |
205 | | - | |
| 204 | + | |
206 | 205 | | |
207 | 206 | | |
208 | 207 | | |
209 | | - | |
210 | | - | |
| 208 | + | |
211 | 209 | | |
212 | 210 | | |
213 | 211 | | |
| |||
267 | 265 | | |
268 | 266 | | |
269 | 267 | | |
270 | | - | |
| 268 | + | |
271 | 269 | | |
272 | 270 | | |
273 | 271 | | |
| |||
277 | 275 | | |
278 | 276 | | |
279 | 277 | | |
280 | | - | |
281 | | - | |
282 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
283 | 282 | | |
284 | 283 | | |
285 | 284 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 285 | + | |
| 286 | + | |
301 | 287 | | |
302 | 288 | | |
303 | 289 | | |
| |||
0 commit comments