Skip to content

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

@chipsenkbeil

Description

@chipsenkbeil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions