UNPKG

cross-gesture

Version:
58 lines (53 loc) 719 B
import { rotateDeg } from '../src/utils'; describe('Rotate', () => { const deg = rotateDeg( [ { x: 0, y: 0, }, { x: 4, y: 3, }, ], [ { x: 0, y: 0, }, { x: 10, y: 0, }, ], ); it('Rotate 36.xxx', () => { return expect(Math.floor(deg)).toEqual(36); }); const deg2 = rotateDeg( [ { x: 0, y: 0, }, { x: 10, y: 10, }, ], [ { x: 0, y: 0, }, { x: 10, y: 0, }, ], ); it('Rotate 45', () => { return expect(Math.floor(deg2)).toEqual(45); }); });