Neotest adapter for running Ginkgo v2 tests in Neovim. Run, debug, and inspect your Go BDD specs directly from the editor — with full support for nested
Describe/Context/When/Ithierarchies,DescribeTable/Entry, and DAP debugging via nvim-dap-go.
- Run individual specs, describe blocks, or entire suites
- Full Ginkgo v2 support:
Describe,Context,It,When,Specify,DescribeTable,DescribeTableSubtree, andEntry - 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
- Neovim >= 0.9
- neotest
- nvim-treesitter with the
goparser installed - nvim-nio
- Ginkgo v2 (
go install github.com/onsi/ginkgo/v2/ginkgo@latest)
{
"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,
}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,
}You can customize the Ginkgo command and DAP arguments via setup():
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" },
})Use the standard Neotest keybindings to run tests. Example setup:
vim.keymap.set("n", "<leader>tt", function() require("neotest").run.run() end, { desc = "Run nearest test" })
vim.keymap.set("n", "<leader>tf", function() require("neotest").run.run(vim.fn.expand("%")) end, { desc = "Run file" })
vim.keymap.set("n", "<leader>ts", function() require("neotest").summary.toggle() end, { desc = "Toggle summary" })
vim.keymap.set("n", "<leader>to", function() require("neotest").output_panel.toggle() end, { desc = "Toggle output" })
vim.keymap.set("n", "<leader>td", function() require("neotest").run.run({ strategy = "dap" }) end, { desc = "Debug nearest test" })Contributions are welcome! Please open an issue or pull request.
To set up a development environment with Nix:
nix develop
make testWithout Nix, update tests/setup.lua with the paths to your local plugin installations, then:
make test