{"id":38340700,"url":"https://github.com/mattmeyers/assert","last_synced_at":"2026-01-17T02:59:55.078Z","repository":{"id":42979257,"uuid":"469208226","full_name":"mattmeyers/assert","owner":"mattmeyers","description":"Opinionated test assertions.","archived":false,"fork":false,"pushed_at":"2022-03-30T03:52:36.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-17T21:11:37.898Z","etag":null,"topics":["assertions","generics","go","testing","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mattmeyers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-03-12T21:51:16.000Z","updated_at":"2024-04-17T21:11:37.899Z","dependencies_parsed_at":"2022-09-06T16:01:43.312Z","dependency_job_id":null,"html_url":"https://github.com/mattmeyers/assert","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mattmeyers/assert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmeyers%2Fassert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmeyers%2Fassert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmeyers%2Fassert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmeyers%2Fassert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattmeyers","download_url":"https://codeload.github.com/mattmeyers/assert/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattmeyers%2Fassert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"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":["assertions","generics","go","testing","unit-testing"],"created_at":"2026-01-17T02:59:54.458Z","updated_at":"2026-01-17T02:59:55.064Z","avatar_url":"https://github.com/mattmeyers.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# assert\n\n![Build](https://github.com/mattmeyers/assert/actions/workflows/build.yml/badge.svg)\n\n`assert` is an opinionated test assertion libary. It is not intended to fulfill every use case and is not intended to be flexible/extendable.\n\n## Installing\n\nBecause some of the assertions use type parameters, Go 1.18+ is required. This library can be installed with\n\n```sh\ngo get -u github.com/mattmeyers/assert\n```\n\n## Usage\n\nThe assertions found within this library can replace any simple assertion logic normally found in tests. All assertions are marked as `t.Helper`s so stack traces will point to the appropriate line in the test. Additionally, all assertions are not fatal by default. To convert an assertion to a fatal assertion, the `*testing.T` struct can be wrapped with `Fatal()`.\n\nFor example, consider the following function that returns a stringified JSON array.\n\n```go\n// In foo.go\npackage foo\n\nfunc getJSON() string {\n\treturn \"[1,2,3,4,5]\"\n}\n```\n\nThen this test will assert that the JSON contains a certain value.\n\n```go\n// In foo_test.go\npackage foo\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n\n\t\"github.com/mattmeyers/assert\"\n)\n\nfunc TestGetJSONContains3(t *testing.T) {\n\tstr := getJSON()\n\n\tvar values []int\n\terr := json.Unmarshal([]byte(str), \u0026values)\n\t// Will fatally fail test if JSON is malformed\n\tassert.NoError(assert.Fatal(t), err) \n\n\tassert.SliceContains(t, values, 3)\n\t// Will fail test\n\t// assert.SliceContains(t, values, 9)}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattmeyers%2Fassert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattmeyers%2Fassert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattmeyers%2Fassert/lists"}