Skip to content

Commit

Permalink
Add type test for GeolocationCoordinatesParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Jul 4, 2024
1 parent 7bb3e4c commit e43f3f5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/vitest/geolocation-coordinates-parameters.spec.ts
Original file line number Diff line number Diff line change
@@ -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<GeolocationCoordinatesParameters>().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
});
});

0 comments on commit e43f3f5

Please sign in to comment.