Allow to specify empty bearings string in input parameters

This commit is contained in:
Michael Krasnyk 2017-11-11 11:26:41 -05:00
parent 2c13d55c8a
commit fdf670d297
No known key found for this signature in database
GPG Key ID: 49C12AD0F43D2108

View File

@ -12,6 +12,10 @@ module.exports = {
FuzzyMatch: class {
match (got, want) {
// don't fail if bearings input and extected string is empty and actual result is undefined
if (want === '' && (got === '' || got === undefined))
return true;
var matchPercent = want.match(/(.*)\s+~(.+)%$/),
matchAbs = want.match(/(.*)\s+\+\-(.+)$/),
matchRe = want.match(/^\/(.*)\/$/),