From d09b97db41d8a62cb9324ff63abe60b57de79132 Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Fri, 23 Jun 2017 17:06:08 -0700 Subject: [PATCH] npm run format --- frontend/src/upload.js | 3 ++- server/config.js | 3 ++- server/portal_server.js | 9 ++++++--- test/local.storage.test.js | 14 ++++++++------ 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/frontend/src/upload.js b/frontend/src/upload.js index 4988e001..6d902b0d 100644 --- a/frontend/src/upload.js +++ b/frontend/src/upload.js @@ -97,8 +97,9 @@ $(document).ready(function() { function populateFileList(file) { try { file = JSON.parse(file); + } catch (e) { + return; } - catch (e) { return } const row = document.createElement('tr'); const name = document.createElement('td'); diff --git a/server/config.js b/server/config.js index c49681b8..efe47a40 100644 --- a/server/config.js +++ b/server/config.js @@ -24,7 +24,8 @@ const conf = convict({ }, sentry_id: { format: String, - default: 'https://cdf9a4f43a584f759586af8ceb2194f2@sentry.prod.mozaws.net/238', + default: + 'https://cdf9a4f43a584f759586af8ceb2194f2@sentry.prod.mozaws.net/238', env: 'P2P_SENTRY_CLIENT' }, sentry_dsn: { diff --git a/server/portal_server.js b/server/portal_server.js index 9dc2cf01..7a4b4af9 100644 --- a/server/portal_server.js +++ b/server/portal_server.js @@ -45,9 +45,12 @@ app.get('/', (req, res) => { app.get('/exists/:id', (req, res) => { const id = req.params.id; - storage.exists(id).then(() => { - res.sendStatus(200); - }).catch(err => res.sendStatus(404)); + storage + .exists(id) + .then(() => { + res.sendStatus(200); + }) + .catch(err => res.sendStatus(404)); }); app.get('/download/:id', (req, res) => { diff --git a/test/local.storage.test.js b/test/local.storage.test.js index d7d33f1b..6dcdd6f2 100644 --- a/test/local.storage.test.js +++ b/test/local.storage.test.js @@ -44,16 +44,18 @@ const storage = proxyquire('../server/storage', { describe('Testing Exists from local filesystem', function() { it('Exists returns true when file exists', function() { exists.callsArgWith(1, null, 1); - return storage.exists('test') - .then(() => assert(1)) - .catch(err => assert.fail()) + return storage + .exists('test') + .then(() => assert(1)) + .catch(err => assert.fail()); }); it('Exists returns false when file does not exist', function() { exists.callsArgWith(1, null, 0); - return storage.exists('test') - .then(() => assert.fail()) - .catch(err => assert(1)) + return storage + .exists('test') + .then(() => assert.fail()) + .catch(err => assert(1)); }); });