mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2026-01-01 08:22:41 +00:00
add steps to route response
This commit is contained in:
@@ -26,6 +26,11 @@ const mockHttpService = {
|
||||
.mockImplementationOnce(() => {
|
||||
return throwError(() => 'Router unavailable');
|
||||
})
|
||||
.mockImplementationOnce(() => {
|
||||
return of({
|
||||
status: 200,
|
||||
});
|
||||
})
|
||||
.mockImplementationOnce(() => {
|
||||
return of({
|
||||
status: 200,
|
||||
@@ -338,6 +343,28 @@ describe('Graphhopper Georouter', () => {
|
||||
).rejects.toBeInstanceOf(GeorouterUnavailableException);
|
||||
});
|
||||
|
||||
it('should fail if georouter response is corrupted', async () => {
|
||||
await expect(
|
||||
graphhopperGeorouter.route(
|
||||
[
|
||||
{
|
||||
lon: 0,
|
||||
lat: 0,
|
||||
},
|
||||
{
|
||||
lon: 1,
|
||||
lat: 1,
|
||||
},
|
||||
],
|
||||
{
|
||||
detailedDistance: false,
|
||||
detailedDuration: false,
|
||||
points: false,
|
||||
},
|
||||
),
|
||||
).rejects.toBeInstanceOf(GeorouterUnavailableException);
|
||||
});
|
||||
|
||||
it('should create a basic route', async () => {
|
||||
const route: Route = await graphhopperGeorouter.route(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user