Auto-fix lint errors

This commit is contained in:
J. Ryan Stinnett 2021-06-29 13:11:58 +01:00
parent 4c5720a573
commit ae0a8b8da4
625 changed files with 3170 additions and 3232 deletions

View file

@ -31,7 +31,7 @@ const NONWORDOBJECTS = [
describe('QueryMatcher', function() {
it('Returns results by key', function() {
const qm = new QueryMatcher(OBJECTS, {keys: ["name"]});
const qm = new QueryMatcher(OBJECTS, { keys: ["name"] });
const results = qm.match('Geri');
expect(results.length).toBe(1);
@ -39,7 +39,7 @@ describe('QueryMatcher', function() {
});
it('Returns results by prefix', function() {
const qm = new QueryMatcher(OBJECTS, {keys: ["name"]});
const qm = new QueryMatcher(OBJECTS, { keys: ["name"] });
const results = qm.match('Ge');
expect(results.length).toBe(1);
@ -47,7 +47,7 @@ describe('QueryMatcher', function() {
});
it('Matches case-insensitive', function() {
const qm = new QueryMatcher(OBJECTS, {keys: ["name"]});
const qm = new QueryMatcher(OBJECTS, { keys: ["name"] });
const results = qm.match('geri');
expect(results.length).toBe(1);
@ -55,7 +55,7 @@ describe('QueryMatcher', function() {
});
it('Matches ignoring accents', function() {
const qm = new QueryMatcher([{name: "Gëri", foo: 46}], {keys: ["name"]});
const qm = new QueryMatcher([{ name: "Gëri", foo: 46 }], { keys: ["name"] });
const results = qm.match('geri');
expect(results.length).toBe(1);
@ -63,14 +63,13 @@ describe('QueryMatcher', function() {
});
it('Returns multiple results in order of search string appearance', function() {
const qm = new QueryMatcher(OBJECTS, {keys: ["name", "nick"]});
const qm = new QueryMatcher(OBJECTS, { keys: ["name", "nick"] });
const results = qm.match('or');
expect(results.length).toBe(2);
expect(results[0].name).toBe('Mel C');
expect(results[1].name).toBe('Victoria');
qm.setObjects(OBJECTS.slice().reverse());
const reverseResults = qm.match('or');
@ -87,7 +86,7 @@ describe('QueryMatcher', function() {
{ name: "b", first: "miss", second: "hit", third: "miss" },
{ name: "c", first: "miss", second: "miss", third: "hit" },
];
const qm = new QueryMatcher(objects, {keys: ["second", "first", "third"]});
const qm = new QueryMatcher(objects, { keys: ["second", "first", "third"] });
const results = qm.match('hit');
expect(results.length).toBe(3);
@ -95,7 +94,6 @@ describe('QueryMatcher', function() {
expect(results[1].name).toBe('a');
expect(results[2].name).toBe('c');
qm.setObjects(objects.slice().reverse());
const reverseResults = qm.match('hit');
@ -109,14 +107,13 @@ describe('QueryMatcher', function() {
});
it('Returns results with search string in same place and key in same place in insertion order', function() {
const qm = new QueryMatcher(OBJECTS, {keys: ["name"]});
const qm = new QueryMatcher(OBJECTS, { keys: ["name"] });
const results = qm.match('Mel');
expect(results.length).toBe(2);
expect(results[0].name).toBe('Mel B');
expect(results[1].name).toBe('Mel C');
qm.setObjects(OBJECTS.slice().reverse());
const reverseResults = qm.match('Mel');
@ -129,9 +126,9 @@ describe('QueryMatcher', function() {
it('Returns numeric results in correct order (input pos)', function() {
// regression test for depending on object iteration order
const qm = new QueryMatcher([
{name: "123456badger"},
{name: "123456"},
], {keys: ["name"]});
{ name: "123456badger" },
{ name: "123456" },
], { keys: ["name"] });
const results = qm.match('123456');
expect(results.length).toBe(2);
@ -141,9 +138,9 @@ describe('QueryMatcher', function() {
it('Returns numeric results in correct order (query pos)', function() {
const qm = new QueryMatcher([
{name: "999999123456"},
{name: "123456badger"},
], {keys: ["name"]});
{ name: "999999123456" },
{ name: "123456badger" },
], { keys: ["name"] });
const results = qm.match('123456');
expect(results.length).toBe(2);