1
0
Fork 0
mirror of https://github.com/pnx/neotest-phpunit synced 2026-06-16 03:54:55 +02:00

Add test for skipped

This commit is contained in:
Michael Utz 2022-11-16 22:43:19 +03:00
parent cd5e0bffd3
commit a6351e49a4
2 changed files with 54 additions and 0 deletions

View file

@ -400,4 +400,57 @@ describe("get_test_results", function()
assert.are.same(utils.get_test_results(xml_output, output_file), expected)
end)
it('parses output with skipped tests', function()
local xml_output = {
testsuites = {
testsuite = {
_attr = {
assertions = "0",
errors = "0",
failures = "0",
name = "",
skipped = "1",
tests = "1",
time = "0.001544",
warnings = "0"
},
testsuite = {
_attr = {
assertions = "0",
errors = "0",
failures = "0",
file = "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php",
name = "P\\Tests\\Feature\\UserTest",
skipped = "1",
tests = "1",
time = "0.001544",
warnings = "0"
},
testcase = {
_attr = {
assertions = "0",
class = "Tests\\Feature\\UserTest",
classname = "Tests.Feature.UserTest",
file = "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php",
name = "tellName",
time = "0.001544"
},
skipped = {}
}
}
}
}
}
local expected = {
["/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php::tellName"] = {
output_file = output_file,
short = "TESTS.FEATURE.USERTEST\n-> PASSED - tellName",
status = "passed"
}
}
assert.are.same(utils.get_test_results(xml_output, output_file), expected)
end)
end)