Skip to content

Snapshotting.formattedData: use JSONEncoder.OutputFormatting.withoutEscapingSlashes if available#1560

Merged
NachoSoto merged 2 commits into
mainfrom
snapshot-tests-url-encoding
Jun 9, 2022
Merged

Snapshotting.formattedData: use JSONEncoder.OutputFormatting.withoutEscapingSlashes if available#1560
NachoSoto merged 2 commits into
mainfrom
snapshot-tests-url-encoding

Conversation

@NachoSoto

@NachoSoto NachoSoto commented May 10, 2022

Copy link
Copy Markdown
Contributor

This was removed after a PR review comment because it would have lead to different snapshots in iOS 12.

However, since #1504 we have separate snapshots for each iOS version, so this cleans up the output when possible.

Example:

- "url" : "https:\/\/api.revenuecat.com\/v1\/subscribers\/user\/alias"
+ "url" : "https://api.revenuecat.com/v1/subscribers/user/alias"

@NachoSoto NachoSoto requested a review from a team May 10, 2022 18:37
@NachoSoto

Copy link
Copy Markdown
Contributor Author

This will make tests fail, but it'll be a good way to test @joshdholtz's future PR to generate snapshots :) (though we first should fix iOS 12 tests in main).

@NachoSoto NachoSoto force-pushed the snapshot-tests-url-encoding branch from e9ff24d to aba53d6 Compare May 10, 2022 18:40
@NachoSoto NachoSoto force-pushed the snapshot-tests-url-encoding branch from aba53d6 to 9f4f7d5 Compare May 20, 2022 18:29
@NachoSoto NachoSoto changed the base branch from main to any-decodable-ios-12-test May 20, 2022 18:29
@aboedo

aboedo commented May 23, 2022

Copy link
Copy Markdown
Member

what's the status of this one? Is it blocked by #1561?

@NachoSoto

Copy link
Copy Markdown
Contributor Author

I can manually update the snapshots, but it's a perfect test case for #1561 yeah.

Base automatically changed from any-decodable-ios-12-test to main May 24, 2022 17:11
@NachoSoto NachoSoto force-pushed the snapshot-tests-url-encoding branch from 9f4f7d5 to 496c129 Compare May 25, 2022 16:19
NachoSoto added 2 commits June 9, 2022 10:20
…utEscapingSlashes` if available

This was removed after a [PR review comment](#1366 (comment))
because it would have lead to different snapshots in iOS 12.

However, since #1504 we have separate snapshots for each iOS version, so this cleans up the output when possible.

```diff
-    "url" : "https:\/\/api.revenuecat.com\/v1\/subscribers\/user\/alias"
+    "url" : "https://api.revenuecat.com/v1/subscribers/user/alias"
```
@NachoSoto NachoSoto force-pushed the snapshot-tests-url-encoding branch from 496c129 to 132b763 Compare June 9, 2022 17:20
@NachoSoto NachoSoto merged commit 4d387b9 into main Jun 9, 2022
@NachoSoto NachoSoto deleted the snapshot-tests-url-encoding branch June 9, 2022 17:29
@NachoSoto NachoSoto removed the blocked label Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants