https://github.com/nvim-contrib/neotest-ginkgo
Neotest adapter for Ginkgo v2 — run, debug, and navigate Go BDD tests in Neovim
https://github.com/nvim-contrib/neotest-ginkgo
bdd dap ginkgo ginkgo-testing go golang lua neotest neotest-adapter neovim neovim-plugin nix nvim nvim-plugin testing
Last synced: 29 days ago
JSON representation
Neotest adapter for Ginkgo v2 — run, debug, and navigate Go BDD tests in Neovim
- Host: GitHub
- URL: https://github.com/nvim-contrib/neotest-ginkgo
- Owner: nvim-contrib
- License: mit
- Created: 2023-05-27T13:49:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-05-04T07:18:57.000Z (about 1 month ago)
- Last Synced: 2026-05-04T09:32:28.955Z (about 1 month ago)
- Topics: bdd, dap, ginkgo, ginkgo-testing, go, golang, lua, neotest, neotest-adapter, neovim, neovim-plugin, nix, nvim, nvim-plugin, testing
- Language: Lua
- Homepage:
- Size: 379 KB
- Stars: 11
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# neotest-ginkgo
> [Neotest](https://github.com/nvim-neotest/neotest) adapter for running [Ginkgo v2](https://github.com/onsi/ginkgo) tests in Neovim. Run, debug, and inspect your Go BDD specs directly from the editor — with full support for nested `Describe`/`Context`/`When`/`It` hierarchies, `DescribeTable`/`Entry`, and DAP debugging via [nvim-dap-go](https://github.com/leoluz/nvim-dap-go).
[](https://github.com/nvim-contrib/neotest-ginkgo/actions/workflows/test.yml)
[](https://github.com/nvim-contrib/neotest-ginkgo/releases)
[](LICENSE)
[](https://neovim.io)
[](https://github.com/nvim-neotest/neotest)

## Features
- Run individual specs, describe blocks, or entire suites
- Full Ginkgo v2 support: `Describe`, `Context`, `It`, `When`, `Specify`, `DescribeTable`, `DescribeTableSubtree`, and `Entry`
- Focus (`FDescribe`, `FIt`) and pending (`PDescribe`, `PIt`, `XIt`) variants
- Nested test hierarchy displayed in the Neotest summary tree
- DAP integration for step-through debugging of individual specs
- Structured output panel with color-coded test results
- Works with `lazy.nvim`, `packer.nvim`, and any other plugin manager
## Requirements
- Neovim >= 0.9
- [neotest](https://github.com/nvim-neotest/neotest)
- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) with the `go` parser installed
- [nvim-nio](https://github.com/nvim-neotest/nvim-nio)
- [Ginkgo v2](https://github.com/onsi/ginkgo) (`go install github.com/onsi/ginkgo/v2/ginkgo@latest`)
## Installation
### lazy.nvim
```lua
{
"nvim-neotest/neotest",
lazy = true,
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"nvim-contrib/neotest-ginkgo",
},
config = function()
require("neotest").setup({
adapters = {
require("neotest-ginkgo"),
},
})
end,
}
```
### packer.nvim
```lua
use {
"nvim-neotest/neotest",
requires = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"nvim-contrib/neotest-ginkgo",
},
config = function()
require("neotest").setup({
adapters = {
require("neotest-ginkgo"),
},
})
end,
}
```
## Configuration
You can customize the Ginkgo command and DAP arguments via `setup()`:
```lua
require("neotest-ginkgo").setup({
-- Base ginkgo command (default: {"ginkgo", "run", "-v"})
command = { "ginkgo", "run", "-v", "--race" },
-- DAP arguments with --ginkgo. prefix (default: {"--ginkgo.v"})
dap = { "--ginkgo.v", "--ginkgo.trace" },
})
```
## Usage
Use the standard Neotest keybindings to run tests. Example setup:
```lua
vim.keymap.set("n", "tt", function() require("neotest").run.run() end, { desc = "Run nearest test" })
vim.keymap.set("n", "tf", function() require("neotest").run.run(vim.fn.expand("%")) end, { desc = "Run file" })
vim.keymap.set("n", "ts", function() require("neotest").summary.toggle() end, { desc = "Toggle summary" })
vim.keymap.set("n", "to", function() require("neotest").output_panel.toggle() end, { desc = "Toggle output" })
vim.keymap.set("n", "td", function() require("neotest").run.run({ strategy = "dap" }) end, { desc = "Debug nearest test" })
```
## Contributing
Contributions are welcome! Please open an issue or pull request.
To set up a development environment with [Nix](https://nixos.org):
```bash
nix develop
make test
```
Without Nix, update `tests/setup.lua` with the paths to your local plugin installations, then:
```bash
make test
```
## License
[MIT](LICENSE)