I have a build that running some npm tests with TFS 2017. I set an email notification for failed builds.
Developers asks to get more information about the npm test instead of just "npm failed with exit code 1" so I want to get the entire output as a log file attached to the email or parse the output and send it as the error message to the email notification.
I tried to modify the BuildCompletedEvent.xsl to get different value but I keep getting the uninformative npm failure message.
Does someone know of a way to send the entire command output to the email or something similar?
If the build log contain all of the npm tests output. You could use rest api or powershell script to catch the related build log. Detail steps please refer this question: Get zipped TFS 2015 (vNext) build output logs through powershell (just like the download link after the build)
Then just use some custom tasks to send mails with attachment in the build definition such as send email or email task. Or you could write the task to meet your own requirement, for how to please take a look at this blog: Sending Email Notification from VSTS/TFS Build