nvim-neotest / neotest-vim-test

Neotest adapter for vim-test
25 stars 0 forks source link

All tests passing #3

Closed jim-at-jibba closed 2 years ago

jim-at-jibba commented 2 years ago

Hey,

I am moving this issue over from the main repo. I am experiencing an issue where all tests are passing even if they should fail.

Here is a minimal init.lua

-- ignore default config and plugins
vim.opt.runtimepath:remove(vim.fn.expand("~/.config/nvim"))
vim.opt.packpath:remove(vim.fn.expand("~/.local/share/nvim/site"))

-- append test directory
local test_dir = "/tmp/nvim-config"
vim.opt.runtimepath:append(vim.fn.expand(test_dir))
vim.opt.packpath:append(vim.fn.expand(test_dir))

-- install packer
local install_path = test_dir .. "/pack/packer/start/packer.nvim"
local install_plugins = false

if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
    vim.cmd("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
    vim.cmd("packadd packer.nvim")
    install_plugins = true
end

local packer = require("packer")

packer.init({
    package_root = test_dir .. "/pack",
    compile_path = test_dir .. "/plugin/packer_compiled.lua",
})

packer.startup(function(use)
    -- Packer can manage itself
    use("wbthomason/packer.nvim")

    use 'vim-test/vim-test'
    use({
        "rcarriga/neotest",
        requires = {
            "nvim-lua/plenary.nvim",
            "nvim-treesitter/nvim-treesitter",
            "antoinemadec/FixCursorHold.nvim",
            "rcarriga/neotest-vim-test",
        },
        config = function()
            require("neotest").setup({
                adapters = {
                    require("neotest-vim-test")({
                        ignore_file_types = { "python", "vim", "lua" },
                    }),
                },
            })
        end,
    })

    if install_plugins then
        packer.sync()
    end
end)

Is there anything else you need? Maybe I have it set up incorrectly.

It works as expected with vim-test but shows passed tests with this.

This is the repo that I have been able to replicate it with - https://github.com/jim-at-jibba/neotest-demo

Thanks for you help

rcarriga commented 2 years ago

Thanks for the reproduction! I've pushed a fix for that particular repo, can you let me know if that fixes the issue for other repos you were using?

jim-at-jibba commented 2 years ago

Hey bud,

That is awesome! Thank you so much. All seems to be working in my main project too.