Skip to content

Commit

Permalink
style: Run prettier, fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-suhas committed Feb 18, 2020
1 parent a47471b commit b730809
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ class RangeAggregationBase extends BucketAggregationBase {
checkType(range, Object);
if (!this._rangeRequiredKeys.some(hasOwnProp, range)) {
throw new Error(
`Invalid Range! Range must have at least one of ${
this._rangeRequiredKeys
}`
`Invalid Range! Range must have at least one of ${this._rangeRequiredKeys}`
);
}

Expand Down
20 changes: 16 additions & 4 deletions test/core-test/geo-shape.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,36 @@ test('constructor sets arguments', t => {
]).toJSON();
const expected = {
type: 'multipoint',
coordinates: [[102.0, 2.0], [103.0, 2.0]]
coordinates: [
[102.0, 2.0],
[103.0, 2.0]
]
};
t.deepEqual(value, expected);

value = new GeoShape('multipoint')
.coordinates([[102.0, 2.0], [103.0, 2.0]])
.coordinates([
[102.0, 2.0],
[103.0, 2.0]
])
.toJSON();
t.deepEqual(value, expected);
});

test('sets type and coordinates', t => {
const value = new GeoShape()
.type('envelope')
.coordinates([[-45.0, 45.0], [45.0, -45.0]])
.coordinates([
[-45.0, 45.0],
[45.0, -45.0]
])
.toJSON();
const expected = {
type: 'envelope',
coordinates: [[-45.0, 45.0], [45.0, -45.0]]
coordinates: [
[-45.0, 45.0],
[45.0, -45.0]
]
};
t.deepEqual(value, expected);
});
Expand Down
7 changes: 4 additions & 3 deletions test/queries-test/geo-shape-query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ test(validatedCorrectly, getInstance, 'relation', [
'INTERSECTS'
]);
test(setsFieldOption, 'shape', {
param: new GeoShape()
.type('envelope')
.coordinates([[13.0, 53.0], [14.0, 52.0]])
param: new GeoShape().type('envelope').coordinates([
[13.0, 53.0],
[14.0, 52.0]
])
});
test(setsFieldOption, 'indexedShape', {
param: new IndexedShape()
Expand Down
5 changes: 4 additions & 1 deletion test/queries-test/more-like-this-query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ test('sets unlike(arr) option', setsOption, 'unlike', {
test(setsOption, 'likeText', { param: 'my text' });
test(setsOption, 'ids', { param: ['1', '2'], spread: false });
test(setsOption, 'docs', {
param: [{ _type: 'type', _id: '1' }, { _type: 'type', _id: '2' }],
param: [
{ _type: 'type', _id: '1' },
{ _type: 'type', _id: '2' }
],
spread: false
});
test(setsOption, 'maxQueryTerms', { param: 12 });
Expand Down

0 comments on commit b730809

Please sign in to comment.