{"id":18473413,"url":"https://github.com/0xopenbytes/test","last_synced_at":"2025-05-13T00:45:40.191Z","repository":{"id":130053404,"uuid":"610029372","full_name":"0xOpenBytes/Test","owner":"0xOpenBytes","description":"🧪 Expect and assert","archived":false,"fork":false,"pushed_at":"2023-03-31T16:54:14.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T00:45:33.165Z","etag":null,"topics":["functional","ios","macos","swift","testing","tests","tvos","unit-testing","watchos"],"latest_commit_sha":null,"homepage":"https://0xopenbytes.github.io/Test/","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/0xOpenBytes.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":"2023-03-05T23:34:20.000Z","updated_at":"2024-01-07T20:45:20.000Z","dependencies_parsed_at":"2023-04-05T13:49:22.922Z","dependency_job_id":null,"html_url":"https://github.com/0xOpenBytes/Test","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2FTest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2FTest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2FTest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2FTest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xOpenBytes","download_url":"https://codeload.github.com/0xOpenBytes/Test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253850875,"owners_count":21973671,"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":["functional","ios","macos","swift","testing","tests","tvos","unit-testing","watchos"],"created_at":"2024-11-06T10:24:46.555Z","updated_at":"2025-05-13T00:45:40.171Z","avatar_url":"https://github.com/0xOpenBytes.png","language":"Swift","readme":"# Test\n\n*🧪 Expect and assert*\n\n## What is `Test`?\n\n`Test` is a simple testing function that allows you to create test suites with multiple steps, expectations, and assertions. You can specify a name for the test suite, an instance of the `Tester` class to be used for running the tests, and a closure that contains the test steps.\n\n## Where can `Test` be used?\n\n`Test` can be used anywhere! `Test` can be used to test quickly inside a function to make sure something is working as expected. It is especially useful when you want to test a complex piece of code with multiple steps and assertions. `Test` can even be used for your unit tests!\n\n## Examples\n\n### Simple test with assertions\n\n```swift\ntry await Test(named: \"Test someMethod()\") { tester in\n    try tester.assert(SomeClass.someMethod())\n    try await tester.assertNoThrows(try await SomeClass.someOtherMethod())\n    try tester.assert(SomeClass.someBooleanValue, isEqualTo: false)\n}\n```\n\n### Test with expectations\n\n```swift\ntry Test(named: \"Test someMethod() with expectations\") { tester in\n    try Expect(\"First step should succeed\") {\n        try SomeClass.someMethod()\n    }\n    \n    tester.logInfo(\"Just finished first step\")\n\n    try Expect(\"Second step should succeed\") {\n        try SomeClass.someOtherMethod()\n    }\n            \n    tester.logWarning(\"Something unexpected happened during the second step\")\n\n    try Expect(\"Final assertion should be true\") {\n        try tester.assert(SomeClass.someBooleanValue)\n    }\n    \n    tester.logSuccess(\"All steps and assertions passed!\")\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xopenbytes%2Ftest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xopenbytes%2Ftest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xopenbytes%2Ftest/lists"}