Skip to content

Commit

Permalink
tighten up url generation
Browse files Browse the repository at this point in the history
  • Loading branch information
outofambit committed Mar 3, 2020
1 parent 00d60ff commit 44a9fb9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/test/helpers/github-repo-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export function gitHubRepoFixture({
endpoint,
isPrivate,
}: IGitHubRepoFixtureOptions): GitHubRepository {
const htmlUrl = `${
endpoint !== undefined ? endpoint : 'https://github.com'
}/${owner}/${name}`
return new GitHubRepository(
name,
new Owner(
Expand All @@ -49,13 +52,9 @@ export function gitHubRepoFixture({
),
id_counter++,
isPrivate !== undefined ? isPrivate : null,
endpoint !== undefined
? `${endpoint}/${owner}/${name}`
: `https://github.com/${owner}/${name}`,
htmlUrl,
defaultBranch || 'master',
endpoint !== undefined
? `${endpoint}/${owner}/${name}.git`
: `https://github.com/${owner}/${name}.git`,
`${htmlUrl}.git`,
null,
parent
)
Expand Down

0 comments on commit 44a9fb9

Please sign in to comment.