Bug 1435296 Clean 0ms durations in stub generation r?nchevobbe
If the duration was 0ms, it would not be cleaned; and thus lead to a mismatch and
ultimately test failure.
MozReview-Commit-ID: 1s9nMzlGT0e
--- a/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js
+++ b/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/head.js
@@ -76,17 +76,17 @@ function getCleanedPacket(key, packet) {
if (res.message) {
// Clean timeStamp on the message prop.
res.message.timeStamp = existingPacket.message.timeStamp;
if (res.message.timer) {
// Clean timer properties on the message.
// Those properties are found on console.time and console.timeEnd calls,
// and those time can vary, which is why we need to clean them.
- if (res.message.timer.duration) {
+ if ("duration" in res.message.timer) {
res.message.timer.duration = existingPacket.message.timer.duration;
}
}
if (Array.isArray(res.message.arguments)) {
res.message.arguments = res.message.arguments.map((argument, i) => {
if (!argument || typeof argument !== "object") {
return argument;