diff --git a/tasks/test-coverage.js b/tasks/test-coverage.js index 901ae583e4..8d99cea06b 100644 --- a/tasks/test-coverage.js +++ b/tasks/test-coverage.js @@ -96,7 +96,7 @@ var collectAndWriteCoverageData = function() { } }); - reporter.addAll(['lcovonly','html']); + reporter.addAll(['lcovonly', 'html']); revertBackupAndInstrumentationDir(); diff --git a/test/spec/ol/control/scaleline.test.js b/test/spec/ol/control/scaleline.test.js index f59e4aa6cd..d3e77c7ca9 100644 --- a/test/spec/ol/control/scaleline.test.js +++ b/test/spec/ol/control/scaleline.test.js @@ -137,7 +137,7 @@ describe('ol.control.ScaleLine', function() { expect(renderSpy.callCount).to.be(2); done(); }); - map.getView().setCenter([1,1]); + map.getView().setCenter([1, 1]); }); }); diff --git a/test/spec/ol/format/esrijson.test.js b/test/spec/ol/format/esrijson.test.js index ddf5109ef2..4e60a786d5 100644 --- a/test/spec/ol/format/esrijson.test.js +++ b/test/spec/ol/format/esrijson.test.js @@ -175,7 +175,7 @@ describe('ol.format.EsriJSON', function() { expect(feature).to.be.an(ol.Feature); var geometry = feature.getGeometry(); expect(geometry).to.be.an(ol.geom.MultiPoint); - expect(geometry.getCoordinates()).to.eql([[102.0, 0.0] , [103.0, 1.0]]); + expect(geometry.getCoordinates()).to.eql([[102.0, 0.0], [103.0, 1.0]]); expect(feature.get('prop0')).to.be('value0'); }); @@ -874,7 +874,7 @@ describe('ol.format.EsriJSON', function() { }); it('encodes multipoint', function() { - var multipoint = new ol.geom.MultiPoint([[102.0, 0.0] , [103.0, 1.0]]); + var multipoint = new ol.geom.MultiPoint([[102.0, 0.0], [103.0, 1.0]]); var esrijson = format.writeGeometry(multipoint); expect(multipoint.getCoordinates()).to.eql( format.readGeometry(esrijson).getCoordinates()); diff --git a/test/spec/ol/format/geojson.test.js b/test/spec/ol/format/geojson.test.js index 751db730e5..f291c2ef5f 100644 --- a/test/spec/ol/format/geojson.test.js +++ b/test/spec/ol/format/geojson.test.js @@ -809,7 +809,7 @@ describe('ol.format.GeoJSON', function() { }); it('truncates transformed point with decimals option', function() { - var point = new ol.geom.Point([2, 3]).transform('EPSG:4326','EPSG:3857'); + var point = new ol.geom.Point([2, 3]).transform('EPSG:4326', 'EPSG:3857'); var geojson = format.writeGeometry(point, { featureProjection: 'EPSG:3857', decimals: 2 diff --git a/test/spec/ol/format/kml.test.js b/test/spec/ol/format/kml.test.js index 035b51222a..730780f048 100644 --- a/test/spec/ol/format/kml.test.js +++ b/test/spec/ol/format/kml.test.js @@ -1175,9 +1175,9 @@ describe('ol.format.KML', function() { it('can write GeometryCollection geometries', function() { var collection = new ol.geom.GeometryCollection([ - new ol.geom.Point([1,2]), - new ol.geom.LineString([[1,2],[3,4]]), - new ol.geom.Polygon([[[1,2],[3,4],[3,2],[1,2]]]) + new ol.geom.Point([1, 2]), + new ol.geom.LineString([[1, 2], [3, 4]]), + new ol.geom.Polygon([[[1, 2], [3, 4], [3, 2], [1, 2]]]) ]); var features = [new ol.Feature(collection)]; var node = format.writeFeaturesNode(features); @@ -3255,7 +3255,7 @@ describe('ol.format.KML', function() { expect(nl[0].maxLodPixels).to.be(-1); expect(nl[0].minFadeExtent).to.be(0); expect(nl[0].maxFadeExtent).to.be(0); - expect(nl[1].extent).to.eql([0,0,180,90]); + expect(nl[1].extent).to.eql([0, 0, 180, 90]); }); }); }); diff --git a/test/spec/ol/format/wkt.test.js b/test/spec/ol/format/wkt.test.js index 94de1034f9..18b651cac6 100644 --- a/test/spec/ol/format/wkt.test.js +++ b/test/spec/ol/format/wkt.test.js @@ -604,7 +604,7 @@ describe('ol.format.WKT', function() { expect(polygons[0].getLinearRings().length).to.eql(1); expect(polygons[1].getLinearRings().length).to.eql(2); expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql( - [[40, 40 , 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]); + [[40, 40, 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]); expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql( [[20, 35, 1], [45, 20, 2], [30, 5, 3], [10, 10, 4], [10, 30, 5], [20, 35, 1]]); expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql( @@ -644,7 +644,7 @@ describe('ol.format.WKT', function() { expect(polygons[0].getLinearRings().length).to.eql(1); expect(polygons[1].getLinearRings().length).to.eql(2); expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql( - [[40, 40 , 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]); + [[40, 40, 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]); expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql( [[20, 35, 1], [45, 20, 2], [30, 5, 3], [10, 10, 4], [10, 30, 5], [20, 35, 1]]); expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql( @@ -684,7 +684,7 @@ describe('ol.format.WKT', function() { expect(polygons[0].getLinearRings().length).to.eql(1); expect(polygons[1].getLinearRings().length).to.eql(2); expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql( - [[40, 40 , 1, 0.1], [45, 30, 2, 0.1], [20, 45, 3, 0.1], [40, 40, 1, 0.1]]); + [[40, 40, 1, 0.1], [45, 30, 2, 0.1], [20, 45, 3, 0.1], [40, 40, 1, 0.1]]); expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql( [[20, 35, 1, 0.1], [45, 20, 2, 0.1], [30, 5, 3, 0.1], [10, 10, 4, 0.1], [10, 30, 5, 0.1], [20, 35, 1, 0.1]]); expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql( diff --git a/test/spec/ol/index.test.js b/test/spec/ol/index.test.js index 8b38580612..33ec5a7bb1 100644 --- a/test/spec/ol/index.test.js +++ b/test/spec/ol/index.test.js @@ -8,7 +8,7 @@ describe('getUid()', function() { }); it('generates a strictly increasing sequence', function() { - var a = {} , b = {}, c = {}; + var a = {}, b = {}, c = {}; ol.getUid(a); ol.getUid(c); ol.getUid(b); diff --git a/test/spec/ol/interaction/draw.test.js b/test/spec/ol/interaction/draw.test.js index dc9214d666..850ca7f59c 100644 --- a/test/spec/ol/interaction/draw.test.js +++ b/test/spec/ol/interaction/draw.test.js @@ -407,7 +407,7 @@ describe('ol.interaction.Draw', function() { source: source, type: 'LineString', finishCondition: function(event) { - if (ol.array.equals(event.coordinate,[30,-20])) { + if (ol.array.equals(event.coordinate, [30, -20])) { return true; } return false; diff --git a/test/spec/ol/interaction/extent.test.js b/test/spec/ol/interaction/extent.test.js index 38eba421e3..f32f010e4b 100644 --- a/test/spec/ol/interaction/extent.test.js +++ b/test/spec/ol/interaction/extent.test.js @@ -74,17 +74,17 @@ describe('ol.interaction.Extent', function() { } describe('snap to vertex', function() { it('snap to vertex works', function() { - interaction.setExtent([-50,-50,50,50]); + interaction.setExtent([-50, -50, 50, 50]); - expect(interaction.snapToVertex_([230,40], map)).to.eql([50,50]); - expect(interaction.snapToVertex_([231,41], map)).to.eql([50,50]); + expect(interaction.snapToVertex_([230, 40], map)).to.eql([50, 50]); + expect(interaction.snapToVertex_([231, 41], map)).to.eql([50, 50]); }); it('snap to edge works', function() { - interaction.setExtent([-50,-50,50,50]); + interaction.setExtent([-50, -50, 50, 50]); - expect(interaction.snapToVertex_([230,90], map)).to.eql([50,0]); - expect(interaction.snapToVertex_([230,89], map)).to.eql([50,1]); - expect(interaction.snapToVertex_([231,90], map)).to.eql([50,0]); + expect(interaction.snapToVertex_([230, 90], map)).to.eql([50, 0]); + expect(interaction.snapToVertex_([230, 89], map)).to.eql([50, 1]); + expect(interaction.snapToVertex_([231, 90], map)).to.eql([50, 0]); }); }); @@ -95,11 +95,11 @@ describe('ol.interaction.Extent', function() { simulateEvent('pointerdrag', 50, 50, false, 0); simulateEvent('pointerup', 50, 50, false, 0); - expect(interaction.getExtent()).to.eql([-50,-50,50,50]); + expect(interaction.getExtent()).to.eql([-50, -50, 50, 50]); }); it('clicking off extent nulls extent', function() { - interaction.setExtent([-50,-50,50,50]); + interaction.setExtent([-50, -50, 50, 50]); simulateEvent('pointerdown', -10, -10, false, 0); simulateEvent('pointerup', -10, -10, false, 0); @@ -108,32 +108,32 @@ describe('ol.interaction.Extent', function() { }); it('clicking on extent does not null extent', function() { - interaction.setExtent([-50,-50,50,50]); + interaction.setExtent([-50, -50, 50, 50]); simulateEvent('pointerdown', 50, 50, false, 0); simulateEvent('pointerup', 50, 50, false, 0); - expect(interaction.getExtent()).to.eql([-50,-50,50,50]); + expect(interaction.getExtent()).to.eql([-50, -50, 50, 50]); }); it('snap and drag vertex works', function() { - interaction.setExtent([-50,-50,50,50]); + interaction.setExtent([-50, -50, 50, 50]); simulateEvent('pointerdown', 51, 49, false, 0); simulateEvent('pointerdrag', -70, -40, false, 0); simulateEvent('pointerup', -70, -40, false, 0); - expect(interaction.getExtent()).to.eql([-70,-50,-50,-40]); + expect(interaction.getExtent()).to.eql([-70, -50, -50, -40]); }); it('snap and drag edge works', function() { - interaction.setExtent([-50,-50,50,50]); + interaction.setExtent([-50, -50, 50, 50]); simulateEvent('pointerdown', 51, 5, false, 0); simulateEvent('pointerdrag', 20, -30, false, 0); simulateEvent('pointerup', 20, -30, false, 0); - expect(interaction.getExtent()).to.eql([-50,-50,20,50]); + expect(interaction.getExtent()).to.eql([-50, -50, 20, 50]); }); }); }); diff --git a/test/spec/ol/render/canvas/immediate.test.js b/test/spec/ol/render/canvas/immediate.test.js index e4e326f0c2..0a47803954 100644 --- a/test/spec/ol/render/canvas/immediate.test.js +++ b/test/spec/ol/render/canvas/immediate.test.js @@ -246,7 +246,7 @@ describe('ol.render.canvas.Immediate', function() { [-80.899323, 29.061249000000004, 0], // lineTo() [-80.862663, 28.991361999999995, 0], // lineTo() [-80.736061, 28.788576000000006, 0] // closePath() - ]],[[ + ]], [[ // second polygon [-82.102127, 26.585724, 0], // moveTo() [-82.067139, 26.497208, 0], // lineTo() diff --git a/test/spec/ol/render/webgl/circlereplay.test.js b/test/spec/ol/render/webgl/circlereplay.test.js index 5b8d061e02..8aa91eeac3 100644 --- a/test/spec/ol/render/webgl/circlereplay.test.js +++ b/test/spec/ol/render/webgl/circlereplay.test.js @@ -49,7 +49,7 @@ describe('ol.render.webgl.CircleReplay', function() { describe('#drawCircle', function() { it('sets the buffer data', function() { - var circle = new ol.geom.Circle([0,0], 5000); + var circle = new ol.geom.Circle([0, 0], 5000); replay.setFillStrokeStyle(fillStyle, strokeStyle); replay.drawCircle(circle, null); @@ -62,7 +62,7 @@ describe('ol.render.webgl.CircleReplay', function() { }); it('does not draw if radius is zero', function() { - var circle = new ol.geom.Circle([0,0], 0); + var circle = new ol.geom.Circle([0, 0], 0); replay.drawCircle(circle, null); expect(replay.vertices).to.have.length(0); @@ -72,7 +72,7 @@ describe('ol.render.webgl.CircleReplay', function() { }); it('resets state and removes style if it belongs to a zero radius circle', function() { - var circle = new ol.geom.Circle([0,0], 0); + var circle = new ol.geom.Circle([0, 0], 0); replay.setFillStrokeStyle(fillStyle, strokeStyle); replay.setFillStrokeStyle(null, strokeStyle); diff --git a/test/spec/ol/style/style.test.js b/test/spec/ol/style/style.test.js index 6fd0618014..af1a757b00 100644 --- a/test/spec/ol/style/style.test.js +++ b/test/spec/ol/style/style.test.js @@ -46,7 +46,7 @@ describe('ol.style.Style', function() { it('copies all values', function() { var original = new ol.style.Style({ - geometry: new ol.geom.Point([0,0,0]), + geometry: new ol.geom.Point([0, 0, 0]), fill: new ol.style.Fill({ color: '#319FD3' }), @@ -72,7 +72,7 @@ describe('ol.style.Style', function() { it('the clone does not reference the same objects as the original', function() { var original = new ol.style.Style({ - geometry: new ol.geom .Point([0,0,0]), + geometry: new ol.geom .Point([0, 0, 0]), fill: new ol.style.Fill({ color: '#319FD3' }), @@ -93,7 +93,7 @@ describe('ol.style.Style', function() { expect(original.getStroke()).not.to.be(clone.getStroke()); expect(original.getText()).not.to.be(clone.getText()); - clone.getGeometry().setCoordinates([1,1,1]); + clone.getGeometry().setCoordinates([1, 1, 1]); clone.getFill().setColor('#012345'); clone.getImage().setScale(2); clone.getStroke().setColor('#012345'); diff --git a/test/spec/ol/tile.test.js b/test/spec/ol/tile.test.js index 5c649a7a0e..af3495f14b 100644 --- a/test/spec/ol/tile.test.js +++ b/test/spec/ol/tile.test.js @@ -16,15 +16,15 @@ describe('ol.Tile', function() { tile.interimTile = next; return next; }; - var tail = addToChain(head,ol.Tile.State.IDLE); //discard, deprecated by head - tail = addToChain(tail,ol.Tile.State.LOADING); //keep, request already going - tail = addToChain(tail,ol.Tile.State.IDLE); //discard, deprecated by head - tail = addToChain(tail,ol.Tile.State.LOADED); //keep, use for rendering + var tail = addToChain(head, ol.Tile.State.IDLE); //discard, deprecated by head + tail = addToChain(tail, ol.Tile.State.LOADING); //keep, request already going + tail = addToChain(tail, ol.Tile.State.IDLE); //discard, deprecated by head + tail = addToChain(tail, ol.Tile.State.LOADED); //keep, use for rendering renderTile = tail; //store this tile for later tests - tail = addToChain(tail,ol.Tile.State.IDLE); //rest of list outdated by tile above - tail = addToChain(tail,ol.Tile.State.LOADED); - tail = addToChain(tail,ol.Tile.State.LOADING); - tail = addToChain(tail,ol.Tile.State.LOADED); + tail = addToChain(tail, ol.Tile.State.IDLE); //rest of list outdated by tile above + tail = addToChain(tail, ol.Tile.State.LOADED); + tail = addToChain(tail, ol.Tile.State.LOADING); + tail = addToChain(tail, ol.Tile.State.LOADED); }); diff --git a/test/spec/ol/view.test.js b/test/spec/ol/view.test.js index e0616571a6..a7b82aa20f 100644 --- a/test/spec/ol/view.test.js +++ b/test/spec/ol/view.test.js @@ -593,7 +593,7 @@ describe('ol.View', function() { view.animate({ resolution: 2000, duration: 25 - },{ + }, { resolution: 2, duration: 25 }, function() { diff --git a/test_rendering/spec/ol/style/polygon.test.js b/test_rendering/spec/ol/style/polygon.test.js index 23843091c0..2ae0ed8e20 100644 --- a/test_rendering/spec/ol/style/polygon.test.js +++ b/test_rendering/spec/ol/style/polygon.test.js @@ -299,7 +299,7 @@ describe('ol.rendering.style.Polygon', function() { function createRainbowGradient() { var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); - var gradient = context.createLinearGradient(0,0,30,0); + var gradient = context.createLinearGradient(0, 0, 30, 0); gradient.addColorStop(0, 'red'); gradient.addColorStop(1 / 6, 'orange'); gradient.addColorStop(2 / 6, 'yellow');