fix prettier linting problems

This commit is contained in:
Simon Seyock
2021-03-09 09:08:27 +01:00
parent 610896ef95
commit 2b57584180
7 changed files with 226 additions and 209 deletions

View File

@@ -342,43 +342,44 @@ describe('ol.format.GeoJSON', function () {
});
it('parses countries.geojson', function (done) {
afterLoadText('spec/ol/format/geojson/countries.geojson', function (
text
) {
const result = format.readFeatures(text);
expect(result.length).to.be(179);
afterLoadText(
'spec/ol/format/geojson/countries.geojson',
function (text) {
const result = format.readFeatures(text);
expect(result.length).to.be(179);
const first = result[0];
expect(first).to.be.a(Feature);
expect(first.get('name')).to.be('Afghanistan');
expect(first.getId()).to.be('AFG');
const firstGeom = first.getGeometry();
expect(firstGeom).to.be.a(Polygon);
expect(
equals(firstGeom.getExtent(), [
60.52843,
29.318572,
75.158028,
38.486282,
])
).to.be(true);
const first = result[0];
expect(first).to.be.a(Feature);
expect(first.get('name')).to.be('Afghanistan');
expect(first.getId()).to.be('AFG');
const firstGeom = first.getGeometry();
expect(firstGeom).to.be.a(Polygon);
expect(
equals(firstGeom.getExtent(), [
60.52843,
29.318572,
75.158028,
38.486282,
])
).to.be(true);
const last = result[178];
expect(last).to.be.a(Feature);
expect(last.get('name')).to.be('Zimbabwe');
expect(last.getId()).to.be('ZWE');
const lastGeom = last.getGeometry();
expect(lastGeom).to.be.a(Polygon);
expect(
equals(lastGeom.getExtent(), [
25.264226,
-22.271612,
32.849861,
-15.507787,
])
).to.be(true);
done();
});
const last = result[178];
expect(last).to.be.a(Feature);
expect(last.get('name')).to.be('Zimbabwe');
expect(last.getId()).to.be('ZWE');
const lastGeom = last.getGeometry();
expect(lastGeom).to.be.a(Polygon);
expect(
equals(lastGeom.getExtent(), [
25.264226,
-22.271612,
32.849861,
-15.507787,
])
).to.be(true);
done();
}
);
});
it('generates an array of features for Feature', function () {

View File

@@ -1663,19 +1663,20 @@ describe('ol.format.GML3', function () {
describe('when parsing multiple feature types', function () {
let features;
before(function (done) {
afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function (
xml
) {
try {
features = new GML({
featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_polygon', 'planet_osm_line'],
}).readFeatures(xml);
} catch (e) {
done(e);
afterLoadText(
'spec/ol/format/gml/multiple-typenames.xml',
function (xml) {
try {
features = new GML({
featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_polygon', 'planet_osm_line'],
}).readFeatures(xml);
} catch (e) {
done(e);
}
done();
}
done();
});
);
});
it('reads all features', function () {
@@ -1686,16 +1687,17 @@ describe('ol.format.GML3', function () {
describe('when parsing multiple feature types', function () {
let features;
before(function (done) {
afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function (
xml
) {
try {
features = new GML().readFeatures(xml);
} catch (e) {
done(e);
afterLoadText(
'spec/ol/format/gml/multiple-typenames.xml',
function (xml) {
try {
features = new GML().readFeatures(xml);
} catch (e) {
done(e);
}
done();
}
done();
});
);
});
it('reads all features with autoconfigure', function () {
@@ -1750,20 +1752,21 @@ describe('ol.format.GML3', function () {
describe('when parsing srsDimension from WFS (Geoserver)', function () {
let features, feature;
before(function (done) {
afterLoadText('spec/ol/format/gml/geoserver3DFeatures.xml', function (
xml
) {
try {
const config = {
'featureNS': 'http://www.opengeospatial.net/cite',
'featureType': 'geoserver_layer',
};
features = new GML(config).readFeatures(xml);
} catch (e) {
done(e);
afterLoadText(
'spec/ol/format/gml/geoserver3DFeatures.xml',
function (xml) {
try {
const config = {
'featureNS': 'http://www.opengeospatial.net/cite',
'featureType': 'geoserver_layer',
};
features = new GML(config).readFeatures(xml);
} catch (e) {
done(e);
}
done();
}
done();
});
);
});
it('creates 3 features', function () {

View File

@@ -152,12 +152,13 @@ describe('ol.format.WFS', function () {
describe('when parsing FeatureCollection', function () {
let xml;
before(function (done) {
afterLoadText('spec/ol/format/wfs/EmptyFeatureCollection.xml', function (
_xml
) {
xml = _xml;
done();
});
afterLoadText(
'spec/ol/format/wfs/EmptyFeatureCollection.xml',
function (_xml) {
xml = _xml;
done();
}
);
});
it('returns an empty array of features when none exist', function () {
const result = new WFS().readFeatures(xml);
@@ -215,16 +216,17 @@ describe('ol.format.WFS', function () {
describe('when parsing TransactionResponse', function () {
let response;
before(function (done) {
afterLoadText('spec/ol/format/wfs/TransactionResponse.xml', function (
xml
) {
try {
response = new WFS().readTransactionResponse(xml);
} catch (e) {
done(e);
afterLoadText(
'spec/ol/format/wfs/TransactionResponse.xml',
function (xml) {
try {
response = new WFS().readTransactionResponse(xml);
} catch (e) {
done(e);
}
done();
}
done();
});
);
});
it('returns the correct TransactionResponse object', function () {
expect(response.transactionSummary.totalDeleted).to.equal(0);
@@ -1241,12 +1243,13 @@ describe('ol.format.WFS', function () {
describe('when writing out a Transaction request', function () {
let text;
before(function (done) {
afterLoadText('spec/ol/format/wfs/TransactionMulti_3D.xml', function (
xml
) {
text = xml;
done();
});
afterLoadText(
'spec/ol/format/wfs/TransactionMulti_3D.xml',
function (xml) {
text = xml;
done();
}
);
});
it('handles 3D in WFS 1.1.0', function () {
@@ -1283,12 +1286,13 @@ describe('ol.format.WFS', function () {
describe('when writing out a GetFeature request', function () {
let text;
before(function (done) {
afterLoadText('spec/ol/format/wfs/GetFeatureMultiple.xml', function (
xml
) {
text = xml;
done();
});
afterLoadText(
'spec/ol/format/wfs/GetFeatureMultiple.xml',
function (xml) {
text = xml;
done();
}
);
});
it('handles writing multiple Query elements', function () {
@@ -1335,19 +1339,20 @@ describe('ol.format.WFS', function () {
describe('when parsing multiple feature types', function () {
let features;
before(function (done) {
afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function (
xml
) {
try {
features = new WFS({
featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_polygon', 'planet_osm_line'],
}).readFeatures(xml);
} catch (e) {
done(e);
afterLoadText(
'spec/ol/format/gml/multiple-typenames.xml',
function (xml) {
try {
features = new WFS({
featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_polygon', 'planet_osm_line'],
}).readFeatures(xml);
} catch (e) {
done(e);
}
done();
}
done();
});
);
});
it('reads all features', function () {
@@ -1358,23 +1363,24 @@ describe('ol.format.WFS', function () {
describe('when parsing multiple feature types separately', function () {
let lineFeatures, polygonFeatures;
before(function (done) {
afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function (
xml
) {
try {
lineFeatures = new WFS({
featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_line'],
}).readFeatures(xml);
polygonFeatures = new WFS({
featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_polygon'],
}).readFeatures(xml);
} catch (e) {
done(e);
afterLoadText(
'spec/ol/format/gml/multiple-typenames.xml',
function (xml) {
try {
lineFeatures = new WFS({
featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_line'],
}).readFeatures(xml);
polygonFeatures = new WFS({
featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_polygon'],
}).readFeatures(xml);
} catch (e) {
done(e);
}
done();
}
done();
});
);
});
it('reads all features', function () {
@@ -1386,16 +1392,17 @@ describe('ol.format.WFS', function () {
describe('when parsing multiple feature types', function () {
let features;
before(function (done) {
afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function (
xml
) {
try {
features = new WFS().readFeatures(xml);
} catch (e) {
done(e);
afterLoadText(
'spec/ol/format/gml/multiple-typenames.xml',
function (xml) {
try {
features = new WFS().readFeatures(xml);
} catch (e) {
done(e);
}
done();
}
done();
});
);
});
it('reads all features with autoconfigure', function () {