Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
Add test for calling upload release asset endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmHughes committed Sep 27, 2019
1 parent edac4e9 commit 7b2a12a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,21 @@ describe('Upload Release Asset', () => {
GitHub.mockImplementation(() => github);
});

test('Upload release endpoint is called', async () => {
test('Upload release asset endpoint is called', async () => {
core.getInput = jest
.fn()
.mockReturnValueOnce('upload_url')
.mockReturnValueOnce('asset_path')
.mockReturnValueOnce('asset_name')
.mockReturnValueOnce('asset_content_type');

await run();

expect(uploadReleaseAsset).toHaveBeenCalledWith({
owner: 'owner',
repo: 'repo'
url: 'upload_url',
headers: { 'content-type': 'asset_content_type', 'content-length': 527 },
name: 'asset_name',
file: 'asset_path'
});
});

Expand Down

0 comments on commit 7b2a12a

Please sign in to comment.