Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support nested describe #55

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Conversation

AbaoFromCUG
Copy link
Contributor

Features

Fix

@AbaoFromCUG AbaoFromCUG changed the title , fix #48 Feature: support nested describe Jun 26, 2024
spec/basic.test.ts Show resolved Hide resolved
lua/neotest-vitest/init.lua Outdated Show resolved Hide resolved
@marilari88
Copy link
Owner

hi @AbaoFromCUG @joshmedeski Thanks for your huge contribution! Feel free to you take a look at the actions that are failing? in other case I will do as soon as I can

@AbaoFromCUG
Copy link
Contributor Author

I had removed vim.iter in init.lua because it is new feature of neovim 0.10

@joshmedeski
Copy link
Contributor

joshmedeski commented Jun 27, 2024

Hey @AbaoFromCUG can you clarify why I'm authored on this commit? I don't remember helping you write any of this code. Maybe it was indirect and I'm missing something.

If this was done by mistake can you remove me from the commit?

@AbaoFromCUG
Copy link
Contributor Author

@joshmedeski I am sorry to bother you, I guess that the maintainer @marilari88 add you to reviewer.

@joshmedeski
Copy link
Contributor

Just to confirm, it says I authored the commit, but I did not. Please check your git config or change the git commit message on this PR so that you are the only author, thanks.

@marilari88 marilari88 changed the title Feature: support nested describe feat: support nested describe Aug 2, 2024
@marilari88
Copy link
Owner

@AbaoFromCUG ping

@GitMurf
Copy link

GitMurf commented Aug 13, 2024

Any updates here? Very excited for these changes and fixes!! Thanks!

@AbaoFromCUG
Copy link
Contributor Author

@marilari88

I have revert the modify about testNamePattern single quote issue and resolve the comment.

I test in 3 type configuration manually, and all test cases are passed

  • nested describe
  • test/it
  • sub describe

1. Plain Config

    require("neotest").setup({
        adapters = {
            require("neotest-vitest")({
                vitestCommand = "bunx vitest",
            }),
        }
    })

2. Your nvim lua config

from https://github.com/marilari88/nvim-lua-config

    require("neotest").setup({
        adapters = {
            require("neotest-vitest")({
                vitestCommand = "bunx vitest",
            }),
        },
        quickfix = { open = true },
        output = {
            enabled = true,
            open = "botright split | resize 15",
        }
    })

3. My config

neotest+neotest-vitest+overseer.nvim+"toggleterm.nvim`

     require("overseer").setup({
        templates = { "builtin" },
        strategy = {
            "toggleterm",
            direction = "float",
            use_shell = true,
        },
    })
    ---@diagnostic disable-next-line: duplicate-set-field
    require("overseer.shell").escape_cmd = function(cmd)
        return table.concat(vim.tbl_map(vim.fn.shellescape, cmd), " ")
    end
    require("neotest").setup({
        adapters = {
            require("neotest-vitest")({
                vitestCommand = "bunx vitest",
            }),
        },
        consumers = { overseer = require("neotest.consumers.overseer") },
    })

Could you checkout and test it? thanks

@AbaoFromCUG
Copy link
Contributor Author

@marilari88 fix v0.9.5 compatible issue

@marilari88 marilari88 merged commit e939b7c into marilari88:main Aug 15, 2024
3 checks passed
@GitMurf
Copy link

GitMurf commented Aug 16, 2024

This is awesome!! Thanks so much for this PR! Quick question to confirm, this does NOT resolve the it.each() dynamic parameterized names issue correct?

@AbaoFromCUG
Copy link
Contributor Author

This is awesome!! Thanks so much for this PR! Quick question to confirm, this does NOT resolve the it.each() dynamic parameterized names issue correct?

No.

Don't related to it.each()/test.each()

@hammerlink
Copy link

@AbaoFromCUG this PR seems to break finding any of the tests for me.
after some research I found out modifying one line in the discover_positions function fixes it for me.

-- before
  query = query .. string.gsub(query, "arrow_function", "function_expression")
--- after
  query = query .. string.gsub(query, "arrow_function", "function")

is it just on my treesitter that this issue occurs? Using function_expression in the query gives me 0 results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

function keyword in describe/test is not parsed correctly Tests are automatically skipped in nested describe
5 participants