3
0
Fork 0
mirror of https://gitea.com/docker/metadata-action.git synced 2024-11-24 21:19:33 +01:00
docker-metadata/__tests__/github.test.ts
CrazyMax e99ab50e6c
chore: update dev dependencies and workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-03-22 21:09:00 +01:00

14 lines
512 B
TypeScript

import {describe, expect, jest, it} from '@jest/globals';
import * as github from '../src/github';
import * as repoFixture from './fixtures/repo.json';
jest.spyOn(github, 'repo').mockImplementation((): Promise<github.ReposGetResponseData> => {
return <Promise<github.ReposGetResponseData>>(repoFixture as unknown);
});
describe('repo', () => {
it('returns GitHub repository', async () => {
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
expect(repo.name).not.toBeNull();
});
});