Skip to content

An Easy to use response mocker to your URLRequest for Unit/UITesting!

License

Notifications You must be signed in to change notification settings

michaelhenry/Hijackr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hijackr🛩

CI Status Version License Platform

Installation

Hijackr is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Hijackr'

How to Use

To register:

Hijackr.register()

To unregister:

Hijackr.unregister()

To hijack a request:

Hijackr.hijack(request: request, with: response)

Example:

let request =  URLRequest(url: URL(string: "https://www.google.com")!)
let response = Hijackr.Response(statusCode: 200, body: "hello".data(using: .utf8))
Hijackr.hijack(request: request, with: response)

UnitTest

Test Cases can be found here

Author

michaelhenry, me@iamkel.net

License

Hijackr is available under the MIT license. See the LICENSE file for more info.

About

An Easy to use response mocker to your URLRequest for Unit/UITesting!

Resources

License

Stars

Watchers

Forks

Packages

No packages published