I'm using the following git pre-commit hook to run unit-test on a project prior to commit
echo "Starting test runner..."
exec dotnet test "MyProject.UnitTest.csproj"
if [ $? -ne 0 ]; then
echo >&2 "Tests must pass before commit!"
exit 1
fi
The hook is taken into account in Visual Studio when I commit, but I get a common error: "One or more errors occurred". The hook seems to be working correctly as I do not have any issue if all my unit-test pass.
Do you know a way of showing the output of the hook in visual studio, to get a proper error details ?
