https://github.com/nvim-contrib/nvim-ginkgo
This plugin provides a ginkgo adapter for the neotest framework.
https://github.com/nvim-contrib/nvim-ginkgo
bdd ginkgo lua neotest neovim neovim-plugin nix testing
Last synced: 18 days ago
JSON representation
This plugin provides a ginkgo adapter for the neotest framework.
- Host: GitHub
- URL: https://github.com/nvim-contrib/nvim-ginkgo
- Owner: nvim-contrib
- License: mit
- Created: 2023-05-27T13:49:02.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2026-03-11T08:07:56.000Z (18 days ago)
- Last Synced: 2026-03-11T09:17:59.632Z (18 days ago)
- Topics: bdd, ginkgo, lua, neotest, neovim, neovim-plugin, nix, testing
- Language: Lua
- Homepage:
- Size: 63.5 KB
- Stars: 11
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nvim-ginkgo
[](https://github.com/nvim-contrib/nvim-ginkgo/actions/workflows/test.yml)
[](https://github.com/nvim-contrib/nvim-ginkgo/releases)
[](LICENSE)
[](https://neovim.io)
[](https://github.com/nvim-neotest/neotest)
A [Neotest](https://github.com/nvim-neotest/neotest) adapter for the [Ginkgo](https://github.com/onsi/ginkgo) BDD testing framework — run, navigate, and inspect your Go tests without leaving Neovim.
## Features
- Run individual specs, describe blocks, or entire suites from within Neovim
- Supports `Describe`, `Context`, `It`, `When`, `DescribeTable`, and `Entry`
- Nested test structures displayed in the Neotest tree
- DAP integration for debugging individual specs
- Output panel with structured 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](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/nvim-ginkgo",
},
config = function()
require("neotest").setup({
adapters = {
require("nvim-ginkgo"),
},
})
end,
}
```
### packer.nvim
```lua
use {
"nvim-neotest/neotest",
requires = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"nvim-contrib/nvim-ginkgo",
},
config = function()
require("neotest").setup({
adapters = {
require("nvim-ginkgo"),
},
})
end,
}
```
## 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 `spec/setup.lua` with the paths to your local plugin installations, then:
```bash
make test
```
## License
[MIT](LICENSE)