chai-leaflet
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -57,6 +57,7 @@ /** | ||
Assertion.addMethod('nearLatLng', function (expected, delta) { | ||
function nearLatLng(expected, delta) { | ||
delta = delta || 1e-4; | ||
var actual = this._obj; | ||
var expected = L.latLng(expected); | ||
@@ -70,3 +71,5 @@ this.assert( | ||
); | ||
}); | ||
} | ||
Assertion.addMethod('nearLatLng', nearLatLng); | ||
Assertion.addMethod('near', nearLatLng); | ||
@@ -73,0 +76,0 @@ Assertion.addMethod('zoom', function (zoom) { |
{ | ||
"name": "chai-leaflet", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Chai assertions to use with Leaflet map apps", | ||
@@ -5,0 +5,0 @@ "main": "chai-leaflet.js", |
@@ -8,10 +8,11 @@ # chai-leaflet | ||
foo.should.be.nearLatLng([51, 4]); | ||
latlng.should.be.near([51, 4]); | ||
map.should.have.view([33, 2], 4); | ||
map.should.have.zoom(18); | ||
``` | ||
@@ -10,2 +10,5 @@ 'use strict'; | ||
[1, 2].should.be.deepAlmostEqual([1, 2], 0.1); | ||
[1.0, 2.0].should.be.deepAlmostEqual([1, 2], 0.1); | ||
[1.01, 2.02].should.be.deepAlmostEqual([1, 2], 0.1); | ||
[1, 2].should.not.be.deepAlmostEqual([1, 3], 0.1); | ||
@@ -30,4 +33,5 @@ }); | ||
latlng.should.be.nearLatLng(latlng); | ||
latlng.should.not.be.nearLatLng(L.latLng([4, 51])); | ||
latlng.should.be.near(latlng); | ||
latlng.should.be.near([51, 4]); | ||
latlng.should.not.be.near(L.latLng([4, 51])); | ||
}); | ||
@@ -40,4 +44,4 @@ | ||
latlng.should.be.nearLatLng(L.latLng(51.01, 4.01), delta); | ||
latlng.should.not.be.nearLatLng(L.latLng(51.4, 4.4), delta); | ||
latlng.should.be.near(L.latLng(51.01, 4.01), delta); | ||
latlng.should.not.be.near(L.latLng(51.4, 4.4), delta); | ||
}); | ||
@@ -44,0 +48,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5996
132
18