{"id":25837229,"url":"https://github.com/devtin/go-test-parser","last_synced_at":"2026-06-13T05:31:17.077Z","repository":{"id":54466971,"uuid":"522351344","full_name":"devtin/go-test-parser","owner":"devtin","description":"parses go test files","archived":false,"fork":false,"pushed_at":"2022-08-15T20:48:59.000Z","size":270,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T02:04:27.179Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devtin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-07T23:48:45.000Z","updated_at":"2022-08-07T23:49:15.000Z","dependencies_parsed_at":"2022-08-13T16:31:18.307Z","dependency_job_id":null,"html_url":"https://github.com/devtin/go-test-parser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtin%2Fgo-test-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtin%2Fgo-test-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtin%2Fgo-test-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtin%2Fgo-test-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devtin","download_url":"https://codeload.github.com/devtin/go-test-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241309091,"owners_count":19941726,"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":[],"created_at":"2025-03-01T02:48:00.444Z","updated_at":"2026-06-13T05:31:12.031Z","avatar_url":"https://github.com/devtin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv\u003e\u003ch1\u003ego-test-parser\u003c/h1\u003e\u003c/div\u003e\n\n\u003cp\u003e\n    \u003ca href=\"https://www.npmjs.com/package/go-test-parser\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/go-test-parser.svg\" alt=\"Version\"\u003e\u003c/a\u003e\n\u003ca href=\"http://opensource.org/licenses\" target=\"_blank\"\u003e\u003cimg src=\"http://img.shields.io/badge/License-MIT-brightgreen.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n    Parses go  tests into an object\n\u003c/p\u003e\n\n## Manifesto\n\nSince nothing describes better what a software does than its tests, in order to make easy the documentation process, I\nwant to be able to parse the content of a go test file.\n\n## Installation\n\n```sh\n$ npm i go-test-parser --save\n# or\n$ yarn add go-test-parser\n```\n\n## Features\n\n- [Parses go test syntax](#parses-go-test-syntax)\n\n\n\u003ca name=\"loads-entities-from-directory\"\u003e\u003c/a\u003e\n\n## Parses go test syntax\n\nTake the following go test file:\n\n```go\n// go_test.go\npackage fixtures\n\nimport (\n\t\"testing\"\n\n\t. \"github.com/smartystreets/goconvey/convey\"\n)\n\nfunc SomeTest(t *testing.T) {\n\t// some setup\n\n\tConvey(\"Test A\", t, func() {\n\t\tConvey(\"Test A-1\", func() {\n\t\t\t// some\n\t\t\t// test\n\t\t\t// code\n\t\t\t// block\n\t\t})\n\t\tConvey(\"Test A-2\", func() {\n\t\t\t// some\n\t\t\t// test\n\t\t\t// code\n\t\t\t// block\n\t\t})\n\t})\n\n\tConvey(\"Test B\", t, func() {\n\t\tConvey(\"Test B-1\", func() {\n\t\t\t// some\n\t\t\t// test\n\t\t\t// code\n\t\t\t// block\n\t\t})\n\t\tConvey(\"Test B-2\", func() {\n\t\t\t// some\n\t\t\t// test\n\t\t\t// code\n\t\t\t// block\n\t\t})\n\t})\n}\n```\n...and the following script:\n\n```js\nconst { parse } = require('go-test-parser')\nconst { readFileSync } = require('fs')\n\nconsole.log(parse(readFileSync('go_test.go').toString()))\n```\nwould produce the following output:\n\n```json\n[\n  {\n    \"title\": \"SomeTest\",\n    \"start\": 8,\n    \"end\": 40,\n    \"Convey\": [\n      {\n        \"Convey\": [\n          {\n            \"Convey\": [],\n            \"code\": \"// some\\n// test\\n// code\\n// block\",\n            \"end\": 5,\n            \"start\": 0,\n            \"title\": \"Test A-1\",\n          },\n          {\n            \"Convey\": [],\n            \"code\": \"// some\\n// test\\n// code\\n// block\",\n            \"end\": 11,\n            \"start\": 6,\n            \"title\": \"Test A-2\",\n          },\n        ],\n        \"code\": \"Convey(\\\\\\\"Test A-1\\\\\\\", func() {\\n\t// some\\n\t// test\\n\t// code\\n\t// block\\n})\\nConvey(\\\\\\\"Test A-2\\\\\\\", func() {\\n\t// some\\n\t// test\\n\t// code\\n\t// block\\n})\",\n        \"end\": 15,\n        \"start\": 2,\n        \"title\": \"Test A\",\n      },\n      {\n        \"Convey\": [\n          {\n            \"Convey\": [],\n            \"code\": \"// some\\n// test\\n// code\\n// block\",\n            \"end\": 5,\n            \"start\": 0,\n            \"title\": \"Test B-1\",\n          },\n          {\n            \"Convey\": [],\n            \"code\": \"// some\\n// test\\n// code\\n// block\",\n            \"end\": 11,\n            \"start\": 6,\n            \"title\": \"Test B-2\",\n          },\n        ],\n        \"code\": \"Convey(\\\\\\\"Test B-1\\\\\\\", func() {\\n\t// some\\n\t// test\\n\t// code\\n\t// block\\n})\\nConvey(\\\\\\\"Test B-2\\\\\\\", func() {\\n\t// some\\n\t// test\\n\t// code\\n\t// block\\n})\",\n        \"end\": 30,\n        \"start\": 17,\n        \"title\": \"Test B\",\n      },\n    ],\n    \"code\": \"// some setup\\n\\nConvey(\\\\\\\"Test A\\\\\\\", t, func() {\\n\tConvey\\n(\\\\\\\"Test A-1\\\\\\\", func() {\\n\t\t// some\\n\t\t// test\\n\t\t// code\\n\t\t// block\\n\t})\\n\tConvey(\\\\\\\"Test A-2\\\\\\\", func() {\\n\t\t// some\\n\t\t// test\\n\t\t// code\\n\t\t// block\\n\t})\\n})\\n\\nConvey(\\\\\\\"Test B\\\\\\\", t, func() {\\n\tConvey(\\\\\\\"Test B-1\\\\\\\", func() {\\n\t\t// some\\n\t\t// test\\n\t\t// code\\n\t\t// block\\n\t})\\n\tConvey(\\\\\\\"Test B-2\\\\\\\", func() {\t\t// some\t\t// test\t\t// code\t\t// block\t})\\n})\",\n  },\n]\n```\n\n* * *\n\n### License\n\n[MIT](https://opensource.org/licenses/MIT)\n\n\u0026copy; 2021-present Martin Rafael Gonzalez \u003ctin@devtin.io\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevtin%2Fgo-test-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevtin%2Fgo-test-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevtin%2Fgo-test-parser/lists"}