From 79b8df91de8eb6b46d1a1aa404104ca479940176 Mon Sep 17 00:00:00 2001 From: Whytro Date: Sat, 8 Apr 2023 20:43:42 +0900 Subject: [PATCH] Adjust unit test and fix newline --- include/nodejs/node_osrm_support.hpp | 2 +- test/nodejs/index.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/nodejs/node_osrm_support.hpp b/include/nodejs/node_osrm_support.hpp index b3d5d432c..6a833b353 100644 --- a/include/nodejs/node_osrm_support.hpp +++ b/include/nodejs/node_osrm_support.hpp @@ -1717,4 +1717,4 @@ inline match_parameters_ptr argumentsToMatchParameter(const Napi::CallbackInfo & } // namespace node_osrm -#endif \ No newline at end of file +#endif diff --git a/test/nodejs/index.js b/test/nodejs/index.js index 00b7d282c..a828ffe1e 100644 --- a/test/nodejs/index.js +++ b/test/nodejs/index.js @@ -125,9 +125,10 @@ test('constructor: takes a default_radius unlimited argument', function(assert) }); test('constructor: throws if default_radius is not a number', function(assert) { - assert.plan(2); - assert.throws(function() { new OSRM({algorithm: 'MLD', path: monaco_mld_path, default_radius: 'abc'}); }, /default_radius must be an integral number/, 'Does not accept string'); + assert.plan(3); + assert.throws(function() { new OSRM({algorithm: 'MLD', path: monaco_mld_path, default_radius: 'abc'}); }, /default_radius must be unlimited or an integral number/, 'Does not accept invalid string'); assert.ok(new OSRM({algorithm: 'MLD', path: monaco_mld_path, default_radius: 1}), 'Does accept number'); + assert.ok(new OSRM({algorithm: 'MLD', path: monaco_mld_path, default_radius: 'unlimited'}), 'Does accept unlimited'); }); test('constructor: parses custom limits', function(assert) {