nvim-neotest / neotest-plenary

MIT License
32 stars 11 forks source link

feat: automatically inject plenary.nvim runtimepath #10

Closed wookayin closed 9 months ago

wookayin commented 9 months ago

Currently plenary adapters won't work out of box because plenary.nvim is not added to vim &runtimepath or lua package.path (#4). Without any config, test will fail with the error:

.../neotest-plenary/run_tests.lua:26: module 'plenary.busted' not found:
^Ino field package.preload['plenary.busted']

Instead, we can get the path where plenary.nvim is installed and inject the path when running a headless neovim instance for testing. With this, neotest-plenary can run plenary.busted tests out-of-box even if users do not configure { min_init = ... }.

Fixes #4.

rcarriga commented 9 months ago

Thanks again for the PR!

wookayin commented 9 months ago

This commit actually caused a crazy regression: importing "plenary.busted" overrides the lua global print function broken. I've submitted another PR #12 to fix this.