Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matey97 committed May 11, 2022
1 parent 758df7e commit c329537
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions demo/app/tests/internal/sensor-callback-manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ describe("Sensor callback manager", () => {

const sensorRecordA1: SensorRecord = {
deviceId: "test",
timestamp: new Date()
timestamp: Date.now()
};
const sensorRecordA2: SensorRecord = {
deviceId: "test",
timestamp: new Date()
timestamp: Date.now()
};
const sensorRecordB1: SensorRecord = {
deviceId: "test",
timestamp: new Date()
timestamp: Date.now()
};
const noNotificationTimeout = 100;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("Heart rate record messaging service", () => {

function getFakeHeartRateData() {
return {
timestamp: new Date(),
timestamp: Date.now(),
value: Math.floor(Math.random() * 100),
};
}
Expand All @@ -51,7 +51,7 @@ function buildFakeEncodedMessage(expectedRecords: HeartRateSensorRecord[]) {
buff.putInt(expectedRecords.length);
expectedRecords.forEach((record) => {
buff.putInt(record.value);
buff.putLong(record.timestamp.getTime());
buff.putLong(record.timestamp);
})

return bytes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("Location record messaging service", () => {

function getFakeLocationData() {
return {
timestamp: new Date(),
timestamp: Date.now(),
latitude: 39.9939752904,
longitude: -0.0741332084749,
altitude: 20,
Expand All @@ -57,7 +57,7 @@ function buildFakeEncodedMessage(expectedRecords: LocationSensorRecord[]) {
buff.putDouble(record.latitude);
buff.putDouble(record.longitude);
buff.putDouble(record.altitude);
buff.putLong(record.timestamp.getTime());
buff.putLong(record.timestamp);
})

return bytes;
Expand Down
4 changes: 2 additions & 2 deletions demo/app/tests/internal/sensors/triaxial/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { TriAxialSensorRecord } from "nativescript-wearos-sensors/internal/senso

export function getFakeTriAxialData() {
return {
timestamp: new Date(),
timestamp: Date.now(),
x: Math.random(),
y: Math.random(),
z: Math.random(),
Expand All @@ -20,7 +20,7 @@ export function buildFakeEncodedMessage(expectedRecords: TriAxialSensorRecord[])
buff.putFloat(record.x);
buff.putFloat(record.y);
buff.putFloat(record.z);
buff.putLong(record.timestamp.getTime());
buff.putLong(record.timestamp);
})

return bytes;
Expand Down

0 comments on commit c329537

Please sign in to comment.