mirror of
https://gitea.com/docker/setup-buildx-action.git
synced 2024-11-25 10:59:35 +01:00
7c965aebec
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
20 lines
801 B
TypeScript
20 lines
801 B
TypeScript
import {describe, expect, it} from '@jest/globals';
|
|
import * as github from '../src/github';
|
|
|
|
describe('github', () => {
|
|
it('returns latest buildx GitHub release', async () => {
|
|
const release = await github.getLatestRelease(process.env.GITHUB_TOKEN || '');
|
|
expect(release).not.toBeNull();
|
|
expect(release?.tag_name).not.toEqual('');
|
|
});
|
|
|
|
it('returns v0.2.2 buildx GitHub release', async () => {
|
|
const release = await github.getReleaseTag('v0.2.2', process.env.GITHUB_TOKEN || '');
|
|
expect(release).not.toBeNull();
|
|
expect(release?.tag_name).toEqual('v0.2.2');
|
|
});
|
|
|
|
it('unknown release', async () => {
|
|
await expect(github.getReleaseTag('foo', process.env.GITHUB_TOKEN || '')).rejects.toThrowError(new Error('Cannot get release foo: HttpError: Not Found'));
|
|
});
|
|
});
|