material-motion-testing-utils
v0.0.0
Published
Utilities for testing the Material Motion framework
Downloads
4
Maintainers
Readme
Material Motion: Testing utils
Utilities for testing the Material Motion framework
Usage
import {
createMockObserver,
useMockedRAF,
} from 'material-motion-testing-utils';
declare('TestableThing',
useMockedRAF(
(mockRAF) => {
it('should do something with requestAnimationFrame',
() => {
const mockObserver = createMockObserver();
const someStream = new MotionObservable(mockObserver).debounce();
someStream.subscribe(someListener);
mockObserver.next(4);
mockObserver.next(5);
mockObserver.next(6);
mockRAF.step();
expect(someListener).to.have.been.calledWith(6);
Installation
yarn add material-motion-testing-utils