aboutsummaryrefslogtreecommitdiffstats
path: root/after/plugin/neotest.lua
blob: efbd15994b0ea91b4691b7fb2e84605164bce857 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
local ok, neotest = pcall(require, "neotest")
if not ok then
    return
end

neotest.setup({
    adapters = {
        require("neotest-go"),
        require("neotest-vim-test")({
            ignore_file_types = { "go" },
        }),
    },
})

-- Not working for behat
-- So add the leader, not ideal but for now is the best
vim.keymap.set("n", "<leader>t<C-n>", function()
    neotest.run.run()
end, { silent = true, noremap = true })

vim.keymap.set("n", "<leader>t<C-f>", function()
    neotest.run.run(vim.fn.expand("%"))
end, { silent = true, noremap = true })

vim.keymap.set("n", "<leader>t<C-s>", function()
    neotest.summary.toggle()
end, { silent = true, noremap = true })