mirror of
https://github.com/docker/metadata-action.git
synced 2025-06-12 14:47:13 +02:00
Initial commit
This commit is contained in:
17
__tests__/github.test.ts
Normal file
17
__tests__/github.test.ts
Normal file
@ -0,0 +1,17 @@
|
||||
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();
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user