https://github.com/trendyol/mockingstar-ios
Mocking Star SPM helper library for iOS applications.
https://github.com/trendyol/mockingstar-ios
alamofire interceptor mock-server swift urlsession
Last synced: 3 months ago
JSON representation
Mocking Star SPM helper library for iOS applications.
- Host: GitHub
- URL: https://github.com/trendyol/mockingstar-ios
- Owner: Trendyol
- License: mit
- Created: 2023-11-22T10:40:35.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-03T11:24:45.000Z (8 months ago)
- Last Synced: 2025-03-22T05:33:02.009Z (7 months ago)
- Topics: alamofire, interceptor, mock-server, swift, urlsession
- Language: Swift
- Homepage: https://trendyol.github.io/mockingstar/documentation/mockingstar/gettingstarted-ios
- Size: 4.39 MB
- Stars: 48
- Watchers: 10
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Mocking Star 🌟
Mocking Star is a powerful request mocking tool designed to simplify the process of http request mocking, network debugging, and using UI tests for your mobile applications.
With just a single line of code, you can use Mocking Star in your project.
### Key Features
- **Mocking Requests**: Easily mock requests and test different cases with scenarios.
- **Modifying Requests**: Modify intercepted requests to test different edge cases, allowing you to assess your application's performance under different conditions.
- **Debugging Support**: Use Mocking Star to debug your network requests on your mac.
- **UI Testing**: Integrate Mocking Star into your UI tests, creating a reliable and controlled testing environment to validate your mobile application's functionality.Mocking Star App -> [Mocking Star](https://github.com/Trendyol/mockingstar)
Android Library -> [Mocking Star Android Library](https://github.com/Trendyol/mockingstar-android)## Getting Started 🔥
To begin using Mocking Star in your Swift application, simply add the following line of code:```swift
MockingStar.shared.inject()```
This line initializes Mocking Star and prepares it to intercept and process your requests.## How It Works 🚀
Mocking Star operates seamlessly through the use of URLProtocol to intercept incoming requests. Here's a step-by-step how it works:1. **Injection**: With `MockingStar.shared.inject()`, Mocking Star is injected into your application, ready to work its magic.
2. **Request Intercept**: Using the power of URLProtocol, Mocking Star intercepts incoming requests before they leave your application and without change your production code.
3. **Communication with Mocking Star App**: Intercepted requests are communicated to the Mocking Star macOS application.
4. **Processing and Results**: Mocking Star app processes intercepted requests, allowing you to mock, modify, or debug them as needed. The result is then sent back to your application.## Usage Tips ❇️
- **Mocking Requests**: With Mocking Star, mock requests and simulate different scenarios.
- **Modifying Requests**: Modify intercepted requests to test different edge cases.
- **Debugging Support**: Use Mocking Star to debug your network requests on your mac.
- **UI Testing**: Integrate Mocking Star into your UI tests for reliable and controlled testing environments.
- **Custom URLSessionConfiguration**: `MockingStar.sharedinject(configuration: URLSessionConfiguration)`## Installation
**For Xcode project**You can add [mockingstar-ios](https://github.com/Trendyol/mockingstar-ios) to your project as a package.
> `https://github.com/Trendyol/mockingstar-ios`
**For Swift Package Manager**
In `Package.swift` add:
``` swift
dependencies: [
.package(url: "https://github.com/Trendyol/mockingstar-ios", from: "1.0.0"),
]
```## License
This library is released under the MIT license. See [LICENSE](LICENSE) for details.