diff --git a/src/user.ts b/src/user.ts index 47c1177..d791641 100644 --- a/src/user.ts +++ b/src/user.ts @@ -23,8 +23,8 @@ export function createUser({ normalizeCoordinates = ({ latitude = 0, longitude = 0, - accuracy = 10, altitude = null, + accuracy = 10, altitudeAccuracy = null, heading = null, speed = null, @@ -32,8 +32,8 @@ export function createUser({ createCoordinates({ latitude, longitude, - accuracy, altitude, + accuracy, altitudeAccuracy, heading, speed, diff --git a/test/browser-utils.js b/test/browser-utils.js index 5ecbf6a..604e657 100644 --- a/test/browser-utils.js +++ b/test/browser-utils.js @@ -6,8 +6,8 @@ function logPosition( coords: { latitude, longitude, - accuracy, altitude, + accuracy, altitudeAccuracy, heading, speed, @@ -22,8 +22,8 @@ function logPosition( coords: { latitude, longitude, - accuracy, altitude, + accuracy, altitudeAccuracy, heading, speed, diff --git a/test/fixture/coords.ts b/test/fixture/coords.ts index 31d58a4..78b3bec 100644 --- a/test/fixture/coords.ts +++ b/test/fixture/coords.ts @@ -3,8 +3,8 @@ import { createCoordinates } from "fake-geolocation"; export const coordsA: GeolocationCoordinates = createCoordinates({ latitude: 40.71703581534977, longitude: -74.03457283319447, - accuracy: 25.019, altitude: 22.27227783203125, + accuracy: 25.019, altitudeAccuracy: 9.838127136230469, heading: null, speed: null, @@ -13,8 +13,8 @@ export const coordsA: GeolocationCoordinates = createCoordinates({ export const coordsB: GeolocationCoordinates = createCoordinates({ latitude: 12, longitude: 34, - accuracy: 56, altitude: 78, + accuracy: 56, altitudeAccuracy: 9, heading: null, speed: null, @@ -23,8 +23,8 @@ export const coordsB: GeolocationCoordinates = createCoordinates({ export const coordsC: GeolocationCoordinates = createCoordinates({ latitude: 98, longitude: 76, - accuracy: 54, altitude: 32, + accuracy: 54, altitudeAccuracy: 10, heading: null, speed: null, @@ -33,8 +33,8 @@ export const coordsC: GeolocationCoordinates = createCoordinates({ export const coordsD: GeolocationCoordinates = createCoordinates({ latitude: 23, longitude: 45, - accuracy: 67, altitude: 89, + accuracy: 67, altitudeAccuracy: 10, heading: null, speed: null, diff --git a/test/vitest/create-coordinates.spec.ts b/test/vitest/create-coordinates.spec.ts index 93b796e..36a6f41 100644 --- a/test/vitest/create-coordinates.spec.ts +++ b/test/vitest/create-coordinates.spec.ts @@ -1,9 +1,13 @@ -import { createCoordinates, GeolocationCoordinates } from "fake-geolocation"; +import { + createCoordinates, + GeolocationCoordinates, + type GeolocationCoordinatesParameters, +} from "fake-geolocation"; import { describe, expect, it } from "vitest"; describe("createCoordinates()", () => { describe("when all properties are provided", () => { - const properties = { + const properties: GeolocationCoordinatesParameters = { latitude: 11, longitude: 22, altitude: 33, @@ -11,7 +15,7 @@ describe("createCoordinates()", () => { altitudeAccuracy: 55, heading: 66, speed: 77, - } as const; + }; it("creates coordinates", () => { const coords = createCoordinates(properties); @@ -31,11 +35,11 @@ describe("createCoordinates()", () => { }); describe("when some properties are provided", () => { - const properties = { + const properties: Partial = { latitude: 11, longitude: 22, accuracy: 33, - } as const; + }; it("creates coordinates", () => { const coords = createCoordinates(properties); @@ -73,15 +77,15 @@ describe("createCoordinates()", () => { }); describe("when explicit undefined properties are provided", () => { - const properties = { + const properties: Partial = { latitude: undefined, longitude: undefined, - accuracy: undefined, altitude: undefined, + accuracy: undefined, altitudeAccuracy: undefined, heading: undefined, speed: undefined, - } as const; + }; it("creates coordinates", () => { const coords = createCoordinates(properties); diff --git a/test/vitest/create-position.spec.ts b/test/vitest/create-position.spec.ts index db13335..af9f258 100644 --- a/test/vitest/create-position.spec.ts +++ b/test/vitest/create-position.spec.ts @@ -99,8 +99,8 @@ describe("createPosition()", () => { const coordsProperties = { latitude: undefined, longitude: undefined, - accuracy: undefined, altitude: undefined, + accuracy: undefined, altitudeAccuracy: undefined, heading: undefined, speed: undefined, diff --git a/test/vitest/geolocation-coordinates.spec.ts b/test/vitest/geolocation-coordinates.spec.ts index 7ec1cb3..8861c59 100644 --- a/test/vitest/geolocation-coordinates.spec.ts +++ b/test/vitest/geolocation-coordinates.spec.ts @@ -49,14 +49,14 @@ describe("GeolocationCoordinates", () => { expect(coordinates.longitude).toBe(-74.03457283319447); }); - it("has an accuracy property", () => { - expect(coordinates.accuracy).toBe(25.019); - }); - it("has an altitude property", () => { expect(coordinates.altitude).toBe(22.27227783203125); }); + it("has an accuracy property", () => { + expect(coordinates.accuracy).toBe(25.019); + }); + it("has an altitudeAccuracy property", () => { expect(coordinates.altitudeAccuracy).toBe(9.838127136230469); }); diff --git a/test/vitest/geolocation-position.spec.ts b/test/vitest/geolocation-position.spec.ts index efb3530..85875b1 100644 --- a/test/vitest/geolocation-position.spec.ts +++ b/test/vitest/geolocation-position.spec.ts @@ -42,8 +42,8 @@ describe("GeolocationPosition", () => { expect(position.coords).toMatchObject({ latitude: 40.71703581534977, longitude: -74.03457283319447, - accuracy: 25.019, altitude: 22.27227783203125, + accuracy: 25.019, altitudeAccuracy: 9.838127136230469, heading: 90, speed: 111, @@ -62,8 +62,8 @@ describe("GeolocationPosition", () => { coords: { latitude: 40.71703581534977, longitude: -74.03457283319447, - accuracy: 25.019, altitude: 22.27227783203125, + accuracy: 25.019, altitudeAccuracy: 9.838127136230469, heading: 90, speed: 111, diff --git a/test/vitest/user.spec.ts b/test/vitest/user.spec.ts index 171881f..a541e83 100644 --- a/test/vitest/user.spec.ts +++ b/test/vitest/user.spec.ts @@ -129,8 +129,8 @@ describe("User", () => { expect(await locationServices.acquireCoordinates(false)).toEqual({ latitude: 40.71703581534977, longitude: -74.03457283319447, - accuracy: 111111, altitude: 22.27227783203125, + accuracy: 111111, altitudeAccuracy: 222222, heading: null, speed: null, @@ -149,8 +149,8 @@ describe("User", () => { expect(await locationServices.acquireCoordinates(true)).toEqual({ latitude: 0, longitude: 0, - accuracy: 10, altitude: null, + accuracy: 10, altitudeAccuracy: null, heading: null, speed: null,