code: function closeTo(expected, delta) {
      return {asymmetricMatch: function(actual) {
        return Math.abs(actual - expected) < delta;
      }};
    }
docs: it('gets speed limits for a path', function(done) { googleMaps.snappedSpeedLimits({ path: [ [60.170880, 24.942795], [60.170879, 24.942796], [60.170877, 24.942796] ], units: 'MPH' }) .asPromise() .then(function(response) { expect(response.json.speedLimits).toEqual( arrayContaining([ objectContaining({ speedLimit: closeTo(19, 1), units: 'MPH' }) ])); }) .then(done, fail); });