{"id":19209651,"url":"https://github.com/xtruder/go-testparrot","last_synced_at":"2026-06-03T16:31:00.499Z","repository":{"id":38354251,"uuid":"328249818","full_name":"xtruder/go-testparrot","owner":"xtruder","description":"Golang tool to record and replay expected test values, just like a parrot :parrot: :bird:","archived":false,"fork":false,"pushed_at":"2023-05-19T15:56:59.000Z","size":67,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-04T16:36:04.811Z","etag":null,"topics":["automation","golang","record","recorder","replay","test-automation","testing","tool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xtruder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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":"2021-01-09T21:31:17.000Z","updated_at":"2022-02-01T08:11:59.000Z","dependencies_parsed_at":"2024-06-20T21:51:18.009Z","dependency_job_id":"be406dfa-5ed5-49f2-8432-4064966fe68d","html_url":"https://github.com/xtruder/go-testparrot","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/xtruder%2Fgo-testparrot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtruder%2Fgo-testparrot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtruder%2Fgo-testparrot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtruder%2Fgo-testparrot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtruder","download_url":"https://codeload.github.com/xtruder/go-testparrot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240281483,"owners_count":19776515,"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":["automation","golang","record","recorder","replay","test-automation","testing","tool"],"created_at":"2024-11-09T13:32:29.680Z","updated_at":"2025-11-14T16:03:04.273Z","avatar_url":"https://github.com/xtruder.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![tests](https://github.com/xtruder/go-testparrot/workflows/test/badge.svg)\n\n# go-testparrot :parrot:\n\ngo-testparrot records and replies expected test values, so you don't have\nto hardcode complex test values.\n\n## About\n\nAre you **tired of hard coding** values in tests?\nDo you **copy paste failed test values** like as monkey?\n\n**What if there would be a record button to record test values and reply them\nlater, just like a parrot!**\n\n### Features\n\n- Simple interface for record and reply values based on sequential or key value.\n- Generation of recorded values in readable go code.\n\n## Quick start\n\n### Create a package with some tests:\n\n```go\npackage example\n\nimport (\n\t\"testing\"\n\n\t\"github.com/xtruder/go-testparrot\"\n)\n\nfunc doSomething() string {\n    return \"value\"\n}\n\nfunc TestSomething(t* testing.T) {\n    value := doSomething()\n\n    // When running in recording mode return value will equal\n    // passed value and file with recordings will be generated.\n    // When running without recording, values from recording file\n    // will be replied.\n    expected := testparrot.RecordNext(t, value)\n\n    if value != expected {\n        t.Errorf(\"doSomething() = %v; want %v\", value, expected)\n    }\n}\n\nfunc TestMain(m *testing.M) {\n\ttestparrot.Run(m)\n}\n```\n\nYou must provide `TestMain` method that will run `testparrot.Run` of if you need additional steps after/before running tests, you can also use `testparrot.BeforeTests` and `testparrot.AfterTests` helper methods.\n\n### Record values\n\nTo record values run tests with recording enabled:\n\n```bash\ngo test \u003cpackage\u003e -testparrot.record\n```\n\nThis will record values and save them into `\u003cpackage\u003e_recording_test.go` file in same directory as tests.\n\nYou can also use `go:generate` by placing comment like:\n\n```go\n//go:generate go test ./ -testparrot.record\n```\n\nin package under test and running `go generate \u003cpackage\u003e`\n\n### Run tests\n\nRun tests like you woul ussually run them, but with recording disabled:\n\n```bash\ngo test \u003cpackage\u003e\n```\n\n## Developing go-testparrot\n\nSee\n[CONTRIBUTING.md](https://github.com/xtruder/go-testparrot/blob/master/.github/CONTRIBUTING.md)\nfor best practices and instructions on setting up your development environment\nto work on Packer.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtruder%2Fgo-testparrot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtruder%2Fgo-testparrot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtruder%2Fgo-testparrot/lists"}