Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions __tests__/functions/check.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ test('successfully checks for a production lock and does not find a lock branch'
})

test('successfully checks for a production lock and finds a global lock instead', async () => {
;(octokit.rest.repos.getBranch = jest
;((octokit.rest.repos.getBranch = jest
.fn()
.mockReturnValueOnce({data: {commit: {sha: 'cba123'}}})), // global lock
(octokit.rest.getContent = jest
.fn()
.mockReturnValue({data: {content: lockBase64OctocatGlobal}}))
.mockReturnValue({data: {content: lockBase64OctocatGlobal}})))
expect(await check(octokit, context, environment)).toBe(true)
expect(setOutputMock).toHaveBeenCalledWith('locked', 'true')
expect(setOutputMock).toHaveBeenCalledWith('lock_environment', 'global')
Expand All @@ -112,10 +112,10 @@ test('successfully checks for a production lock and finds a global lock instead'
})

test('successfully checks for a global lock and does not find one', async () => {
;(octokit.rest.repos.getBranch = jest
;((octokit.rest.repos.getBranch = jest
.fn()
.mockRejectedValueOnce(new NotFoundError('Reference does not exist'))), // global lock
expect(await check(octokit, context, 'global')).toBe(false)
expect(await check(octokit, context, 'global')).toBe(false))
expect(setOutputMock).toHaveBeenCalledWith('locked', 'false')
expect(infoMock).toHaveBeenCalledWith('global lock does not exist')
})
Expand Down
34 changes: 21 additions & 13 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading