Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 24 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Unit tests

on:
push:
branches: [ main ]
pull_request:

concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true # Cancel older runs for the same PR/branch

jobs:
build-and-test:
runs-on: macos-15

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: swift build

- name: Test
run: swift test --no-parallel
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
<img width="1280px" src="assets/logo.png">
</p>

<p align="center">
<!-- Unit Tests CI -->
<a href="https://github.com/bstien/HTTPMock/actions/workflows/unit-tests.yml">
<img src="https://github.com/bstien/HTTPMock/actions/workflows/unit-tests.yml/badge.svg" alt="Unit Tests">
</a>
<!-- License -->
<a href="https://github.com/bstien/HTTPMock/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/bstien/HTTPMock.svg" alt="License">
</a>
<!-- SwiftPM -->
<img src="https://img.shields.io/badge/SwiftPM-compatible-orange.svg" alt="SwiftPM Compatible">
<!-- Swift Version -->
<img src="https://img.shields.io/badge/Swift-6.0+-brightgreen.svg" alt="Swift 6.0+">
</p>

A tiny, test-first way to mock `URLSession` — **fast to set up, easy to read, zero test servers**. Queue responses for specific hosts/paths (and optional query params), then run your code against a regular `URLSession` that returns exactly what you told it to.

> **Design goals**: simple, explicit and ergonomic for everyday tests or prototyping. No fixtures or external servers. Just say what a request should get back.
Expand Down