Guess this works
This commit is contained in:
parent
0079504a48
commit
fd44486cc7
5 changed files with 65 additions and 5 deletions
38
lua/custom/plugins/neotest.lua
Normal file
38
lua/custom/plugins/neotest.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
return {
|
||||
{
|
||||
'nvim-neotest/neotest',
|
||||
dependencies = {
|
||||
'nvim-neotest/nvim-nio',
|
||||
'nvim-lua/plenary.nvim',
|
||||
'antoinemadec/FixCursorHold.nvim',
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'nvim-neotest/neotest-jest',
|
||||
},
|
||||
config = function()
|
||||
local neotest = require 'neotest'
|
||||
|
||||
neotest.setup {
|
||||
adapters = {
|
||||
require 'neotest-jest',
|
||||
},
|
||||
}
|
||||
|
||||
-- Set up keybindings
|
||||
local map = vim.keymap.set
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
map('n', '<leader>tt', function()
|
||||
neotest.run.run()
|
||||
end, opts) -- Run nearest test
|
||||
map('n', '<leader>tf', function()
|
||||
neotest.run.run(vim.fn.expand '%')
|
||||
end, opts) -- Run current file
|
||||
map('n', '<leader>td', function()
|
||||
neotest.run.run { strategy = 'dap' }
|
||||
end, opts) -- Run with debugger
|
||||
map('n', '<leader>to', function()
|
||||
neotest.output.open()
|
||||
end, opts)
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue