diff --git a/package.json b/package.json index b591ff5..c994aa2 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,9 @@ "lint": "xo", "coverage": "nyc report --reporter=text-lcov | coveralls" }, + "xo": { + "extends": "xo-lukechilds" + }, "repository": { "type": "git", "url": "git+https://github.com/lukechilds/onionoo-node-client.git" @@ -31,6 +34,7 @@ "devDependencies": { "ava": "^0.24.0", "coveralls": "^3.0.0", + "eslint-config-xo-lukechilds": "^1.0.1", "nock": "^9.0.2", "nyc": "^11.0.0", "xo": "^0.19.0" diff --git a/test/base-url.js b/test/base-url.js index 431d025..fa34483 100644 --- a/test/base-url.js +++ b/test/base-url.js @@ -6,7 +6,7 @@ import data from './fixtures/data'; test('Can pass in custom endpoint', async t => { const baseUrl = 'http://foo.com'; const defaultEndpoint = data.defaultEndpoints[0]; - const onionoo = new Onionoo({baseUrl}); + const onionoo = new Onionoo({ baseUrl }); const scope = nock(baseUrl) .get(`/${defaultEndpoint}`) diff --git a/test/cache.js b/test/cache.js index f9b43a8..8cb6514 100644 --- a/test/cache.js +++ b/test/cache.js @@ -33,7 +33,7 @@ test('Cache is disabled by default', async t => { }); test('Cache options is passed through to Got', async t => { - const onionoo = new Onionoo({cache: new Map()}); + const onionoo = new Onionoo({ cache: new Map() }); const defaultEndpoint = data.defaultEndpoints[0]; const responseHeaders = { diff --git a/test/endpoints.js b/test/endpoints.js index 28e025f..5905c5d 100644 --- a/test/endpoints.js +++ b/test/endpoints.js @@ -28,14 +28,14 @@ test('Can pass in custom endpoint array', t => { 'foo', 'bar' ]; - const onionoo = new Onionoo({endpoints}); + const onionoo = new Onionoo({ endpoints }); t.deepEqual(Object.keys(onionoo), endpoints); }); test('Custom endpoint makes correct request', async t => { const customEndpoint = 'foo'; - const onionoo = new Onionoo({endpoints: [customEndpoint]}); + const onionoo = new Onionoo({ endpoints: [customEndpoint] }); const scope = nock(data.defaultBaseUrl) .get(`/${customEndpoint}`) diff --git a/test/queries.js b/test/queries.js index 4cbd02a..72900ac 100644 --- a/test/queries.js +++ b/test/queries.js @@ -11,7 +11,7 @@ test('Query string is built correctly', async t => { .get(`/${defaultEndpoint}?foo=bar`) .reply(200, data.dummyResponse); - const response = await onionoo[defaultEndpoint]({foo: 'bar'}); + const response = await onionoo[defaultEndpoint]({ foo: 'bar' }); t.deepEqual(response.body, data.dummyResponse); t.true(scope.isDone()); @@ -25,7 +25,7 @@ test('":" char isn\'t url encoded so filters work', async t => { .get(`/${defaultEndpoint}?foo=key:value`) .reply(200, data.dummyResponse); - const response = await onionoo[defaultEndpoint]({foo: 'key:value'}); + const response = await onionoo[defaultEndpoint]({ foo: 'key:value' }); t.deepEqual(response.body, data.dummyResponse); t.true(scope.isDone());