Skip to content

Commit

Permalink
Test it
Browse files Browse the repository at this point in the history
  • Loading branch information
joshaber committed Nov 7, 2017
1 parent b76d856 commit 20f54cf
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions app/test/unit/find-upstream-remote-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { expect } from 'chai'

import {
findUpstreamRemote,
UpstreamRemoteName,
} from '../../src/lib/stores/helpers/find-upstream-remote'
import { GitHubRepository } from '../../src/models/github-repository'
import { Owner } from '../../src/models/owner'

describe.only('findUpstreamRemote', () => {
it('finds it', () => {
const parent = new GitHubRepository(
'github-release-stats',
new Owner('somsubhra', 'https://api.github.com', null),
null,
false,
'https://github.com/Somsubhra/github-release-stats',
'master',
'https://github.com/Somsubhra/github-release-stats.git',
null
)
const remotes = [
{
name: 'upstream',
url: 'https://github.com/Somsubhra/github-release-stats.git',
},
]
const upstream = findUpstreamRemote(parent, remotes)
expect(upstream).not.to.equal(null)
expect(upstream!.name).to.equal(UpstreamRemoteName)
expect(upstream!.url).to.equal(
'https://github.com/Somsubhra/github-release-stats.git'
)
})
})

0 comments on commit 20f54cf

Please sign in to comment.