From e43f3f5fea09ac260b9d72b227f517958e80af0a Mon Sep 17 00:00:00 2001 From: Erin Millard Date: Fri, 5 Jul 2024 09:51:03 +1000 Subject: [PATCH] Add type test for GeolocationCoordinatesParameters --- .../geolocation-coordinates-parameters.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/vitest/geolocation-coordinates-parameters.spec.ts diff --git a/test/vitest/geolocation-coordinates-parameters.spec.ts b/test/vitest/geolocation-coordinates-parameters.spec.ts new file mode 100644 index 0000000..ab4d971 --- /dev/null +++ b/test/vitest/geolocation-coordinates-parameters.spec.ts @@ -0,0 +1,18 @@ +/* eslint-disable @typescript-eslint/no-unsafe-argument */ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import type { GeolocationCoordinatesParameters } from "fake-geolocation"; +import { describe, expectTypeOf, it } from "vitest"; + +describe("GeolocationCoordinatesParameters", () => { + it("accepts the same properties as GeolocationCoordinates", () => { + expectTypeOf().toEqualTypeOf<{ + latitude: number; + longitude: number; + altitude: number | null; + accuracy: number; + altitudeAccuracy: number | null; + heading: number | null; + speed: number | null; + }>(undefined as any); // weird that this is necessary + }); +});