Use blocked scoped variables
In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
This commit is contained in:
@@ -4,7 +4,7 @@ import _ol_geom_flat_segments_ from '../../../../../src/ol/geom/flat/segments.js
|
||||
describe('ol.geom.flat.segments', function() {
|
||||
|
||||
describe('ol.geom.flat.segments.forEach', function() {
|
||||
var flatCoordinates, offset, end, stride;
|
||||
let flatCoordinates, offset, end, stride;
|
||||
beforeEach(function() {
|
||||
flatCoordinates = [0, 0, 1, 1, 2, 2, 3, 3];
|
||||
offset = 0;
|
||||
@@ -13,12 +13,12 @@ describe('ol.geom.flat.segments', function() {
|
||||
});
|
||||
describe('callback returns undefined', function() {
|
||||
it('executes the callback for each segment', function() {
|
||||
var args = [];
|
||||
var spy = sinon.spy(function(point1, point2) {
|
||||
const args = [];
|
||||
const spy = sinon.spy(function(point1, point2) {
|
||||
args.push([point1[0], point1[1], point2[0], point2[1]]);
|
||||
});
|
||||
var ret = _ol_geom_flat_segments_.forEach(
|
||||
flatCoordinates, offset, end, stride, spy);
|
||||
const ret = _ol_geom_flat_segments_.forEach(
|
||||
flatCoordinates, offset, end, stride, spy);
|
||||
expect(spy.callCount).to.be(3);
|
||||
expect(args[0][0]).to.be(0);
|
||||
expect(args[0][1]).to.be(0);
|
||||
@@ -37,13 +37,13 @@ describe('ol.geom.flat.segments', function() {
|
||||
});
|
||||
describe('callback returns true', function() {
|
||||
it('executes the callback for the first segment', function() {
|
||||
var args = [];
|
||||
var spy = sinon.spy(function(point1, point2) {
|
||||
const args = [];
|
||||
const spy = sinon.spy(function(point1, point2) {
|
||||
args.push([point1[0], point1[1], point2[0], point2[1]]);
|
||||
return true;
|
||||
});
|
||||
var ret = _ol_geom_flat_segments_.forEach(
|
||||
flatCoordinates, offset, end, stride, spy);
|
||||
const ret = _ol_geom_flat_segments_.forEach(
|
||||
flatCoordinates, offset, end, stride, spy);
|
||||
expect(spy.callCount).to.be(1);
|
||||
expect(args[0][0]).to.be(0);
|
||||
expect(args[0][1]).to.be(0);
|
||||
|
||||
Reference in New Issue
Block a user