First of all thank you for such a fast editor! I realized that the existing support for detecting runnable test cases for typescript/javascript is not full. Meanwhile I can run most of test by pressing "run button": <img width="713" alt="image" src="https://github.com/user-attachments/assets/e8bb1cb1-f0a5-4eb1-b9a6-7188a9fa47ae" /> I can't run dynamic tests: <img width="703" alt="image" src="https://github.com/user-attachments/assets/d7eef1bc-e99a-4f05-9d62-ec49b8194959" /> I was curious whether I can improve it on my own and created this pr. I edited schemas and added minor changes in `TaskTemplate` to allow to replace '%s' with regexp pattern, so it can match test cases: <img width="772" alt="image" src="https://github.com/user-attachments/assets/db3a6fe0-ad90-4853-8e98-4215e41dfe88" /> Release Notes: - Allow to run dynamic TypeScript/JavaScript tests --------- Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
101 lines
2.2 KiB
Scheme
101 lines
2.2 KiB
Scheme
(internal_module
|
|
"namespace" @context
|
|
name: (_) @name) @item
|
|
|
|
(enum_declaration
|
|
"enum" @context
|
|
name: (_) @name) @item
|
|
|
|
(function_declaration
|
|
"async"? @context
|
|
"function" @context
|
|
name: (_) @name
|
|
parameters: (formal_parameters
|
|
"(" @context
|
|
")" @context)) @item
|
|
|
|
(interface_declaration
|
|
"interface" @context
|
|
name: (_) @name) @item
|
|
|
|
(program
|
|
(export_statement
|
|
(lexical_declaration
|
|
["let" "const"] @context
|
|
(variable_declarator
|
|
name: (_) @name) @item)))
|
|
|
|
(program
|
|
(lexical_declaration
|
|
["let" "const"] @context
|
|
(variable_declarator
|
|
name: (_) @name) @item))
|
|
|
|
(class_declaration
|
|
"class" @context
|
|
name: (_) @name) @item
|
|
|
|
(method_definition
|
|
[
|
|
"get"
|
|
"set"
|
|
"async"
|
|
"*"
|
|
"readonly"
|
|
"static"
|
|
(override_modifier)
|
|
(accessibility_modifier)
|
|
]* @context
|
|
name: (_) @name
|
|
parameters: (formal_parameters
|
|
"(" @context
|
|
")" @context)) @item
|
|
|
|
(public_field_definition
|
|
[
|
|
"declare"
|
|
"readonly"
|
|
"abstract"
|
|
"static"
|
|
(accessibility_modifier)
|
|
]* @context
|
|
name: (_) @name) @item
|
|
|
|
; Add support for (node:test, bun:test and Jest) runnable
|
|
(
|
|
(call_expression
|
|
function: [
|
|
(identifier) @_name
|
|
(member_expression
|
|
object: [
|
|
(identifier) @_name
|
|
(member_expression object: (identifier) @_name)
|
|
]
|
|
)
|
|
] @context
|
|
(#any-of? @_name "it" "test" "describe" "context" "suite")
|
|
arguments: (
|
|
arguments . (string (string_fragment) @name)
|
|
)
|
|
)
|
|
) @item
|
|
|
|
; Add support for parameterized tests
|
|
(
|
|
(call_expression
|
|
function: (call_expression
|
|
function: (member_expression
|
|
object: [(identifier) @_name (member_expression object: (identifier) @_name)]
|
|
property: (property_identifier) @_property
|
|
)
|
|
(#any-of? @_name "it" "test" "describe" "context" "suite")
|
|
(#eq? @_property "each")
|
|
)
|
|
arguments: (
|
|
arguments . (string (string_fragment) @name)
|
|
)
|
|
)
|
|
) @item
|
|
|
|
(comment) @annotation
|