npm run format

This commit is contained in:
Danny Coates 2017-06-23 17:06:08 -07:00
parent eda901ba4a
commit d09b97db41
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
4 changed files with 18 additions and 11 deletions

View File

@ -97,8 +97,9 @@ $(document).ready(function() {
function populateFileList(file) { function populateFileList(file) {
try { try {
file = JSON.parse(file); file = JSON.parse(file);
} catch (e) {
return;
} }
catch (e) { return }
const row = document.createElement('tr'); const row = document.createElement('tr');
const name = document.createElement('td'); const name = document.createElement('td');

View File

@ -24,7 +24,8 @@ const conf = convict({
}, },
sentry_id: { sentry_id: {
format: String, format: String,
default: 'https://cdf9a4f43a584f759586af8ceb2194f2@sentry.prod.mozaws.net/238', default:
'https://cdf9a4f43a584f759586af8ceb2194f2@sentry.prod.mozaws.net/238',
env: 'P2P_SENTRY_CLIENT' env: 'P2P_SENTRY_CLIENT'
}, },
sentry_dsn: { sentry_dsn: {

View File

@ -45,9 +45,12 @@ app.get('/', (req, res) => {
app.get('/exists/:id', (req, res) => { app.get('/exists/:id', (req, res) => {
const id = req.params.id; const id = req.params.id;
storage.exists(id).then(() => { storage
.exists(id)
.then(() => {
res.sendStatus(200); res.sendStatus(200);
}).catch(err => res.sendStatus(404)); })
.catch(err => res.sendStatus(404));
}); });
app.get('/download/:id', (req, res) => { app.get('/download/:id', (req, res) => {

View File

@ -44,16 +44,18 @@ const storage = proxyquire('../server/storage', {
describe('Testing Exists from local filesystem', function() { describe('Testing Exists from local filesystem', function() {
it('Exists returns true when file exists', function() { it('Exists returns true when file exists', function() {
exists.callsArgWith(1, null, 1); exists.callsArgWith(1, null, 1);
return storage.exists('test') return storage
.exists('test')
.then(() => assert(1)) .then(() => assert(1))
.catch(err => assert.fail()) .catch(err => assert.fail());
}); });
it('Exists returns false when file does not exist', function() { it('Exists returns false when file does not exist', function() {
exists.callsArgWith(1, null, 0); exists.callsArgWith(1, null, 0);
return storage.exists('test') return storage
.exists('test')
.then(() => assert.fail()) .then(() => assert.fail())
.catch(err => assert(1)) .catch(err => assert(1));
}); });
}); });