Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed May 18, 2018
1 parent 36b2059 commit db80802
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
20 changes: 11 additions & 9 deletions lib/docs/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@ exports.run = async function({ args, opts }) {
},
};

const existingDoc = await request.get(`${config.host}/api/v1/docs/${slug}`, {
json: true,
...options,
}).catch(err => {
if (err.statusCode === 404) {
return Promise.reject(err.error);
}
const existingDoc = await request
.get(`${config.host}/api/v1/docs/${slug}`, {
json: true,
...options,
})
.catch(err => {
if (err.statusCode === 404) {
return Promise.reject(err.error);
}

return Promise.reject(err);
});
return Promise.reject(err);
});

await writeFile(filename, existingDoc.body);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
],
"coverageThreshold": {
"global": {
"branches": 70,
"branches": 80,
"functions": 80,
"lines": 90,
"statements": 90
Expand Down
6 changes: 3 additions & 3 deletions test/docs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ describe('docs:edit', () => {
return cb(0);
}

return docsEdit([slug], { key, version: '1.0.0', mockEditor }).catch((err) => {
return docsEdit([slug], { key, version: '1.0.0', mockEditor }).catch(err => {
assert.equal(err.error, 'Bad Request');
getMock.done();
putMock.done();
Expand All @@ -235,13 +235,13 @@ describe('docs:edit', () => {
const slug = 'getting-started';
nock(config.host)
.get(`/api/v1/docs/${slug}`)
.reply(200, {})
.reply(200, {});

function mockEditor(filename, cb) {
return cb(1);
}

return docsEdit([slug], { key, version: '1.0.0', mockEditor }).catch((err) => {
return docsEdit([slug], { key, version: '1.0.0', mockEditor }).catch(err => {
assert.equal(err.message, 'Non zero exit code from $EDITOR');
fs.unlinkSync(`${slug}.md`);
});
Expand Down

0 comments on commit db80802

Please sign in to comment.