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
{{ message }}
This repository has been archived by the owner on Dec 27, 2018. It is now read-only.
I noticed that one of my tests takes 1.5 seconds to execute. I've narrowed the cause down to the following snippet:
describe('SomeApi', function() {
it('gets events', function() {
var startMs = new Date();
var a = {list: function(){}};
sinon.stub(a, 'list');
console.log('meteor-sinon-wtf', new Date() - startMs);
});
});
this prints: meteor-sinon-wtf 1441
if I refresh the test runner, it prints 1.
If I put this in two consecutive tests, then it prints (on the first execution):
meteor-sinon-wtf 1403
meteor-sinon-wtf 0
Finally, if I call sinon.stub() (without stubbing an object's method) it again only takes <1ms.
It seems to be related to the first execution only. If I run the same command in pure node, it doesn't happen. So it seems to be something specific to Meteor. I'm using practicalmeteor:mocha and I'm importing sinon from practicalmeteor:sinon.
The text was updated successfully, but these errors were encountered:
I have the same issue, but I'm not using meteor at all, just a combination of webpack, node, mocha, sinon and jsdom. Please let me know if you find an answer...
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I noticed that one of my tests takes 1.5 seconds to execute. I've narrowed the cause down to the following snippet:
describe('SomeApi', function() {
it('gets events', function() {
var startMs = new Date();
var a = {list: function(){}};
sinon.stub(a, 'list');
console.log('meteor-sinon-wtf', new Date() - startMs);
});
});
this prints: meteor-sinon-wtf 1441
if I refresh the test runner, it prints 1.
If I put this in two consecutive tests, then it prints (on the first execution):
meteor-sinon-wtf 1403
meteor-sinon-wtf 0
Finally, if I call sinon.stub() (without stubbing an object's method) it again only takes <1ms.
It seems to be related to the first execution only. If I run the same command in pure node, it doesn't happen. So it seems to be something specific to Meteor. I'm using practicalmeteor:mocha and I'm importing sinon from practicalmeteor:sinon.
The text was updated successfully, but these errors were encountered: