stevearc / overseer.nvim

A task runner and job management plugin for Neovim
MIT License
1.26k stars 58 forks source link

[Bug] Neotest - Attempt to call field 'adapters' (a nil value) #53

Closed olimorris closed 2 years ago

olimorris commented 2 years ago

I have a mapping to run my Neotest test suite:

function()
  local neotest = require("neotest")
  for _, adapter_id in ipairs(neotest.run.adapters()) do
    neotest.run.run({ suite = true, adapter = adapter_id })
   end
end,

with the following Neotest config:

require("neotest").setup({
  adapters = {
    require("neotest-rspec"),
  },
  consumers = {
    overseer = require("neotest.consumers.overseer"),
  },
})

I'm getting the following error:

E5108: Error executing lua: /Users/Oli/.config/nvim/lua/Oli/core/mappings.lua:366: attempt to call field 'adapters' (a nil value)
stack traceback:
        /Users/Oli/.config/nvim/lua/Oli/core/mappings.lua:366: in function </Users/Oli/.config/nvim/lua/Oli/core/mappings.lua:364>

where line 364 is my mapping.

If I remove the overseer = require("neotest.consumers.overseer") line then the mapping works as expected

stevearc commented 2 years ago

Should be fixed now. Thanks for the report!