You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Other libraries you are using: ReactDOM (development)
What did you expect to happen?
No Error to be thrown
What actually happens
A TypeError was thrown TypeError: 'mark' called on an object that does not implement interface Performance
How to reproduce lolex.install();
This happens when using the default lolex.install();
When subsequently calling performance.mark(), the TypeError is thrown (in my case, performance.mark is called by ReactDOM.development)
A workaround for this issue that I have found is to use this instead: lolex.install({ toFake: [ 'setTimeout', 'clearTimeout', 'setImmediate', 'clearImmediate', 'setInterval', 'clearInterval', 'Date', 'nextTick', 'hrtime', ], });
Based on my preliminary research, it looks like this issue may have been introduced by #160 in response to issue #136
I am unsure if this method of recreating the performance object on the clock is carrying over the underlying interface type.
The text was updated successfully, but these errors were encountered:
Veriifed by adding this test and running npm run test-headless
it("should not throw an error on calling performance.mark",function(){this.clock=lolex.install();assert.isFunction(global.performance.mark);refute.exception(function(){global.performance.mark("a name");});});
fatso83
added a commit
to fatso83/lolex
that referenced
this issue
Sep 5, 2018
What did you expect to happen?
No Error to be thrown
What actually happens
A TypeError was thrown
TypeError: 'mark' called on an object that does not implement interface Performance
How to reproduce
lolex.install();
This happens when using the default
lolex.install();
When subsequently calling
performance.mark()
, the TypeError is thrown (in my case,performance.mark
is called by ReactDOM.development)A workaround for this issue that I have found is to use this instead:
lolex.install({ toFake: [ 'setTimeout', 'clearTimeout', 'setImmediate', 'clearImmediate', 'setInterval', 'clearInterval', 'Date', 'nextTick', 'hrtime', ], });
Based on my preliminary research, it looks like this issue may have been introduced by #160 in response to issue #136
I am unsure if this method of recreating the performance object on the clock is carrying over the underlying interface type.
The text was updated successfully, but these errors were encountered: