Include duration in --write snapshots#2960
Conversation
| // done since otherwise the tests would only pass (match the snapshot) | ||
| // if they happened to run in the exact amount of time as when | ||
| // created. | ||
| console.log(chalk.grey(`${filename} %dms`), Date.now() - start); |
There was a problem hiding this comment.
Maybe we can mock Date.now() to always output 0 and replace %d/%s with their actual value?
|
|
||
| exports[`do not write file with --write + formated file (stdout) 1`] = ` | ||
| "formated.js%s %dms | ||
| "formated.jsformated.js %dms |
There was a problem hiding this comment.
I just realize I removed the [2K[1G (remove line) control character in the snapshot output (strip-ansi) so that it looks weird here, I think we can add a special case for it to actually do the same thing in the mocked stdout/stderr.
|
Is this good to go, or do you want to do more ANSI changes? |
|
I don't want to do more ANSI stuff, but I want to try mocking |
|
Ok, I ended up messing with the ANSI stuff anyway. @ikatyang What do you think? |
|
Works locally but fails on Travis :( |
|
Failure is unrelated to your changes. #2903 |
a55997c to
094d5cf
Compare
--write snapshots|
I scrapped my previous work and started over from master. Now, I've only added the duration to the snapshots (by mocking |
Context: #2957 (comment)