Closed flunderpero closed 1 month ago
@flunderpero will such API:
require("quicktest.adapters.vitest")({
is_enabled = function(bufnr) return true end
})
work for you?
Yes, that's exactly what's needed.
@flunderpero added to adapters, readme is updated with examples. Thanks for an idea!
I have a project that has both, Playwright and vitest tests. With the added Playwright adapter (#15), I now need to be able to decide whether the vitest or the Playwright adapter should run a test file.
I don't think that there is a universal way to distinguish vitest from Playwright files, so it cannot be done in the adapter's
is_enabled
function, but has to be configurable by the user. In my case I would then use a TreeSitter query to see if the Playwrighttest
function is imported (`import {test} from "@playwright/test"). Others might want to look at the filename.