mirror of
https://github.com/pnx/neotest-phpunit
synced 2026-06-16 03:54:55 +02:00
Get better short message output
This commit is contained in:
parent
a6351e49a4
commit
e09c38cc51
3 changed files with 54 additions and 100 deletions
|
|
@ -217,127 +217,57 @@ describe("get_test_results", function()
|
|||
assert.are.same(utils.get_test_results(xml_output, output_file), expected)
|
||||
end)
|
||||
|
||||
it('parses output with a failing test', function()
|
||||
it('parses output with a single failing test', function()
|
||||
local xml_output = {
|
||||
testsuites = {
|
||||
testsuite = {
|
||||
_attr = {
|
||||
assertions = "16",
|
||||
assertions = "1",
|
||||
errors = "0",
|
||||
failures = "1",
|
||||
name = "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php",
|
||||
name = "",
|
||||
skipped = "0",
|
||||
tests = "6",
|
||||
time = "0.007869",
|
||||
tests = "1",
|
||||
time = "0.004215",
|
||||
warnings = "0"
|
||||
},
|
||||
testsuite = {
|
||||
_attr = {
|
||||
assertions = "16",
|
||||
assertions = "1",
|
||||
errors = "0",
|
||||
failures = "1",
|
||||
file = "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php",
|
||||
name = "P\\Tests\\Feature\\UserTest",
|
||||
skipped = "0",
|
||||
tests = "6",
|
||||
time = "0.007869",
|
||||
tests = "1",
|
||||
time = "0.004215",
|
||||
warnings = "0"
|
||||
},
|
||||
testcase = { {
|
||||
_attr = {
|
||||
assertions = "3",
|
||||
class = "Tests\\Feature\\UserTest",
|
||||
classname = "Tests.Feature.UserTest",
|
||||
file = "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php",
|
||||
name = "class constructor",
|
||||
time = "0.003293"
|
||||
}
|
||||
}, {
|
||||
_attr = {
|
||||
assertions = "2",
|
||||
class = "Tests\\Feature\\UserTest",
|
||||
classname = "Tests.Feature.UserTest",
|
||||
file = "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php",
|
||||
name = "tellName",
|
||||
time = "0.000584"
|
||||
}
|
||||
}, {
|
||||
_attr = {
|
||||
assertions = "2",
|
||||
class = "Tests\\Feature\\UserTest",
|
||||
classname = "Tests.Feature.UserTest",
|
||||
file = "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php",
|
||||
name = "can tellAge",
|
||||
time = "0.000396"
|
||||
}
|
||||
}, {
|
||||
testcase = {
|
||||
_attr = {
|
||||
assertions = "1",
|
||||
class = "Tests\\Feature\\UserTest",
|
||||
classname = "Tests.Feature.UserTest",
|
||||
file = "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php",
|
||||
name = "is false",
|
||||
time = "0.001134"
|
||||
time = "0.004215"
|
||||
},
|
||||
failure = { "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php::it is false\nFailed asserting that true is false.\n\n/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php:33\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Expectation.php:316\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Support/Reflection.php:38\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Support/HigherOrderMessage.php:96\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Support/HigherOrderMessageCollection.php:43\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Factories/TestCaseFactory.php:148\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Concerns/Testable.php:302\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Support/ExceptionTrace.php:29\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Concerns/Testable.php:303\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Concerns/Testable.php:279\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Console/Command.php:119\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/bin/pest:62\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/bin/pest:63",
|
||||
failure = { "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php::it is false\nFailed asserting that true is false.\n\n/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php:35\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Expectation.php:316\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Support/Reflection.php:38\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Support/HigherOrderMessage.php:96\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Support/HigherOrderMessageCollection.php:43\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Factories/TestCaseFactory.php:148\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Concerns/Testable.php:302\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Support/ExceptionTrace.php:29\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Concerns/Testable.php:303\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Concerns/Testable.php:279\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/src/Console/Command.php:119\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/bin/pest:62\n/Users/michaelutz/Code/neotest-pest/vendor/pestphp/pest/bin/pest:63",
|
||||
_attr = {
|
||||
type = "PHPUnit\\Framework\\ExpectationFailedException"
|
||||
}
|
||||
}
|
||||
}, {
|
||||
_attr = {
|
||||
assertions = "3",
|
||||
class = "Tests\\Feature\\UserTest",
|
||||
classname = "Tests.Feature.UserTest",
|
||||
file = "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php",
|
||||
name = "addFavoriteMovie",
|
||||
time = "0.001189"
|
||||
}
|
||||
}, {
|
||||
_attr = {
|
||||
assertions = "5",
|
||||
class = "Tests\\Feature\\UserTest",
|
||||
classname = "Tests.Feature.UserTest",
|
||||
file = "/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php",
|
||||
name = "removeFavoriteMovie",
|
||||
time = "0.001273"
|
||||
}
|
||||
} }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local expected = {
|
||||
["/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php::addFavoriteMovie"] = {
|
||||
output_file = output_file,
|
||||
short = "TESTS.FEATURE.USERTEST\n-> PASSED - addFavoriteMovie",
|
||||
status = "passed"
|
||||
},
|
||||
["/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php::can tellAge"] = {
|
||||
output_file = output_file,
|
||||
short = "TESTS.FEATURE.USERTEST\n-> PASSED - can tellAge",
|
||||
status = "passed"
|
||||
},
|
||||
["/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php::class constructor"] = {
|
||||
output_file = output_file,
|
||||
short = "TESTS.FEATURE.USERTEST\n-> PASSED - class constructor",
|
||||
status = "passed"
|
||||
},
|
||||
["/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php::is false"] = {
|
||||
errors = { {} },
|
||||
output_file = output_file,
|
||||
status = "failed"
|
||||
},
|
||||
["/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php::removeFavoriteMovie"] = {
|
||||
output_file = output_file,
|
||||
short = "TESTS.FEATURE.USERTEST\n-> PASSED - removeFavoriteMovie",
|
||||
status = "passed"
|
||||
},
|
||||
["/Users/michaelutz/Code/neotest-pest/tests/Feature/UserTest.php::tellName"] = {
|
||||
output_file = output_file,
|
||||
short = "TESTS.FEATURE.USERTEST\n-> PASSED - tellName",
|
||||
status = "passed"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue