When attempting to do some glob matching, even with the defaults, I realized that the cwd when running tests is within my lua directory instead of the root of the project. This means that all of the glob matching fails even when using the defaults with a minimal_init.lua file as it's looking within the lua directory. I'm not sure why it is getting set to the Lua directory for me.
Code Pointer
Print out the cwd found here, which isn't used anywhere but I believe is the base path of vim.fn.glob used by async.fn.glob. This prints out the /path/to/project.nvim/lua directory for me.
|
local cwd = assert(vim.loop.cwd()) |
Example directory structure
/path/to/project.nvim
lua/
init.lua
code.lua
spec/
minimal_init.lua
code_spec.lua
Solution
I both made a fork of this adapter so I could pass in custom globs (#15) and then needed to provide something like ../**/spec/minimal_init.lua to get my initial config to load for tests.
When attempting to do some glob matching, even with the defaults, I realized that the cwd when running tests is within my lua directory instead of the root of the project. This means that all of the glob matching fails even when using the defaults with a
minimal_init.luafile as it's looking within the lua directory. I'm not sure why it is getting set to the Lua directory for me.Code Pointer
Print out the
cwdfound here, which isn't used anywhere but I believe is the base path ofvim.fn.globused byasync.fn.glob. This prints out the/path/to/project.nvim/luadirectory for me.neotest-plenary/lua/neotest-plenary/init.lua
Line 116 in dcaf5ed
Example directory structure
Solution
I both made a fork of this adapter so I could pass in custom globs (#15) and then needed to provide something like
../**/spec/minimal_init.luato get my initial config to load for tests.