2020-10-25 09:25:23 +08:00
|
|
|
import * as path from 'path';
|
|
|
|
import * as github from '../src/github';
|
|
|
|
|
2021-07-07 02:01:00 +08:00
|
|
|
jest.spyOn(github, 'repo').mockImplementation((): Promise<github.ReposGetResponseData> => {
|
|
|
|
return <Promise<github.ReposGetResponseData>>require(path.join(__dirname, 'fixtures', 'repo.json'));
|
|
|
|
});
|
2020-10-25 09:25:23 +08:00
|
|
|
|
|
|
|
describe('repo', () => {
|
|
|
|
it('returns GitHub repository', async () => {
|
|
|
|
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
|
|
|
|
expect(repo.name).not.toBeNull();
|
|
|
|
});
|
|
|
|
});
|