Skip to content

Commit

Permalink
fix(description): passed the proper description to the github settings
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Apr 22, 2018
1 parent acea0c6 commit 595d375
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
8 changes: 7 additions & 1 deletion src/scaffolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ export async function scaffold() {
const visibility = answers[questionNames.VISIBILITY];
const description = answers[questionNames.DESCRIPTION];
const ciService = answers[questionNames.CI];
const vcs = await scaffoldVcsHost({host: answers[questionNames.REPO_HOST], projectName, projectRoot, projectType});
const vcs = await scaffoldVcsHost({
host: answers[questionNames.REPO_HOST],
projectName,
projectRoot,
projectType,
description
});
const [license, ci, language] = await Promise.all([
scaffoldLicense({
projectRoot,
Expand Down
4 changes: 2 additions & 2 deletions src/vcs/host.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import scaffoldGithub from './github';

export default async function ({host, projectName, projectRoot, projectType}) {
if ('GitHub' === host) await scaffoldGithub({projectRoot, projectType});
export default async function ({host, projectName, projectRoot, projectType, description}) {
if ('GitHub' === host) await scaffoldGithub({projectRoot, projectType, description});

return {host, name: projectName, owner: 'travi'};
}
10 changes: 8 additions & 2 deletions test/unit/scaffolder-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ suite('project scaffolder', () => {
.withArgs({projectRoot: projectPath, license, copyright, vcs})
.resolves({badge: licenseBadge});
vcsHostScaffolder.default
.withArgs({host: repoHost, projectName, projectRoot: projectPath, projectType})
.withArgs({host: repoHost, projectName, projectRoot: projectPath, projectType, description})
.resolves(vcs);
travisScaffolder.default
.withArgs({projectRoot: projectPath, projectType, vcs, visibility})
Expand Down Expand Up @@ -180,7 +180,13 @@ suite('project scaffolder', () => {
verificationCommand
});
vcsHostScaffolder.default
.withArgs({host: repoHost, projectName, projectRoot: projectPath, projectType: javascriptProjectType})
.withArgs({
host: repoHost,
projectName,
projectRoot: projectPath,
projectType: javascriptProjectType,
description
})
.resolves(vcs);

return scaffold().then(() => {
Expand Down
5 changes: 3 additions & 2 deletions test/unit/vcs/host-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ suite('vcs host scaffolder', () => {
const host = 'GitHub';
const projectRoot = any.string();
const projectType = any.string();
const description = any.sentence();
githubScaffolder.default.resolves();

return assert.becomes(
scaffoldVcsHost({host, projectName, projectRoot, projectType}),
scaffoldVcsHost({host, projectName, projectRoot, projectType, description}),
{host, owner: 'travi', name: projectName}
).then(() => assert.calledWith(githubScaffolder.default, {projectRoot, projectType}));
).then(() => assert.calledWith(githubScaffolder.default, {projectRoot, projectType, description}));
});
});

0 comments on commit 595d375

Please sign in to comment.