{"id":20427972,"url":"https://github.com/pkg/expect","last_synced_at":"2025-04-12T19:22:34.205Z","repository":{"id":57503616,"uuid":"226591514","full_name":"pkg/expect","owner":"pkg","description":"A simple assertion library that you probably shouldn't use.","archived":false,"fork":false,"pushed_at":"2019-12-09T05:39:38.000Z","size":3,"stargazers_count":132,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-26T13:45:23.346Z","etag":null,"topics":["ffs","oh-no","uugh"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pkg.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":"2019-12-07T23:56:29.000Z","updated_at":"2025-02-11T21:34:50.000Z","dependencies_parsed_at":"2022-09-13T08:31:02.950Z","dependency_job_id":null,"html_url":"https://github.com/pkg/expect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fexpect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fexpect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fexpect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg%2Fexpect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pkg","download_url":"https://codeload.github.com/pkg/expect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618975,"owners_count":21134324,"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":["ffs","oh-no","uugh"],"created_at":"2024-11-15T07:23:24.993Z","updated_at":"2025-04-12T19:22:34.165Z","avatar_url":"https://github.com/pkg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# expect [![Travis-CI](https://travis-ci.org/pkg/expect.svg)](https://travis-ci.org/pkg/expect) [![GoDoc](https://godoc.org/github.com/pkg/expect?status.svg)](http://godoc.org/github.com/pkg/expect) [![Report card](https://goreportcard.com/badge/github.com/pkg/expect)](https://goreportcard.com/report/github.com/pkg/expect) [![Sourcegraph](https://sourcegraph.com/github.com/pkg/expect/-/badge.svg)](https://sourcegraph.com/github.com/pkg/expect?badge)\n\nA simple assertion library that you probably shouldn't use.\n\n## Quickstart\n\nPackage `expect` contains various test assertion helpers.\n```go\nfunc TestOpenFile(t *testing.T) {\n        f, err := os.Open(\"notfound\")\n        expect.Nil(err)\n        err = f.Close()\n        expect.True(err == nil)\n}\n```\n`expect` helpers can be called from any function called from the main testing goroutine.\n```bash\n% go test\n--- FAIL: TestOpenFile (0.00s)\n    check_test.go:12: expected: \u003cnil\u003e, got: open notfound: no such file or directory\n``` \n\nConsult the [documentation](https://godoc.org/github.com/pkg/expect) for more information.\n\n## How does this work?\n\n![Magic](https://dave.cheney.net/paste/magic.gif)\n\n## No, seriously, how does this work?\n\n`*testing.T` is recovered dynamically from the call stack. Read the [blog post](https://dave.cheney.net/2019/12/08/dynamically-scoped-variables-in-go).\n\n## License\n\nBSD-2-Clause\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkg%2Fexpect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpkg%2Fexpect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkg%2Fexpect/lists"}