Skip to content

Commit

Permalink
chore(tests-coverage): improved bitbucket coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
thepatrickniyo committed Apr 30, 2022
1 parent 78a48ed commit 66c2919
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export class GithubSearchController {
public async searchRepository(req: Request, res: Response): Promise<Response> {
const { name } = req.query;
const { authorization } = req.headers;
console.log(authorization)

if (!name)
return res.status(BAD_REQUEST).send(new CustomResponse(false, { message: 'Repository name is required' }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,45 @@ describe('GET api/v1/bitbucket/search/repositories?username=', () => {
});
});
});

describe('GET api/v1/bitbucket/search/workspace/degide/projects', () => {
it('Should return workspace projects', (done) => {
chai
.request(App)
.get('/api/v1/bitbucket/search/workspace/degide/projects')
.end((err, response) => {
if(err) return done(err);
expect(response).to.have.status(200);
expect(response.body).to.haveOwnProperty('data');
done();
})
})
})

describe('GET api/v1/bitbucket/search/repositories/atlassian/todo-app-custom-ui/issues', () => {
it('Should return workspace repository issues', (done) => {
chai
.request(App)
.get('/api/v1/bitbucket/search/repositories/atlassian/todo-app-custom-ui/issues')
.end((err, response) => {
if(err) return done(err);
expect(response).to.have.status(200);
expect(response.body).to.haveOwnProperty('data');
done();
})
})
})

describe('GET api/v1/bitbucket/search/file-source/atlassian/todo-app-custom-ui?filePath=src/master/README.md', () => {
it('Should return repository sources', (done) => {
chai
.request(App)
.get('/api/v1/bitbucket/search/file-source/atlassian/todo-app-custom-ui?filePath=src/master/README.md')
.end((err, response) => {
if(err) return done(err);
expect(response).to.have.status(200);
expect(response.body).to.haveOwnProperty('data');
done();
})
})
})

0 comments on commit 66c2919

Please sign in to comment.