mirror of
https://github.com/actions/deploy-pages.git
synced 2026-03-30 01:54:52 +00:00
test early exit on a deployment cancel request
This commit is contained in:
@@ -8,6 +8,7 @@ const fakeJwt =
|
||||
|
||||
describe('Deployment', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
process.env.ACTIONS_RUNTIME_URL = 'http://my-url/'
|
||||
process.env.GITHUB_RUN_ID = '123'
|
||||
process.env.ACTIONS_RUNTIME_TOKEN = 'a-token'
|
||||
@@ -395,5 +396,18 @@ describe('Deployment', () => {
|
||||
createDeploymentScope.done()
|
||||
cancelDeploymentScope.done()
|
||||
})
|
||||
|
||||
it('can exit if a pages deployment was not created and none need to be cancelled', async () => {
|
||||
process.env.GITHUB_SHA = 'valid-build-version'
|
||||
|
||||
// Create the deployment
|
||||
const deployment = new Deployment()
|
||||
|
||||
// Cancel it
|
||||
await deployment.cancel()
|
||||
|
||||
expect(core.debug).toHaveBeenCalledWith('all variables are set')
|
||||
expect(core.debug).toHaveBeenCalledWith(`No deployment to cancel`)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user