From 26c064eec3c3675a49aec97ddbeec6bab6f1293d Mon Sep 17 00:00:00 2001 From: Matt Travi Date: Sun, 3 Feb 2019 23:16:27 -0600 Subject: [PATCH] fix(create): expected the realistic shape for the response for #1 --- src/create.js | 2 +- test/unit/create-test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/create.js b/src/create.js index ffa0adab..0c620949 100644 --- a/src/create.js +++ b/src/create.js @@ -4,7 +4,7 @@ import {factory} from './github-client-factory'; export default async function (name, visibility) { console.error(chalk.grey('Creating repository on GitHub')); // eslint-disable-line no-console - const {ssh_url: sshUrl, html_url: htmlUrl} = await factory().repos.createForAuthenticatedUser({ + const {data: {ssh_url: sshUrl, html_url: htmlUrl}} = await factory().repos.createForAuthenticatedUser({ name, private: 'Private' === visibility }); diff --git a/test/unit/create-test.js b/test/unit/create-test.js index c73dd3a5..6434a0ab 100644 --- a/test/unit/create-test.js +++ b/test/unit/create-test.js @@ -8,7 +8,7 @@ suite('creation', () => { let sandbox; const sshUrl = any.url(); const htmlUrl = any.url(); - const creationResponse = {ssh_url: sshUrl, html_url: htmlUrl}; + const creationResponse = {data: {ssh_url: sshUrl, html_url: htmlUrl}}; setup(() => { sandbox = sinon.createSandbox();