Added TSX test runnables (#12922)
Fix #12884 Release Notes: - Added runnable tests for TSX files. --- Runnable tests can be customized via `tsx-test` tag --------- Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This commit is contained in:
parent
b82350979f
commit
ec95a33d8c
3 changed files with 17 additions and 2 deletions
14
crates/languages/src/tsx/runnables.scm
Normal file
14
crates/languages/src/tsx/runnables.scm
Normal file
|
@ -0,0 +1,14 @@
|
|||
; Add support for (node:test, bun:test and Jest) runnable
|
||||
; Function expression that has `it`, `test` or `describe` as the function name
|
||||
(
|
||||
(call_expression
|
||||
function: (_) @_name
|
||||
(#any-of? @_name "it" "test" "describe")
|
||||
arguments: (
|
||||
arguments . (string
|
||||
(string_fragment) @run
|
||||
)
|
||||
)
|
||||
) @_tsx-test
|
||||
(#set! tag tsx-test)
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue