Browse Source

Test for fake-timers was passing for the wrong reasons.

Nothing wrong with the implementation, but the test was only
checking test duration, not that the test passed. The test
was incorrecty using `t.end`, and so finished quicker than expected.
babel-plugin-for-integration-tests
James Talmage 9 years ago
parent
commit
a1764d7f80
  1. 1
      test/fixture/fake-timers.js
  2. 2
      test/fork.js

1
test/fixture/fake-timers.js

@ -4,5 +4,4 @@ import sinon from 'sinon';
test(t => {
sinon.useFakeTimers(Date.now() + 10000);
t.pass();
t.end();
});

2
test/fork.js

@ -70,6 +70,8 @@ test('fake timers do not break duration', function (t) {
.then(function (info) {
var duration = info.tests[0].duration;
t.true(duration < 1000, duration + ' < 1000');
t.is(info.stats.failCount, 0);
t.is(info.stats.passCount, 1);
t.end();
});
});

Loading…
Cancel
Save