Skip to content

Commit

Permalink
fix: handle junit4 test results
Browse files Browse the repository at this point in the history
  • Loading branch information
atm1020 committed Dec 3, 2024
1 parent 95cf827 commit 7a14767
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# neotest-jdtls
* This plugin provides a jdtls adapter for the [Neotest](https://github.com/rcarriga/neotest) framework.
* Only supports Junit5 tests.
* Supports: Junit5, Junit4 tests.

### Installation

Expand Down
5 changes: 5 additions & 0 deletions lua/neotest-jdtls/neotest/impl/results.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ function M.results(spec, _, tree)
for _, item in ipairs(report) do
if item.children then
group_and_map_test_results(test_result_lookup, item)
elseif item.is_suite ~=nil and not item.is_suite then
-- The junit 4 test dosen't have children parameter
log.debug('item: ', vim.inspect(item))
local key = get_test_key_from_junit_result(item.test_name)
test_result_lookup[key] = { map_to_neotest_result_item(item) }
end
end

Expand Down

0 comments on commit 7a14767

Please sign in to comment.