-
-
Notifications
You must be signed in to change notification settings - Fork 167
fix: schedule vim commands in state_spec test #642
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
Conversation
I can't see any errors in the CLI output: Can you provide some info what you get? |
|
Within neotest I get the following error: |
tests/plenary/state/state_spec.lua
Outdated
| vim.schedule_wrap(function() | ||
| vim.cmd.edit(cache_path) | ||
| vim.api.nvim_buf_set_lines(0, 0, -1, false, { '[ invalid json!' }) | ||
| vim.cmd.write() | ||
| end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try these changes instead and see if it works?
| vim.schedule_wrap(function() | |
| vim.cmd.edit(cache_path) | |
| vim.api.nvim_buf_set_lines(0, 0, -1, false, { '[ invalid json!' }) | |
| vim.cmd.write() | |
| end) | |
| vim.cmd(('edit %s'):format(cache_path)) | |
| vim.api.nvim_buf_set_lines(0, 0, -1, false, { '[ invalid json!' }) | |
| vim.cmd('write') | |
From the screenshot I see that neotest-plenary cannot figure out that vim.cmd is a table, so this might fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this actually also fixes the problem. I updated my commit with your suggestion.
f5b7202 to
2f7f7e5
Compare
Fix test on CLI AND Neotest by executing the vim commands asynchronously. This test was not marked as failed when it ran from the command line, although the error was visible in the output. In Neotest it was actually marked as failed.
2f7f7e5 to
c53d62f
Compare
Fix test on CLI AND Neotest by executing the vim commands asynchronously. This test was not marked as failed when it ran from the command line, although the error was visible in the output. In Neotest it was actually marked as failed. Co-authored-by: Sebastian Flügge <seflue@users.noreply.github.com>


Fix test on CLI AND Neotest by executing the vim commands asynchronously.
This test was not marked as failed when it ran from the command line, although the error was visible in the output.
In Neotest it was actually marked as failed.