1 | import DeviceMotion, { Gravity } from '../DeviceMotion';
|
2 | import ExponentDeviceMotion from '../ExponentDeviceMotion';
|
3 |
|
4 | afterEach(() => {
|
5 | DeviceMotion.removeAllListeners();
|
6 | });
|
7 |
|
8 | it(`sets the update interval`, async () => {
|
9 | const NativeDeviceMotion = ExponentDeviceMotion;
|
10 | await DeviceMotion.setUpdateInterval(1234);
|
11 | expect(NativeDeviceMotion.setUpdateInterval).toHaveBeenCalledTimes(1);
|
12 | expect(NativeDeviceMotion.setUpdateInterval).toHaveBeenCalledWith(1234);
|
13 | });
|
14 |
|
15 | it(`exports a gravity constant`, () => {
|
16 | expect(Gravity).toBeCloseTo(9.80665);
|
17 | expect(DeviceMotion.Gravity).toBe(Gravity);
|
18 | });
|