Skip to content

Commit 79d3ffd

Browse files
Merge branch 'master' into sf-osrm-routed
2 parents b511ec9 + c1d2c15 commit 79d3ffd

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Unreleased
22
- Changes from 5.27.1
33
- Misc:
4+
- FIXED: Handle snapping parameter for all plugins in NodeJs bindings, but not for Route only. [#6417](https://github.com/Project-OSRM/osrm-backend/pull/6417)
45
- FIXED: Fix annotations=true handling in NodeJS bindings & libosrm. [#6415](https://github.com/Project-OSRM/osrm-backend/pull/6415/)
56
- FIXED: Fix bindings compilation issue on the latest Node. Update NAN to 2.17.0. [#6416](https://github.com/Project-OSRM/osrm-backend/pull/6416)
67
# 5.27.1

test/nodejs/table.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,30 @@ test('table: returns buffer', function(assert) {
8080
});
8181
});
8282

83+
test('table: throws on invalid snapping values', function (assert) {
84+
assert.plan(1);
85+
var osrm = new OSRM(data_path);
86+
var options = {
87+
coordinates: [three_test_coordinates[0], three_test_coordinates[1]],
88+
snapping: 'zing'
89+
};
90+
assert.throws(function () { osrm.table(options, function (err, response) { }); },
91+
/'snapping' param must be one of \[default, any\]/);
92+
});
93+
94+
test('table: snapping parameter passed through OK', function (assert) {
95+
assert.plan(2);
96+
var osrm = new OSRM(data_path);
97+
var options = {
98+
coordinates: [three_test_coordinates[0], three_test_coordinates[1]],
99+
snapping: 'any'
100+
};
101+
osrm.table(options, function(err, table) {
102+
assert.ifError(err);
103+
assert.ok(table['durations'], 'distances table result should exist');
104+
});
105+
});
106+
83107
var tables = ['distances', 'durations'];
84108

85109
tables.forEach(function(annotation) {

0 commit comments

Comments
 (0)