2022-03-22 21:09:00 +01:00
|
|
|
import {describe, expect, jest, it} from '@jest/globals';
|
2020-10-25 02:25:23 +01:00
|
|
|
import * as github from '../src/github';
|
|
|
|
|
2022-03-22 21:09:00 +01:00
|
|
|
import * as repoFixture from './fixtures/repo.json';
|
2021-07-06 20:01:00 +02:00
|
|
|
jest.spyOn(github, 'repo').mockImplementation((): Promise<github.ReposGetResponseData> => {
|
2022-03-22 21:09:00 +01:00
|
|
|
return <Promise<github.ReposGetResponseData>>(repoFixture as unknown);
|
2021-07-06 20:01:00 +02:00
|
|
|
});
|
2020-10-25 02:25:23 +01:00
|
|
|
|
|
|
|
describe('repo', () => {
|
|
|
|
it('returns GitHub repository', async () => {
|
|
|
|
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
|
|
|
|
expect(repo.name).not.toBeNull();
|
|
|
|
});
|
|
|
|
});
|