thenbe / neotest-playwright

A playwright adapter for neotest.
MIT License
37 stars 5 forks source link

[Bug] Watch mode doesn't seem to work #18

Closed sand4rt closed 1 month ago

sand4rt commented 9 months ago

The watched tests are not run again when the tests are changed and saved. Is this not supported?

Related to https://github.com/marilari88/neotest-vitest/issues/27, probably https://github.com/microsoft/playwright/issues/21960 and https://github.com/microsoft/playwright/issues/14748

AlexandrosAlexiou commented 6 months ago

Same here

thenbe commented 6 months ago

Is this not supported?

That's correct, playwright's watch mode did not exist when I created this plugin. But I'm open to adding watch mode support if anyone wants to submit a PR.

sand4rt commented 2 months ago

It seems to work as expected now when i add:

watch = {
    enabled = true,
    symbol_queries = {
        javascript = '  ;query\n  ;Captures named imports\n  (import_specifier name: (identifier) @symbol)\n  ;Captures default import\n  (import_clause (identifier) @symbol)\n  ;Capture require statements\n  (variable_declarator \n  name: (identifier) @symbol\n  value: (call_expression (identifier) @function  (#eq? @function "require")))\n  ;Capture namespace imports\n  (namespace_import (identifier) @symbol)\n',
        tsx = '  ;query\n  ;Captures named imports\n  (import_specifier name: (identifier) @symbol)\n  ;Captures default import\n  (import_clause (identifier) @symbol)\n  ;Capture require statements\n  (variable_declarator \n  name: (identifier) @symbol\n  value: (call_expression (identifier) @function  (#eq? @function "require")))\n  ;Capture namespace imports\n  (namespace_import (identifier) @symbol)\n',
        typescript = '  ;query\n  ;Captures named imports\n  (import_specifier name: (identifier) @symbol)\n  ;Captures default import\n  (import_clause (identifier) @symbol)\n  ;Capture require statements\n  (variable_declarator \n  name: (identifier) @symbol\n  value: (call_expression (identifier) @function  (#eq? @function "require")))\n  ;Capture namespace imports\n  (namespace_import (identifier) @symbol)\n'
    }
}

to require("neotest").setup as described in the docs: https://github.com/nvim-neotest/neotest/blob/6f35d797882c6ce0ab7c87dc86561512dc3d7aba/doc/neotest.txt#L190-L202

sand4rt commented 1 month ago

closed because it works with the config above