nvim-neotest / neotest-vim-test

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

No tests found #1

Open jonathan-raines opened 2 years ago

jonathan-raines commented 2 years ago

Hello! I'm super excited about this plugin. I'm running into a No tests found error when trying to run both lua require("neotest").run.run() and lua require("neotest").run.run(vim.fn.expand("%")) from a test file.

I do have a custom transformation as the code base is dockerized. Here's the vim-test custom transformation.

  vim.api.nvim_exec(
    [[
    function! DockerTransform(cmd)
      return "docker-compose exec $(tmux display-message -p '#S') " .a:cmd
    endfunction
  ]] ,
    false
  )

  vim.cmd [[ let test#custom_transformations = {'docker': function('DockerTransform')}]]
  vim.cmd [[ let test#transformation = 'docker']]
  vim.cmd [[ let g:test#basic#start_normal = 1 " If using basic strategy ]]
end

I tried removing the transformation, which causes errors with vim-test, and I don't receive the No tests found messages anymore but nothing else happens either. No UI popup or anything.

Here's my packer configuration for Neotest

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

If there's more information I can provide, please let me know!

rcarriga commented 2 years ago

Thanks for the report! I've never actually used the transformations before so could be that or it could something else. If you could provide a sample repo or some other reproduction that'd be great, otherwise I'll put some time into trying to reproduce myself