mirror of
https://gitea.com/docker/metadata-action.git
synced 2024-11-22 20:19:33 +01:00
18 lines
531 B
TypeScript
18 lines
531 B
TypeScript
|
import * as path from 'path';
|
||
|
import * as github from '../src/github';
|
||
|
import {ReposGetResponseData} from '@octokit/types';
|
||
|
|
||
|
jest.spyOn(github, 'repo').mockImplementation(
|
||
|
(): Promise<ReposGetResponseData> => {
|
||
|
return <Promise<ReposGetResponseData>>require(path.join(__dirname, 'fixtures', 'repo.json'));
|
||
|
}
|
||
|
);
|
||
|
|
||
|
describe('repo', () => {
|
||
|
it('returns GitHub repository', async () => {
|
||
|
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
|
||
|
console.log(repo);
|
||
|
expect(repo.name).not.toBeNull();
|
||
|
});
|
||
|
});
|