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:
Tim Schaub
2018-01-11 23:32:36 -07:00
parent 0bf2b04dee
commit ad62739a6e
684 changed files with 18120 additions and 18184 deletions

View File

@@ -4,8 +4,8 @@ describe('ol.format.WMSCapabilities', function() {
describe('when parsing ogcsample.xml', function() {
var parser = new WMSCapabilities();
var capabilities;
const parser = new WMSCapabilities();
let capabilities;
before(function(done) {
afterLoadText('spec/ol/format/wms/ogcsample.xml', function(xml) {
try {
@@ -23,8 +23,8 @@ describe('ol.format.WMSCapabilities', function() {
it('can read Service section', function() {
// FIXME not all fields are tested
var service = capabilities.Service;
var contact = service.ContactInformation;
const service = capabilities.Service;
const contact = service.ContactInformation;
expect(service.Name).to.eql('WMS');
expect(service.Title).to.eql('Acme Corp. Map Server');
@@ -44,42 +44,42 @@ describe('ol.format.WMSCapabilities', function() {
});
it('can read Capability.Exception', function() {
var exception = capabilities.Capability.Exception;
const exception = capabilities.Capability.Exception;
expect(exception).to.eql(['XML', 'INIMAGE', 'BLANK']);
});
it('can read Capability.Request.GetCapabilities', function() {
var getCapabilities = capabilities.Capability.Request.GetCapabilities;
const getCapabilities = capabilities.Capability.Request.GetCapabilities;
expect(getCapabilities.Format).to.eql(['text/xml']);
expect(getCapabilities.DCPType.length).to.eql(1);
var http = getCapabilities.DCPType[0].HTTP;
const http = getCapabilities.DCPType[0].HTTP;
expect(http.Get.OnlineResource).to.eql('http://hostname/path?');
expect(http.Post.OnlineResource).to.eql('http://hostname/path?');
});
it('can read Capability.Request.GetFeatureInfo', function() {
var getFeatureInfo = capabilities.Capability.Request.GetFeatureInfo;
const getFeatureInfo = capabilities.Capability.Request.GetFeatureInfo;
expect(getFeatureInfo.Format).to.eql(
['text/xml', 'text/plain', 'text/html']);
['text/xml', 'text/plain', 'text/html']);
expect(getFeatureInfo.DCPType.length).to.eql(1);
var http = getFeatureInfo.DCPType[0].HTTP;
const http = getFeatureInfo.DCPType[0].HTTP;
expect(http.Get.OnlineResource).to.eql('http://hostname/path?');
});
it('can read Capability.Request.GetMap', function() {
var getMap = capabilities.Capability.Request.GetMap;
const getMap = capabilities.Capability.Request.GetMap;
expect(getMap.Format).to.eql(['image/gif', 'image/png', 'image/jpeg']);
expect(getMap.DCPType.length).to.eql(1);
var http = getMap.DCPType[0].HTTP;
const http = getMap.DCPType[0].HTTP;
expect(http.Get.OnlineResource).to.eql('http://hostname/path?');
});
it('can read Capability.Layer', function() {
var layer = capabilities.Capability.Layer;
const layer = capabilities.Capability.Layer;
expect(layer.Title).to.eql('Acme Corp. Map Server');
expect(layer.Name).to.be(undefined);
@@ -109,7 +109,7 @@ describe('ol.format.WMSCapabilities', function() {
res: [1, 1]
}]);
expect(layer.Layer[0].EX_GeographicBoundingBox).to.eql(
[-71.63, 41.75, -70.78, 42.9]);
[-71.63, 41.75, -70.78, 42.9]);
expect(layer.Layer[0].Style).to.eql([{
Name: 'USGS',
Title: 'USGS Topo Map Style',