Files
Auuki/test/ble/cps.test.js
dvmarinoff 1700457b8b refactor power meter, add wahoo cycling power service
- Data class from FTMS control-point.js becomes Spec and is in ble/common.js
- StateValue from CSCS becomes State and is in ble/common.js
- refactoring power meter to use Speed and Cadence from CSCS
- adding tests for power meter
- adding very basic support for wahoo cycling power service
  - add Wahoo advanced FTMS to ble filter add cycling power service to
    optional services,
  - add WahooCyclingPower service,
  - add Wahoo Trainer control characteristic
    - request control
    - setting power target

NOTE: Wahoo Cycling power is untested at the moment
2021-12-30 17:10:37 +02:00

33 lines
728 B
JavaScript

import { uuids } from '../../src/ble/uuids.js';
import { measurement, _ } from '../../src/ble/cps/cycling-power-measurement.js';
global.console = {
log: jest.fn(),
error: console.error,
warn: console.warn,
};
describe('index', () => {
test('flagsIndex', () => {
expect(_.flagsIndex()).toBe(0);
});
test('wheelRevolutionsIndex', () => {
expect(_.wheelRevolutionsIndex(48)).toBe(4);
});
test('wheelEventIndex', () => {
expect(_.wheelEventIndex(48)).toBe(8);
});
test('crankRevolutionsIndex', () => {
expect(_.crankRevolutionsIndex(48)).toBe(10);
});
test('crankEventIndex', () => {
expect(_.crankEventIndex(48)).toBe(12);
});
});