Commit 0f765928 authored by Robert Knight's avatar Robert Knight

Fix `decayingInterval` mock returning wrong result type

The real function returns a function. The mock returned a number. This
happened not to cause a failure currently but it could break with future
changes in Preact.
parent b0fa3aee
......@@ -87,9 +87,10 @@ describe('AnnotationTimestamps', () => {
});
it('is updated after time passes', () => {
fakeTime.decayingInterval.callsFake((date, callback) =>
setTimeout(callback, 10)
);
fakeTime.decayingInterval.callsFake((date, callback) => {
const id = setTimeout(callback, 10);
return () => clearTimeout(id);
});
const wrapper = createComponent();
fakeTime.toFuzzyString.returns('60 jiffies');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment