Skip to content

Commit

Permalink
test: fixing a broken test on node 14
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Jun 18, 2021
1 parent 6c4f180 commit 7eeabeb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/cmds/docs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ describe('rdme docs:edit', () => {
it('should error if doc fails validation', () => {
expect.assertions(2);
const slug = 'getting-started';
const body = 'abcdef';

const getMock = nock(config.host).get(`/api/v1/docs/${slug}`).reply(200, {});
const getMock = nock(config.host).get(`/api/v1/docs/${slug}`).reply(200, { body });

const putMock = nock(config.host).put(`/api/v1/docs/${slug}`).reply(400, {
error: 'DOC_INVALID',
Expand All @@ -256,7 +257,9 @@ describe('rdme docs:edit', () => {
it('should handle error if $EDITOR fails', () => {
expect.assertions(1);
const slug = 'getting-started';
nock(config.host).get(`/api/v1/docs/${slug}`).reply(200, {});
const body = 'abcdef';

nock(config.host).get(`/api/v1/docs/${slug}`).reply(200, { body });

function mockEditor(filename, cb) {
return cb(1);
Expand Down

0 comments on commit 7eeabeb

Please sign in to comment.