Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Removed error messages from growl notifications. Closes #32

Tj Holowaychukb48ec952e62d
diff --git a/Makefile b/Makefile
index 59132c13..98138ff8 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@ test-unit:
--require should \
--reporter $(REPORTER) \
--ui bdd \
+ --growl \
$(TESTS)
test-bdd:
diff --git a/bin/mocha b/bin/mocha
index 1224c944..75b75fe4 100755
--- a/bin/mocha
+++ b/bin/mocha
@@ -114,25 +114,16 @@ function growl(runner, reporter) {
runner.on('end', function(){
var stats = reporter.stats;
if (stats.failures) {
- var msg = stats.failures + ' of ' + stats.tests + ' tests failed:\n\n';
- msg += titles(reporter.failures).join('\n');
- notify(msg, { title: 'Fail' });
+ var msg = stats.failures + ' of ' + stats.tests + ' tests failed';
+ notify(msg, { title: 'Failed' });
} else {
notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', {
- title: 'Pass'
+ title: 'Passed'
});
}
});
}
-// test titles
-
-function titles(tests) {
- return tests.map(function(test, i){
- return i + ') ' + test.title + ': ' + test.err.message;
- });
-}
-
// growl notification
function notify(msg, options) {