Fix #12884 Release Notes: - Added runnable tests for TSX files. --- Runnable tests can be customized via `tsx-test` tag ---------
Unified · Split
| @@ -141,7 +141,8 @@ pub fn init( · 140 unmodified lines | |||
| 141 | vec![ | 141 | vec![ |
| 142 | Arc::new(typescript::TypeScriptLspAdapter::new(node_runtime.clone())), | 142 | Arc::new(typescript::TypeScriptLspAdapter::new(node_runtime.clone())), |
| 143 | Arc::new(vtsls::VtslsLspAdapter::new(node_runtime.clone())) | 143 | Arc::new(vtsls::VtslsLspAdapter::new(node_runtime.clone())) |
| 144 | ] | 144 | ], |
| 145 | typescript_task_context() | ||
| 145 | ); | 146 | ); |
| 146 | language!( | 147 | language!( |
| 147 | "typescript", | 148 | "typescript", |
| @@ -0,0 +1,14 @@ | |||
| 1 | ; Add support for (node:test, bun:test and Jest) runnable | ||
| 2 | ; Function expression that has `it`, `test` or `describe` as the function name | ||
| 3 | ( | ||
| 4 | (call_expression | ||
| 5 | function: (_) @_name | ||
| 6 | (#any-of? @_name "it" "test" "describe") | ||
| 7 | arguments: ( | ||
| 8 | arguments . (string | ||
| 9 | (string_fragment) @run | ||
| 10 | ) | ||
| 11 | ) | ||
| 12 | ) @_tsx-test | ||
| 13 | (#set! tag tsx-test) | ||
| 14 | ) | ||
| @@ -37,7 +37,7 @@ pub(super) fn typescript_task_context() -> ContextProviderWithTasks { · 36 unmodified lines | |||
| 37 | VariableName::Symbol.template_value(), | 37 | VariableName::Symbol.template_value(), |
| 38 | VariableName::File.template_value(), | 38 | VariableName::File.template_value(), |
| 39 | ], | 39 | ], |
| 40 | tags: vec!["ts-test".into(), "js-test".into()], | 40 | tags: vec!["ts-test".into(), "js-test".into(), "tsx-test".into()], |
| 41 | ..TaskTemplate::default() | 41 | ..TaskTemplate::default() |
| 42 | }, | 42 | }, |
| 43 | TaskTemplate { | 43 | TaskTemplate { |