V13Axel / neotest-pest

Neotest adapter for Pest 2.0
MIT License
14 stars 5 forks source link

Neotest "No tests Found" #14

Open thyseus opened 1 month ago

thyseus commented 1 month ago

Hey there,

i am trying to use neotest with https://astronvim.com/ , astrocommunity and the https://github.com/V13Axel/neotest-pest adapter.

I added this to my user.lua

  {
    "nvim-neotest/neotest",
    dependencies = {
      "V13Axel/neotest-pest",
    },
    config = function()
      require("neotest").setup {
        adapters = {
          require "neotest-pest" {
            sail_enabled = true,
          },
        },
      }
    end,
  },

community.lua:

  { import = "astrocommunity.test.neotest" },

and everything seems fine (no error messages, lazy installs everything correctly).

But when i try to run a test, it always says "No Tests found".

I think i am doing something wrong here, could one please help me ? Maybe add the correct way to add an adapter to the documentation ? Or make the adapters enable/disable-able in the astrocommunity plugin ?

Thanks a lot !

(p.s. i also posted this here: https://github.com/AstroNvim/astrocommunity/discussions/1037 ) but no success yet.

V13Axel commented 1 week ago

Hmm, so that at least looks correct to me, though I am unfamiliar with Astro's specific details, that appears to be a normal Lazy installation spec that should do what I'd expect.

The main way to debug it would be to set your log level to debug like so:

require("neotest").setup {
  log_level = vim.log.levels.DEBUG,
  -- {snip} --
}

and then tail the neotest log and see what shows up there.

I'm not entirely certain whether Astro does anything special for it, but mine is at ~/.local/state/nvim/neotest.log, so I tend to do something like tail -f ~/.local/state/nvim/neotest.log | grep neotest-pest.

Do that while you open the project and then open the neotest summary window - it's an easy way to force discovery without the noise of trying to run tests.

The first few lines should be something like

DEBUG | 2024-07-25T10:56:06Z-0400 | [path]/neotest-pest/init.lua:20 | Finding root...
DEBUG | 2024-07-25T10:56:06Z-0400 | [path]/neotest-pest/init.lua:34 | Checking root file tests/Pest.php
DEBUG | 2024-07-25T10:56:06Z-0400 | [path]/neotest-pest/init.lua:39 | Found root [path to rootdir]

Curious to hear what yours says.