This directory contains unit tests for remember.nvim.
You need to have luarocks installed to run the tests. Install it using your package manager:
# On Ubuntu/Debian
sudo apt-get install luarocks
# On macOS
brew install luarocks
# On Arch Linux
sudo pacman -S luarocksInstall the busted testing framework and luacov for coverage:
make test-install
# or manually:
luarocks install busted --local
luarocks install luacov --localRun all tests:
make test
# or directly:
busted tests/Run tests with coverage report:
make test-coverageRun tests with verbose output:
busted tests/ --verboseRun a specific test file:
busted tests/remember_spec.luaCoverage reports are generated using luacov. After running
make test-coverage, you'll find:
luacov.report.out- Human-readable coverage reportluacov.stats.out- Raw coverage statistics
The coverage configuration is in .luacov and is set to only include lua/ directory files.
tests/remember_spec.lua- Main test file containing unit tests for:setup()function - configuration optionsset_cursor_position()function - cursor restoration logic- autocmd registration
Tests are written using the busted testing framework. The test file mocks the Neovim API to allow unit testing without running Neovim.
Example test structure:
describe("feature name", function()
it("should do something", function()
-- Test code here
assert.is_true(condition)
end)
end)Remove test artifacts:
make cleanTests are automatically run on pull requests via GitHub Actions. The workflow:
- Runs all tests
- Generates coverage report
- Posts coverage results as a PR comment