Skip to content

Commit

Permalink
Merge pull request #84 from GIScience/test/object-parameter
Browse files Browse the repository at this point in the history
test: add test for other parameters
  • Loading branch information
TheGreatRefrigerator authored Jul 11, 2024
2 parents 8716666 + fe8fd0a commit da9ecaf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/__tests__/OrsDirections.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ describe('Test Directions', () => {
expect(req.headers).to.include({'Accept': 'application/json'})
})
})

it('can use other object parameters', async () => {
let json = await orsDirections.calculate({
coordinates: [[8.690958, 49.404662], [8.687868, 49.390139]],
profile: 'foot-walking',
alternative_routes: {
target_count: 2,
weight_factor: 1.4,
share_factor: 0.5
}
})
expect(json['routes']).to.have.length(2)
expect(json['metadata']['query']['alternative_routes']).to.be.a('Object')
})
})
})
})

0 comments on commit da9ecaf

Please sign in to comment.