test: update test cases of utils

This commit is contained in:
chenjiahan
2020-11-28 18:42:38 +08:00
parent 4ca6dc4dbe
commit 75c296f0a8
5 changed files with 19 additions and 18 deletions

View File

@@ -0,0 +1,10 @@
import { raf, cancelRaf } from '../utils';
test('raf', async () => {
const spy = jest.fn();
raf(spy);
// await later(50);
expect(spy).toHaveBeenCalledTimes(1);
cancelRaf(1);
});