{"id":13995095,"url":"https://github.com/mochidev/XCTAsync","last_synced_at":"2025-07-22T21:32:05.300Z","repository":{"id":63918717,"uuid":"533097337","full_name":"mochidev/XCTAsync","owner":"mochidev","description":"Swift library to more easily test async code","archived":false,"fork":false,"pushed_at":"2022-09-06T16:07:40.000Z","size":7,"stargazers_count":35,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-23T10:43:30.582Z","etag":null,"topics":["swift","swift-concurrency","swift-package-manager","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/mochidev.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}},"created_at":"2022-09-05T23:59:35.000Z","updated_at":"2024-08-28T13:23:15.000Z","dependencies_parsed_at":"2023-01-14T14:00:43.240Z","dependency_job_id":null,"html_url":"https://github.com/mochidev/XCTAsync","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochidev%2FXCTAsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochidev%2FXCTAsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochidev%2FXCTAsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochidev%2FXCTAsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mochidev","download_url":"https://codeload.github.com/mochidev/XCTAsync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227177776,"owners_count":17743165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","swift-concurrency","swift-package-manager","xctest"],"created_at":"2024-08-09T14:03:14.881Z","updated_at":"2024-11-29T17:31:01.950Z","avatar_url":"https://github.com/mochidev.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# XCTAsync\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://swiftpackageindex.com/mochidev/XCTAsync\"\u003e\n\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmochidev%2FXCTAsync%2Fbadge%3Ftype%3Dswift-versions\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://swiftpackageindex.com/mochidev/XCTAsync\"\u003e\n\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmochidev%2FXCTAsync%2Fbadge%3Ftype%3Dplatforms\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/mochidev/XCTAsync/actions?query=workflow%3A%22Test+XCTAsync%22\"\u003e\n\u003cimg src=\"https://github.com/mochidev/XCTAsync/workflows/Test%20XCTAsync/badge.svg\" alt=\"Test Status\" /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n`XCTAsync` redefines many `XCTAssert` functions as async functions within asynchronous contexts.\n\n## Installation\n\nAdd `XCTAsync` as a dependency in your `Package.swift` file to start using it. Then, add `import XCTAssert` to any file you wish to use the library in.\n\nPlease check the [releases](https://github.com/mochidev/XCTAsync/releases) for recommended versions.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/mochidev/XCTAsync.git\", .upToNextMajor(from: \"1.0.0\")),\n],\n...\ntargets: [\n    .testTarget(\n        name: \"MyPackageTests\",\n        dependencies: [\n            \"XCTAsync\",\n        ]\n    )\n]\n```\n\n## What is `XCTAsync`?\n\n`XCTAsync` is a collection of functions for testing asynchonous code:\n\n```swift\nimport XCTest\nimport XCTAsync\n\nfunc testAsyncMethods() async {\n    await XCTAssertTrue(await asynchronousMethod())\n}\n```\n\nNote that `XCTAsync` is only necessary for async methods, and will not be overloaded in synchronous contexts:\n\n```swift\nimport XCTest\nimport XCTAsync\n\nfunc testSyncMethods() {\n    XCTAssertTrue(synchronousMethod())\n}\n```\n\nHowever, if you are in an asynchronous test, you'll need to use the asynchronous variants for each assert:\n\n```swift\nimport XCTest\nimport XCTAsync\n\nfunc testSyncMethods() async {\n    await XCTAssertTrue(synchronousMethod())\n}\n```\n\n## Contributing\n\nContribution is welcome! Please take a look at the issues already available, or start a new issue to discuss a new feature. Although guarantees can't be made regarding feature requests, PRs that fit with the goals of the project and that have been discussed before hand are more than welcome!\n\nPlease make sure that all submissions have clean commit histories, are well documented, and thoroughly tested. **Please rebase your PR** before submission rather than merge in `main`. Linear histories are required.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmochidev%2FXCTAsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmochidev%2FXCTAsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmochidev%2FXCTAsync/lists"}