Lightweight self-contained busted-style testing harness for Neovim
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-09 11:21:49 +01:00
lua refactor: require minimal_init, drop runtimepath handling 2026-11-09 11:21:49 +01:00
.gitignore Initial commit 2026-03-17 09:34:50 +01:00
.luarc.json import plenary 2026-03-17 09:44:31 +01:00
.stylua.toml import plenary 2026-03-17 09:44:31 +01:00
LICENSE Initial commit 2026-03-17 09:34:50 +01:00
README.md docs: usage in README 2026-11-09 11:21:49 +01:00

plentest.nvim

Lightweight self-contained busted-style testing harness for Neovim.

Forked from plenary.test_harness with vendored luassert and say.

Not for public use. (Check out https://github.com/lewis6991/nvim-test instead.)

Usage

PLENTEST=path/to/plentest.nvim nvim --headless --clean -u scripts/minimal_init.lua \
  -c "lua require('plentest').test_directory('tests', { minimal_init = './scripts/minimal_init.lua' })"

where scripts/minimal_init.lua puts $PLENTEST and the tested plugin (.) on the runtimepath.

  • test_directory(path, opts) runs every *_spec.lua file under path (or the spec file path), each in its own nvim --headless --clean process. test_file(path, opts) is the same.
  • opts.minimal_init (required): init file for the test processes (-u).
  • opts.timeout: per file, in ms (default 50000). A file that runs longer is killed and reported.
  • opts.sequential: run the files one after another instead of in parallel.
  • opts.nvim_cmd: Nvim binary for the test processes (default v:progpath).

The runner prints each file's output, then the totals and the failed or timed-out files. It exits 1 if any file failed, errored or timed out, or if no spec file was found.

Spec files can use describe, it, pending, before_each, after_each and assert (luassert).