initial implementation

carries most of the logic used across our actions

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2023-01-17 11:53:57 +01:00
parent 3b6c627995
commit 70326fd842
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
31 changed files with 5703 additions and 0 deletions

14
__tests__/github.test.ts Normal file
View file

@ -0,0 +1,14 @@
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();
});
});