This plugin provides a Foundry adapter for the Neotest framework.
Credits to neotest-vitest and vscode-foundry-test-runner.
demo.mp4
{
'nvim-neotest/neotest',
dependencies = {
...,
'llllvvuu/neotest-foundry',
}
config = {
...,
adapters = {
require('neotest-foundry')
}
}
}
Defaults:
...
adapters = {
require('neotest-foundry')({
foundryCommand = "forge test", -- string | function
foundryConfig = nil, -- string | function
env = {}, -- table | function
cwd = function () return lib.files.match_root_pattern("foundry.toml") end, -- string | function
filterDir = function(name)
return (
name ~= "node_modules"
and name ~= "cache"
and name ~= "out"
and name ~= "artifacts"
and name ~= "docs"
and name ~= "doc"
-- and name ~= "lib"
)
end,
})
}
If you start Neovim from the contracts directory instead of the monorepo root it should work. e.g. cd contracts/core && nvim
./scripts/test