Basic framework for testing Neovim plugins
- Lua 85.1%
- Shell 14.9%
| lua | ||
| .gitignore | ||
| .luarc.json | ||
| .stylua.toml | ||
| LICENSE | ||
| README.md | ||
| tsst | ||
tsst.nvim
Basic framework for testing Neovim plugins.
Projects that use tsst should define test modules in ./tests/*_test.lua and
have a copy of tsst.nvim in the same directory, e.g.
tests
├── foo_test.lua
├── bar_test.lua
└── tsst.nvim
The basic structure of a test module looks like this:
M = {}
local tsst = require 'tsst'
M.before_each = function()
-- ...
end
M.testcases = {}
table.insert(M.testcases, {
desc = 'Run a test',
fn = function()
-- ...
end,
})
return M
To run all tests:
tests/tsst.nvim/tsst
To run a specific module and debug failures:
tests/tsst.nvim/tsst -d tests/foo_test.lua
See brk.nvim and refmt.nvim for more in depth examples.