quolpr / quicktest.nvim

Run your tests in split window or popup with live feedback
MIT License
66 stars 5 forks source link

Cypress adapter #19

Open gogamid opened 1 month ago

gogamid commented 1 month ago

Great plugin! Is there plan to support cypress ui test? Or how to add custom adapters?

quolpr commented 1 month ago

Hi! No plans for now, but adoption is pretty straightforward.

You can take https://github.com/quolpr/quicktest.nvim/blob/main/lua/quicktest/adapters/playwright/init.lua or https://github.com/quolpr/quicktest.nvim/blob/main/lua/quicktest/adapters/vitest/init.lua as an example. The main problem could be writing treesitter query that will be finding the test 🤔

gogamid commented 3 weeks ago

I have an idea, detect a test as Cypress test when there is cy. and run it in cypress way. The way we detect it is something like this:

                      (expression_statement ; [29, 8] - [29, 32]
                        (call_expression ; [29, 8] - [29, 31]
                          function: (member_expression ; [29, 8] - [29, 16]
                            object: (identifier) ; [29, 8] - [29, 10]

identifier being cy. What do you think?

quolpr commented 3 weeks ago

@gogamid hi! Still not sure 🤔 You can still add such adapter, but I think I will restrict it by running through :QuicktestRun[Line/File/Dir/All] <win_mode> cypress, without auto detection 🤔