item shows up twice, second is after Total
dylang opened this issue · comments
Dylan Greene commented
For example:
Elapsed time
test 422ms
mochaTest:unit 48ms
Total 470ms
mochaTest:unit 48ms
Unfortunately I don't have a public repo to demonstrate this.
Sindre Sorhus commented
make sure you're on the latest version.
Dylan Greene commented
Just started this project.
~/opower/x-web/x-web-task-collection ✗ WEB-1885-innovation-day ❯ npm ls time-grunt
x-web-task-collection@0.0.0 /Users/dgreene/opower/x-web/x-web-task-collection
└── time-grunt@0.1.1
Seems like it only happens with async tasks, and only the last one.
lapsed time
jshint 315ms
jshint:grunt 33ms
jshint:test 58ms
Total 406ms
jshint:test 58ms
vs
Elapsed time
test 316ms
jshint:grunt 91ms
jshint:src 25ms
jshint:test 30ms
mochaTest:unit 40ms
Total 502ms
mochaTest:unit 40ms
Dylan Greene commented
It seems to be happening when this is called:
grunt.log.header('Elapsed time');
So maybe the unhook is not working as expected.
A possible workaround is to return early from the header hook
if name
is undefined
.
Dylan Greene commented
Another possible workaround is to make sure the original header fn is called.
grunt.util.hooker.orig(grunt.log, 'header')('Elapsed time');
Sindre Sorhus commented
Sounds like a Hooker bug though. Mind opening a ticket here? https://github.com/cowboy/javascript-hooker