add test for GET /builds/:repo/:pr
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
1a8e703400
commit
56529f3fe1
13
test/app.js
13
test/app.js
|
@ -14,6 +14,7 @@ describe('App', () => {
|
|||
ghc = sinon.createStubInstance(Comments)
|
||||
ghc.db = sinon.createStubInstance(Builds, {
|
||||
getComments: sample.COMMENTS,
|
||||
getBuilds: sample.BUILDS,
|
||||
}),
|
||||
app = App({ghc})
|
||||
})
|
||||
|
@ -28,7 +29,7 @@ describe('App', () => {
|
|||
})
|
||||
|
||||
describe('GET /comments', () => {
|
||||
it('should return list of builds', async () => {
|
||||
it('should return list of comments', async () => {
|
||||
const resp = await request(app.callback())
|
||||
.get('/comments')
|
||||
expect(resp.body).to.eql({
|
||||
|
@ -54,6 +55,16 @@ describe('App', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('GET /builds/:repo/:pr', () => {
|
||||
it('should return list of builds', async () => {
|
||||
const resp = await request(app.callback())
|
||||
.get('/builds/REPO-1/PR-1')
|
||||
expect(resp.body).to.eql({
|
||||
count: sample.BUILDS.length, builds: sample.BUILDS,
|
||||
})
|
||||
expect(resp.status).to.eq(200)
|
||||
})
|
||||
})
|
||||
|
||||
describe('POST /builds/:repo/:pr/refresh', () => {
|
||||
it('should update github comment', async () => {
|
||||
|
|
Loading…
Reference in New Issue