diff --git a/lib/docs/index.js b/lib/docs/index.js index f13b9c4e5..aee3f92e8 100644 --- a/lib/docs/index.js +++ b/lib/docs/index.js @@ -59,7 +59,9 @@ exports.run = function({ args, opts }) { } function updateDoc(slug, file, hash, existingDoc) { - if (hash === existingDoc.lastUpdatedHash) return undefined; + if (hash === existingDoc.lastUpdatedHash) { + return `\`${slug}\` not updated. No changes.`; + } return request .put(`${config.host}/api/v1/docs/${slug}`, { json: Object.assign(existingDoc, { diff --git a/test/docs.test.js b/test/docs.test.js index d2d82d089..9831a6dc7 100644 --- a/test/docs.test.js +++ b/test/docs.test.js @@ -91,7 +91,8 @@ describe('docs command', () => { .basicAuth({ user: key }) .reply(200, { category: '5ae9ece93a685f47efb9a97c', slug, lastUpdatedHash: hash }); - return docs(['./test/fixtures/existing-docs'], { key, version }).then(() => { + return docs(['./test/fixtures/existing-docs'], { key, version }).then(([message]) => { + assert.equal(message, '`simple-doc` not updated. No changes.'); getMock.done(); }); });