metadata-action/__tests__/github.test.ts
CrazyMax 9a42503205
chore: cleanup tests
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-12-06 15:42:32 +01:00

14 lines
461 B
TypeScript

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