Browse Source

chore(geo_common): assert that a specific exception was thrown

Without checking the message when asserting an exception is thrown, it's
possible for the test to pass when undesired behavior is occuring.
pull/1207/head
Julian Simioni 6 years ago
parent
commit
40e6054523
No known key found for this signature in database
GPG Key ID: B9EEB0C6EE0910A1
  1. 4
      test/unit/sanitizer/_geo_common.js

4
test/unit/sanitizer/_geo_common.js

@ -243,7 +243,7 @@ module.exports.tests.rect = function(test, common) {
t.throws( function(){ t.throws( function(){
sanitize.sanitize_rect( 'boundary.rect', clean, params, mandatory ); sanitize.sanitize_rect( 'boundary.rect', clean, params, mandatory );
}); },/boundary.rect.min_lat \(0\) must be less than boundary.rect.max_lat \(0\)/);
t.end(); t.end();
}); });
@ -294,7 +294,7 @@ module.exports.tests.rect = function(test, common) {
t.throws( function() { t.throws( function() {
sanitize.sanitize_rect( 'boundary.rect', clean, params, mandatory ); sanitize.sanitize_rect( 'boundary.rect', clean, params, mandatory );
}); },/boundary.rect.min_lat \(52.7945\) must be less than boundary.rect.max_lat \(52.2387\)/, 'should error when min >= max');
t.end(); t.end();
}); });

Loading…
Cancel
Save