{"id":26351539,"url":"https://github.com/filozoff/xctestextension","last_synced_at":"2026-02-17T06:01:34.178Z","repository":{"id":38051610,"uuid":"489056636","full_name":"Filozoff/XCTestExtension","owner":"Filozoff","description":"A collection of additional assertion methods for `XCTest` framework.","archived":false,"fork":false,"pushed_at":"2025-03-18T19:36:09.000Z","size":262,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-15T02:16:02.935Z","etag":null,"topics":["swift","test","tests","unit-testing","xctest"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Filozoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-05T16:55:29.000Z","updated_at":"2025-03-18T19:33:46.000Z","dependencies_parsed_at":"2025-02-25T17:27:56.474Z","dependency_job_id":"4f733974-c6df-45bb-93ee-be1606d87f79","html_url":"https://github.com/Filozoff/XCTestExtension","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/Filozoff/XCTestExtension","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Filozoff%2FXCTestExtension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Filozoff%2FXCTestExtension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Filozoff%2FXCTestExtension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Filozoff%2FXCTestExtension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Filozoff","download_url":"https://codeload.github.com/Filozoff/XCTestExtension/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Filozoff%2FXCTestExtension/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29535934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T05:00:25.817Z","status":"ssl_error","status_checked_at":"2026-02-17T04:57:16.126Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["swift","test","tests","unit-testing","xctest"],"created_at":"2025-03-16T10:33:00.088Z","updated_at":"2026-02-17T06:01:34.128Z","avatar_url":"https://github.com/Filozoff.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![XCTestExtension: XCTest assertions and helpers](Images/XCTestExtensionLogo-dark.png#gh-dark-mode-only)\n![XCTestExtension: XCTest assertions and helpers](Images/XCTestExtensionLogo-light.png#gh-light-mode-only)\n\n# XCTestExtension\n\n[![CI](https://github.com/Filozoff/XCTestExtension/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Filozoff/XCTestExtension/actions/workflows/ci.yml)\n[![Codecov](https://codecov.io/gh/Filozoff/XCTestExtension/branch/master/graph/badge.svg)](https://codecov.io/gh/Filozoff/XCTestExtension)\n[![Swift Supported Versions](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FFilozoff%2FXCTestExtension%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/Filozoff/XCTestExtension)\n[![Platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FFilozoff%2FXCTestExtension%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/Filozoff/XCTestExtension)\n![Swift Package Manager](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-green)\n![GitHub](https://img.shields.io/github/license/Filozoff/XCTestExtension)\n\nThe framework provides additional assertion methods like:\n- throwing `Error` type check\n- throwing specific `Error` check when it conforms to `Equatable`\n- timeouting `async` operations\n- values difference\n\nand helpers for `Combine`'s `Publisher`s testing.\n\n## Example usage\n\n### Work with structured concurrency\n\nIt may happen that `async` operations don't return a value or don't throw any error (e.g. when converting from closures or `Combine`). In that case, they will hang out for infinity. The [XCTTimeout](https://filozoff.github.io/XCTestExtension/documentation/xctestextension/xctest/xctestcase/xcttimeout(_:timeout:_:file:line:)) catches that issue and throws an error, unblocking the hanging async task.\n\n```swift\nfunc test_whenGetDetails_thenReceivedExpectedDetails() {\n\n    (...)\n\n    // when\n    let details = try await XCTTimeout(\n        await sut.getDetails(),\n        timeout: 0.01\n    )\n\n    // then\n    XCTAssertEqual(details, expectedDetails)\n}\n```\n\n### Work with `Combine`'s `Publisher` and expectation\n\nUse [`PublisherExpectation`](https://filozoff.github.io/XCTestExtension/documentation/xctestextension/publisherexpectation) to simplify work with `Publisher`'s streams and avoid boilerplate code.\n\nAs an example, for a stream value observation, use `receivedValue(predicate:)`. To expect a specific value received from the stream, set the `predicate` parameter to:\n\n```swift\npredicate: { $0 == expectedValue }\n```\n\nA complete code example is below:\n\n```swift\nfunc test_givenValue_whenPublisherSend_thenReceivedExpectedValueInStream() {\n\n    // given\n    let value = \"charizard\"\n    let expectedValue = value\n    let sut = PassthroughSubject\u003cString, Error\u003e()\n    let expectation = PublisherExpectation(\n        sut,\n        observation: .receivedValue(\n            predicate: { $0 == expectedValue }\n        ),\n        description : \"Publisher did not receive expected value \\(expectedValue)\"\n    )\n\n    // when\n    sut.send(value)\n\n    // then\n    wait(for: [expectation], timeout: 0.01)\n}\n```\n\nUse `.anyReceived()` convenience method where the value received from the stream does not matter.\n\nFor stream termination expectation, use `.completion(predicate:)` or `.anyCompletion()`.\n\n### Additional assertions\n\n`XCTAssertEqual` does not provide a readable output for not equal values. Use `XCTAssertNoDiff` to receive a readable diff.\n\n`XCTAssertNoDiff` relies on [Difference](https://github.com/krzysztofzablocki/Difference) created by [Krzysztof Zabłocki](https://github.com/krzysztofzablocki).\n\n## Documentation\n\nDocumentation is generated by DocC.\n\n[Getting started can be found here](https://filozoff.github.io/XCTestExtension/documentation/xctestextension/gettingstarted).\n\n[Full documentation can be found here](https://filozoff.github.io/XCTestExtension/).\n\n## Requirements\n\n| Item | Minimum tool version |\n| --- | --- |\n| Swift | 5.8 |\n| Xcode | 14.3 |\n\n| Item | Minimum target version |\n| --- | --- |\n| iOS | 13.0 |\n| macOS | 10.15 |\n| watchOS | 6.0 |\n| tvOS | 13.0 |\n\n## Installation\n\n### Swift Package Manager\n\n[The Swift Package Manager](https://www.swift.org/package-manager/) is a tool for automating the distribution of [Swift](https://www.swift.org) code and is integrated into the swift compiler.\n\nOnce you have your Swift package set up, add XCTestExtension as a dependency to your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/Filozoff/XCTestExtension.git\", branch: \"master\")\n]\n```\nand add it to you `testTarget`'s dependencies:\n```swift\ntargets: [\n    (...)\n    .testTarget(\n        (...)\n        dependencies: [\n            (...)\n            \"XCTestExtension\"\n        ]\n    )\n]\n```\n\n### Xcode project (Swift Package Manager)\n\n1. Go to **File-\u003eAdd Packages...**\n2. Paste `https://github.com/Filozoff/XCTestExtension.git` in **\"Search or Enter Package URL\"**\n3. Choose **Dependency Rule** and **Project** suited to you needs and go to **Add Package**\n4. Choose your test target under **Add to Target** and go to **Add Package**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilozoff%2Fxctestextension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilozoff%2Fxctestextension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilozoff%2Fxctestextension/lists"}