diff --git a/Button.test.js b/Button.test.js index e099165..9e044b9 100644 --- a/Button.test.js +++ b/Button.test.js @@ -5,6 +5,7 @@ import {configure, shallow} from 'enzyme'; import Button from './Button'; configure({adapter: new Adapter()}); +window.requestAnimationFrame = fn => setTimeout(fn, 0); describe('Button Component', () => { it('should contain the right text', () => { diff --git a/inject.test.js b/inject.test.js index 44eac73..9fdafdc 100644 --- a/inject.test.js +++ b/inject.test.js @@ -5,6 +5,7 @@ import {configure, shallow} from 'enzyme'; import inject from './inject'; configure({adapter: new Adapter()}); +window.requestAnimationFrame = fn => setTimeout(fn, 0); describe('inject HOC', () => { it('should add "newProp"', () => { diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..3a2df80 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + setupFiles: ['./utils/raf.js'], +}; diff --git a/utils/raf.js b/utils/raf.js new file mode 100644 index 0000000..b84a135 --- /dev/null +++ b/utils/raf.js @@ -0,0 +1,3 @@ +global.requestAnimationFrame = callback => { + setTimeout(callback, 0); +};