nvim-neotest / neotest-jest

MIT License
121 stars 80 forks source link

Neotest neotest-jest: ...l/share/nvim/lazy/neotest-jest/lua/neotest-jest/util.lua:206: attempt to index field 'channel' (a nil value) #59

Closed TroySigX closed 1 year ago

TroySigX commented 1 year ago

When I run require('neotest').run.run, the warning shows up. Here is my config:

require('neotest').setup({
  adapters = {
    require('neotest-jest')({
      jestCommand = 'npm test --',
      jestConfigFile = 'custom.jest.config.ts',
      env = { CI = true },
      cwd = function()
        return vim.fn.getcwd()
      end,
    }),
  },

  quickfix = {
    open = false,
  }
})

local map = vim.keymap.set
map({ 'n', 'i', 'v' }, '<F4>', function()
  require('neotest').summary.toggle()
  local win = vim.fn.bufwinid('Neotest Summary')
    if win > -1 then
      vim.api.nvim_set_current_win(win)
  end
end, { desc = 'Toggle Neotest Summary' })
map('n', '<leader>t', require('neotest').run.run, { desc = '[T]est Current Test' })
map('n', '<leader>at', function() require('neotest').run.run(vim.fn.expand("%")) end, { desc = 'Run [A]ll [T]est' })
marilari88 commented 1 year ago

Hi @haydenmeade. Need https://github.com/haydenmeade/neotest-jest/pull/57 to be merged