function checkForTestFailures(pathToResult) {
        var resultXml = grunt.file.read(pathToResult),
            xmlDocument = new XmlDocument(resultXml),
            testSuites = xmlDocument.childrenNamed("testsuite"),
            failures = 0;

        testSuites.forEach(function (testSuite) {
            failures += Number(testSuite.attr.failures);
        });

        return failures;
    }
Check the unit test results for failures