Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: importing neotest-plenary causing lua print() broken #12

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

wookayin
Copy link
Contributor

Upon require("neotest-plenary"), lua global print() (and hence all
lua-based I/O) gets broken. This is because the module "plenary.busted"
overrides and shadows global print() as a side-effect.

This is a regression since #10.

Solution: The module "plenary.busted" should never be imported.

Upon require("neotest-plenary"), lua global `print()` (and hence all
lua-based I/O) gets broken. This is because the module "plenary.busted"
overrides and shadows global `print()` as a side-effect.

This is a regression since nvim-neotest#10.

Solution: The module "plenary.busted" should never be imported.
@wookayin
Copy link
Contributor Author

@rcarriga It'd be appreciated if this can be merged ASAP as #10 had a breaking critical bug. Sorry about the trouble, and thanks for your support!

wookayin referenced this pull request Sep 29, 2023
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 = ... }`.

Also add some sensible options (no shada, no swapfile) to the command
line.

Fixes #4.
@rcarriga rcarriga merged commit dcaf5ed into nvim-neotest:master Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants