Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
fix(options): made the options optional
Browse files Browse the repository at this point in the history
no need to send the options object if it would be empty, so made the api a little simpler for that
case
  • Loading branch information
travi committed Sep 14, 2018
1 parent 110e956 commit dccc441
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/prompt.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import gitConfig from 'git-config';
import {prompt as promptWithInquirer} from 'inquirer';

export function prompt({account}) {
export function prompt({account} = {}) {
return promptWithInquirer([
{
name: 'repoOwner',
Expand Down
7 changes: 7 additions & 0 deletions test/unit/prompt-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ suite('prompt', () => {

teardown(() => sandbox.restore());

test('that the options are optional', async () => {
gitConfig.sync.returns({github: {user: githubUser}});
inquirer.prompt.resolves(answers);

assert.equal(await prompt(), answers);
});

test('that the github user is provided as the default owner value if available in the global config', async () => {
gitConfig.sync.returns({github: {user: githubUser}});
inquirer.prompt
Expand Down

0 comments on commit dccc441

Please sign in to comment.