Skip to content

Foundry's Solidity test runner integrated into Neovim via Neotest

Notifications You must be signed in to change notification settings

llllvvuu/neotest-foundry

Repository files navigation

neotest-foundry

This plugin provides aFoundryadapter for theNeotestframework.

Credits toneotest-vitestandvscode-foundry-test-runner.

demo.mp4

Installation

{
'nvim-neotest/neotest',
dependencies={
...,
'llllvvuu/neotest-foundry',
}
config={
...,
adapters={
require('neotest-foundry')
}
}
}

Configuration

Defaults:

...
adapters={
require('neotest-foundry')({
foundryCommand="forge test",--string | function
foundryConfig=nil,--string | function
env={},--table | function
cwd=function()returnlib.files.match_root_pattern("foundry.toml")end,--string | function
filterDir=function(name)
return(
name~="node_modules"
andname~="cache"
andname~="out"
andname~="artifacts"
andname~="docs"
andname~="doc"
--and name ~= "lib"
)
end,
})
}

Note on monorepos

If you start Neovim from the contracts directory instead of the monorepo root it should work. e.g.cd contracts/core && nvim

Testing

./scripts/test

About

Foundry's Solidity test runner integrated into Neovim via Neotest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 98.0%
  • Lua 1.9%
  • Other 0.1%