Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignoring query example swap i/o url #54

Merged
merged 1 commit into from
May 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ URLSession.shared.dataTask(with: originalURL) { (data, response, error) in
Some URLs like authentication URLs contain timestamps or UUIDs in the query. To mock these you can ignore the Query for a certain URL:

``` swift
/// Would transform to "https://www.example.com/api/authentication?oauth_timestamp=151817037" for example.
let originalURL = URL(string: "https://www.example.com/api/authentication")!
/// Would transform to "https://www.example.com/api/authentication" for example.
let originalURL = URL(string: "https://www.example.com/api/authentication?oauth_timestamp=151817037")!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very sharp, indeed! 💪


let mock = Mock(url: originalURL, ignoreQuery: true, dataType: .json, statusCode: 200, data: [
.get : MockedData.exampleJSON.data // Data containing the JSON response
Expand Down