Plenary busted tests don't trigger autocommands
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- lua, neovim
- Domain
- devtools, testing-qa
Research direction
Start by running the supplied Lua test in Plenary's test environment and inspect how the test entry point drives Neovim events and autocommands. Determine whether VimEnter or another autocmd can execute there, then make the behavior reproducible and ensure the callback assertion is observed by the test runner.
Written by the indexing model from the issue text.
Description
I am trying to create tests involving autocommands but I have not been able to trigger any autocommand within the tests. For example, the below test will not fail because the autocommand will not be triggered.
describe("Autocommand triggered: ", function()
it('VimEnter', function()
vim.api.nvim_create_autocmd({'VimEnter'}, {
callback = function()
print('TRIGGERED')
assert.equals(0, 1)
end})
end)
end
I have tried a few different events without success. Am I doing something wrong or you just can't trigger autocommands in this test environment?
- Dominant language
- Lua
- Stars
- 3.5k
- Forks
- 340
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nvim-lua/plenary.nvim
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
nvim-lua/plenary.nvim#682 ·
-
uniform usage of `os.getenv`Possibly taken @rakotomandimby claimed this 117 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 72/100
nvim-lua/plenary.nvim#680 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
nvim-lua/plenary.nvim#675 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
nvim-lua/plenary.nvim#672 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
nvim-lua/plenary.nvim#671 · 1 comment ·
All issues in nvim-lua/plenary.nvim
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jellyfin/jellyfin-mpv-shim#800 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
agent-research-finding bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jordansmall/nixvim-config#99 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
cl: has_flags() mistakes warning C5072 for an unsupported flagPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
xmake-io/xmake#7822 · 3 comments ·
Maintainers usually reply within 2 days