{"id":13528781,"url":"https://github.com/jorgebucaran/fishtape","last_synced_at":"2025-04-05T16:08:48.488Z","repository":{"id":28338280,"uuid":"31851515","full_name":"jorgebucaran/fishtape","owner":"jorgebucaran","description":"100% pure-Fish test runner","archived":false,"fork":false,"pushed_at":"2024-05-26T11:16:10.000Z","size":139,"stargazers_count":349,"open_issues_count":4,"forks_count":20,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-01-02T00:04:20.780Z","etag":null,"topics":["fish","fish-plugin","tap","test"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/jorgebucaran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2015-03-08T13:57:47.000Z","updated_at":"2024-12-14T06:12:30.000Z","dependencies_parsed_at":"2024-03-25T22:26:46.491Z","dependency_job_id":"53ea7c80-76f6-4db0-a88a-6e2d474ce4e9","html_url":"https://github.com/jorgebucaran/fishtape","commit_stats":{"total_commits":96,"total_committers":10,"mean_commits":9.6,"dds":"0.11458333333333337","last_synced_commit":"e6e5fc23dd062ee5ed11828951bf2c85d6798db5"},"previous_names":["foldmap/fishtape","srcfile/fishtape","joxji/fishtape","jorgebucaran/fishtape","fisherman/fishtape"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgebucaran%2Ffishtape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgebucaran%2Ffishtape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgebucaran%2Ffishtape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgebucaran%2Ffishtape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jorgebucaran","download_url":"https://codeload.github.com/jorgebucaran/fishtape/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361691,"owners_count":20926643,"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":["fish","fish-plugin","tap","test"],"created_at":"2024-08-01T07:00:24.480Z","updated_at":"2025-04-05T16:08:48.460Z","avatar_url":"https://github.com/jorgebucaran.png","language":"Shell","funding_links":[],"categories":["Plugins","Shell Script Development"],"sub_categories":["other plugin","Directory Navigation"],"readme":"# Fishtape\n\n\u003e 100% _pure_-[Fish](https://fishshell.com) test runner.\n\nFishtape is a \u003ca href=https://testanything.org title=\"Test Anything Protocol\"\u003eTest Anything Protocol\u003c/a\u003e compliant test runner for Fish. Use it to test anything: scripts, functions, plugins without ever leaving your favorite shell. Here's the first example to get you started:\n\n```fish\n@test \"has a config.fish file\" -e ~/.config/fish/config.fish\n\n@test \"the ultimate question\" (math \"6 * 7\") -eq 42\n\n@test \"got root?\" $USER = root\n```\n\nNow put that in a `fish` file and run it with `fishtape` installed. Behold, the TAP stream!\n\n```console\n$ fishtape example.fish\nTAP version 13\nok 1 has a config.fish file\nok 2 the ultimate question\nnot ok 3 got root?\n  ---\n    operator: =\n    expected: root\n    actual: jb\n    at: ~/fishtape/tests/example.fish:5\n  ...\n\n1..3\n# pass 2\n# fail 1\n```\n\n\u003e See [reporting options](#reporting-options) for alternatives to TAP output.\n\nEach test file runs inside its own shell, so you can modify the global environment without cluttering your session or breaking other tests. If all the tests pass, `fishtape` exits with `0` or `1` otherwise.\n\n## Installation\n\nInstall with [Fisher](https://github.com/jorgebucaran/fisher):\n\n```console\nfisher install jorgebucaran/fishtape\n```\n\n## Writing Tests\n\nTests are defined with the `@test` function. Each test begins with a description, followed by a typical `test` expression. Refer to the `test` builtin [documentation](https://fishshell.com/docs/current/cmds/test.html) for operators and usage details.\n\n\u003cpre\u003e\n@\u003ca href=#writing-tests\u003etest\u003c/a\u003e \u003ci\u003edescription\u003c/i\u003e [\u003ci\u003eactual\u003c/i\u003e] \u003ca href=https://fishshell.com/docs/current/cmds/test.html#operators-for-files-and-directories\u003eoperator\u003c/a\u003e \u003ci\u003eexpected\u003c/i\u003e\n\u003c/pre\u003e\n\n\u003e Operators to combine expressions are not currently supported: `-a`, `-o`.\n\nSometimes you need to test the exit status of running one or more commands and for that, you use command substitutions. Just make sure to suppress stdout to avoid cluttering your `test` expression.\n\n```fish\n@test \"repo is clean\" (git diff-index --quiet @) $status -eq 0\n```\n\nOften you have work that needs to happen before and after tests run like preparing the environment and cleaning up after you're done. The best way to do this is directly in your test file.\n\n```fish\nset temp (mktemp -d)\n\ncd $temp\n\n@test \"a regular file\" (touch file) -f file\n@test \"nothing to see here\" -z (read \u003c file)\n\nrm -rf $temp\n```\n\nWhen comparing multiline output you usually have two options, collapse newlines using `echo` or collect your input into a single argument with [`string collect`](https://fishshell.com/docs/current/cmds/string-collect.html). It's your call.\n\n```fish\n@test \"first six evens\" (echo (seq 2 2 12)) = \"2 4 6 8 10 12\"\n\n@test \"one two three\" (seq 3 | string collect) = \"1\n2\n3\"\n```\n\nIf you want to write to stdout while tests are running, use the `@echo` function. It's equivalent to `echo \"# $argv\"`, which prints a TAP comment.\n\n```fish\n@echo -- strings --\n```\n\n## Reporting Options\n\nIf you're looking for something fancier than plaintext, [here's a list](https://github.com/sindresorhus/awesome-tap#reporters) of reporters that you can pipe TAP into.\n\n```console\n$ fishtape test/* | tnyan\n 8   -_-_-_-__,------,\n 0   -_-_-_-__|  /\\_/\\\n 0   -_-_-_-_~|_( ^ .^)\n     -_-_-_-_ \"\"  \"\"\n  Pass!\n```\n\n## License\n\n[MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgebucaran%2Ffishtape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjorgebucaran%2Ffishtape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgebucaran%2Ffishtape/lists"}