Skip to content

Commit 2791234

Browse files
author
vdemedes
committed
display test duration only if a threshold is reached
1 parent 9838428 commit 2791234

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

index.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,17 @@ function test(err, title, duration) {
2424
return;
2525
}
2626

27-
log.success(title + ' ' + chalk.dim('(' + prettyMs(duration) + ')'));
27+
// format a time spent in the test
28+
var timeSpent = '';
29+
30+
// display duration only over a threshold
31+
var threshold = 100;
32+
33+
if (duration > threshold) {
34+
timeSpent = chalk.dim('(' + prettyMs(duration) + ')');
35+
}
36+
37+
log.success(title + ' ' + timeSpent);
2838
}
2939

3040
function stack(results) {

0 commit comments

Comments
 (0)