diff --git a/src/core/parser.js b/src/core/parser.js index 723e2ea3e..20dbd886d 100644 --- a/src/core/parser.js +++ b/src/core/parser.js @@ -67,7 +67,7 @@ class Parser { } shift() { - if (isCmd(this.buf2, 'ID')) { + if ((this.buf2 instanceof Cmd) && this.buf2.cmd === 'ID') { this.buf1 = this.buf2; this.buf2 = null; } else { diff --git a/test/unit/api_spec.js b/test/unit/api_spec.js index b32014e08..cac5fec01 100644 --- a/test/unit/api_spec.js +++ b/test/unit/api_spec.js @@ -1331,7 +1331,7 @@ describe('api', function() { let [statEntry] = stats.times; expect(statEntry.name).toEqual('Page Request'); - expect(statEntry.end - statEntry.start).toBeGreaterThan(0); + expect(statEntry.end - statEntry.start).toBeGreaterThanOrEqual(0); loadingTask.destroy().then(done); }, done.fail);