Convert to expect.js assertions
This commit is contained in:
parent
55edd44678
commit
0e9b7249d8
@ -1,7 +1,7 @@
|
||||
describe("L.Marker#toGeoJSON", function () {
|
||||
it("returns a Point object", function () {
|
||||
var marker = new L.Marker([10, 20]);
|
||||
expect(marker.toGeoJSON()).toEqual({
|
||||
expect(marker.toGeoJSON()).to.eql({
|
||||
type: 'Point',
|
||||
coordinates: [20, 10]
|
||||
});
|
||||
@ -11,7 +11,7 @@ describe("L.Marker#toGeoJSON", function () {
|
||||
describe("L.Polyline#toGeoJSON", function () {
|
||||
it("returns a LineString object", function () {
|
||||
var polyline = new L.Polyline([[10, 20], [2, 5]]);
|
||||
expect(polyline.toGeoJSON()).toEqual({
|
||||
expect(polyline.toGeoJSON()).to.eql({
|
||||
type: 'LineString',
|
||||
coordinates: [[20, 10], [5, 2]]
|
||||
});
|
||||
@ -21,7 +21,7 @@ describe("L.Polyline#toGeoJSON", function () {
|
||||
describe("L.MultiPolyline#toGeoJSON", function () {
|
||||
it("returns a MultiLineString object", function () {
|
||||
var multiPolyline = new L.MultiPolyline([[[10, 20], [2, 5]], [[1, 2], [3, 4]]]);
|
||||
expect(multiPolyline.toGeoJSON()).toEqual({
|
||||
expect(multiPolyline.toGeoJSON()).to.eql({
|
||||
type: 'MultiLineString',
|
||||
coordinates: [
|
||||
[[20, 10], [5, 2]],
|
||||
@ -34,7 +34,7 @@ describe("L.MultiPolyline#toGeoJSON", function () {
|
||||
describe("L.Polygon#toGeoJSON", function () {
|
||||
it("returns a Polygon object (no holes)", function () {
|
||||
var polygon = new L.Polygon([[1, 2], [3, 4], [5, 6]]);
|
||||
expect(polygon.toGeoJSON()).toEqual({
|
||||
expect(polygon.toGeoJSON()).to.eql({
|
||||
type: 'Polygon',
|
||||
coordinates: [[[2, 1], [4, 3], [6, 5], [2, 1]]]
|
||||
});
|
||||
@ -42,7 +42,7 @@ describe("L.Polygon#toGeoJSON", function () {
|
||||
|
||||
it("returns a Polygon object (with holes)", function () {
|
||||
var polygon = new L.Polygon([[[1, 2], [3, 4], [5, 6]], [[7, 8], [9, 10], [11, 12]]]);
|
||||
expect(polygon.toGeoJSON()).toEqual({
|
||||
expect(polygon.toGeoJSON()).to.eql({
|
||||
type: 'Polygon',
|
||||
coordinates: [
|
||||
[[2, 1], [4, 3], [6, 5], [2, 1]],
|
||||
@ -55,7 +55,7 @@ describe("L.Polygon#toGeoJSON", function () {
|
||||
describe("L.MultiPolygon#toGeoJSON", function () {
|
||||
it("returns a MultiPolygon object", function () {
|
||||
var multiPolygon = new L.MultiPolygon([[[1, 2], [3, 4], [5, 6]]]);
|
||||
expect(multiPolygon.toGeoJSON()).toEqual({
|
||||
expect(multiPolygon.toGeoJSON()).to.eql({
|
||||
type: 'MultiPolygon',
|
||||
coordinates: [
|
||||
[[[2, 1], [4, 3], [6, 5], [2, 1]]]
|
||||
@ -69,7 +69,7 @@ describe("L.LayerGroup#toGeoJSON", function () {
|
||||
var marker = new L.Marker([10, 20]),
|
||||
polyline = new L.Polyline([[10, 20], [2, 5]]),
|
||||
layerGroup = new L.LayerGroup([marker, polyline]);
|
||||
expect(layerGroup.toGeoJSON()).toEqual({
|
||||
expect(layerGroup.toGeoJSON()).to.eql({
|
||||
type: 'GeometryCollection',
|
||||
geometries: [marker.toGeoJSON(), polyline.toGeoJSON()]
|
||||
});
|
||||
@ -78,7 +78,7 @@ describe("L.LayerGroup#toGeoJSON", function () {
|
||||
it("omits layers which do not implement toGeoJSON", function () {
|
||||
var tileLayer = new L.TileLayer(),
|
||||
layerGroup = new L.LayerGroup([tileLayer]);
|
||||
expect(layerGroup.toGeoJSON()).toEqual({
|
||||
expect(layerGroup.toGeoJSON()).to.eql({
|
||||
type: 'GeometryCollection',
|
||||
geometries: []
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user