Skip to content

Commit

Permalink
Use 'function_expression' instead of 'function'
Browse files Browse the repository at this point in the history
  • Loading branch information
MisanthropicBit authored and adrigzr committed Feb 19, 2024
1 parent 65874f3 commit 6ccc781
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/neotest-mocha/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ function Adapter.discover_positions(file_path)
; Matches: `it('test') / specify('test')`
((call_expression
function: (identifier) @func_name (#any-of? @func_name "it" "specify")
arguments: (arguments [(template_string) @test.name (string (string_fragment) @test.name)] [(arrow_function) (function)])
arguments: (arguments [(template_string) @test.name (string (string_fragment) @test.name)] [(arrow_function) (function_expression)])
)) @test.definition
; Matches: `it.only('test') / specify.only('test')`
((call_expression
function: (member_expression
object: (identifier) @func_name (#any-of? @func_name "it" "specify")
)
arguments: (arguments [(template_string) @test.name (string (string_fragment) @test.name)] [(arrow_function) (function)])
arguments: (arguments [(template_string) @test.name (string (string_fragment) @test.name)] [(arrow_function) (function_expression)])
)) @test.definition
]]

Expand Down

0 comments on commit 6ccc781

Please sign in to comment.