Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou committed Oct 15, 2022
1 parent b54672d commit 7606b0b
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 840 deletions.
6 changes: 6 additions & 0 deletions features/step_definitions/matching.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ module.exports = function () {
got.code = json.code;
}

console.log(res.body)


if (headers.has('status')) {
got.status = json.status.toString();
Expand Down Expand Up @@ -214,6 +216,8 @@ module.exports = function () {
}
}

console.log(`OK ${ok}`)

if (ok) {
if (headers.has('matchings')) {
got.matchings = row.matchings;
Expand All @@ -234,10 +238,12 @@ module.exports = function () {

cb(null, got);
};
console.log('REQ = ', row.request)

if (row.request) {
got = {};
got.request = row.request;
console.log('REQ = ', row.request)
this.requestUrl(row.request, afterRequest);
} else {
var params = this.queryParams;
Expand Down
2 changes: 1 addition & 1 deletion features/support/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = function () {
var runRequest = (cb) => {
var params = this.paramsToString(parameters);
this.query = baseUri + (params.length ? '/' + params : '');

console.log(`query = ${this.query}`);
request(this.query, (err, res, body) => {
if (err && err.code === 'ECONNREFUSED') {
return cb(new Error('*** osrm-routed is not running.'));
Expand Down
3 changes: 2 additions & 1 deletion features/support/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = function () {
} else {
uri = [this.HOST, service, 'v1', this.profile].join('/');
}

return this.sendRequest(uri, params, callback);
};

Expand Down Expand Up @@ -122,6 +121,8 @@ module.exports = function () {
params.timestamps = timestamps.join(';');
}

console.log(`match ${JSON.stringify(params)}`)

return this.requestPath('match', params, callback);
};

Expand Down
6 changes: 4 additions & 2 deletions features/support/shared_steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ module.exports = function () {
let json = JSON.parse(body);

got.code = json.code;

console.log(`body ${body}`)
let hasRoute = json.code === 'Ok';

if (hasRoute) {
instructions = this.wayList(json.routes[0]);
pronunciations = this.pronunciationList(json.routes[0]);
Expand Down Expand Up @@ -88,8 +87,11 @@ module.exports = function () {
got.geometry = json.routes[0].geometry;
}

console.log(`hasRoute: ${hasRoute}`);
if (headers.has('route')) {
console.log(`hasRoute2: ${hasRoute}`);
got.route = (instructions || '').trim();
console.log(`hasRoute2: ${got.route}`);
}

if (headers.has('summary')) {
Expand Down
Loading

0 comments on commit 7606b0b

Please sign in to comment.