mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2026-01-01 07:52:41 +00:00
fix geodesic error on azimuth
This commit is contained in:
@@ -11,4 +11,26 @@ describe('Matcher geodesic', () => {
|
||||
expect(Math.round(inv.azimuth as number)).toBe(45);
|
||||
expect(Math.round(inv.distance as number)).toBe(156900);
|
||||
});
|
||||
it('should get azimuth value', () => {
|
||||
const geodesic: Geodesic = new Geodesic();
|
||||
const azimuth = geodesic.azimuth(0, 0, 1, 1);
|
||||
expect(Math.round(azimuth as number)).toBe(45);
|
||||
});
|
||||
it('should get distance value', () => {
|
||||
const geodesic: Geodesic = new Geodesic();
|
||||
const distance = geodesic.distance(0, 0, 1, 1);
|
||||
expect(Math.round(distance as number)).toBe(156900);
|
||||
});
|
||||
it('should throw an exception if inverse fails', () => {
|
||||
const geodesic: Geodesic = new Geodesic();
|
||||
expect(() => {
|
||||
geodesic.inverse(7.74547, 48.583035, 7.74547, 48.583036);
|
||||
}).toThrow();
|
||||
});
|
||||
it('should throw an exception if azimuth fails', () => {
|
||||
const geodesic: Geodesic = new Geodesic();
|
||||
expect(() => {
|
||||
geodesic.azimuth(7.74547, 48.583035, 7.74547, 48.583036);
|
||||
}).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -253,6 +253,8 @@ const mockGeodesic: GeodesicPort = {
|
||||
azimuth: 45,
|
||||
distance: 50000,
|
||||
})),
|
||||
azimuth: jest.fn().mockImplementation(() => 45),
|
||||
distance: jest.fn().mockImplementation(() => 50000),
|
||||
};
|
||||
|
||||
const mockDefaultParamsProvider: DefaultParamsProviderPort = {
|
||||
|
||||
Reference in New Issue
Block a user