Open ziontee113 opened 1 year ago
Here I have an example:
describe("new vim.cmd syntax", function() it("doesn't work", function() vim.cmd.edit("/home/username/.config/nvim/init.lua") end) end)
If I run this test, I will get the error
...username/.config/dev-nvim/MAGO/tests/MAGO/lib/sample_spec.lua:3: attempt to index field 'cmd' (a function value)
This code works just fine
describe("new vim.cmd syntax", function() it("works", function() local cmd = "e " .. "/home/username/.config/nvim/init.lua" vim.cmd(cmd) end) end)
Is there a way to fix this? Thank you very much.
@ziontee113 did you find out why this is happening? I'm writing tests for a plugin with another plugin as a dependency, and that plugin uses vim.cmd.edit, which throws this error.
vim.cmd.edit
Here I have an example:
If I run this test, I will get the error
This code works just fine
Is there a way to fix this? Thank you very much.