material-motion-testing-utils
TypeScript icon, indicating that this package has built-in type declarations

0.0.0 • Public • Published

logo 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

License

Apache 2.0

Package Sidebar

Install

npm i material-motion-testing-utils

Weekly Downloads

2

Version

0.0.0

License

Apache-2.0

Unpacked Size

28.7 kB

Total Files

28

Last publish

Collaborators

  • appsforartists