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

cwd of tests is set to lua directory instead of root of project #16

Open
chipsenkbeil opened this issue Jan 15, 2024 · 0 comments
Open

Comments

@chipsenkbeil
Copy link

chipsenkbeil commented Jan 15, 2024

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.

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

No branches or pull requests

1 participant