Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Oct 5, 2023
1 parent d225fde commit 47182c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
5 changes: 2 additions & 3 deletions __tests__/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ beforeEach(() => {
process.env.INPUT_UNLOCK_ON_MERGE_MODE = 'false'
process.env.INPUT_STICKY_LOCKS = 'false'
process.env.INPUT_STICKY_LOCKS_FOR_NOOP = 'false'
process.env.INPUT_ALLOW_SHA_DEPLOYMENTS = 'false'

github.context.payload = {
issue: {
Expand Down Expand Up @@ -581,9 +582,7 @@ test('runs with the deprecated noop input', async () => {
})

test('successfully runs the action after trimming the body', async () => {
jest.spyOn(prechecks, 'prechecks').mockImplementation(trigger => {
expect(trigger).toBe('.deploy')

jest.spyOn(prechecks, 'prechecks').mockImplementation(() => {
return {
ref: 'test-ref',
status: true,
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,16 +430,12 @@ export async function run() {
allowForks: allowForks,
skipCi: skipCi,
skipReviews: skipReviews,
draft_permitted_targets: draft_permitted_targets,
draft_permitted_targets: draft_permitted_targets
}
}

// Execute prechecks to ensure the Action can proceed
const precheckResults = await prechecks(
context,
octokit,
data
)
const precheckResults = await prechecks(context, octokit, data)
core.setOutput('ref', precheckResults.ref)
core.saveState('ref', precheckResults.ref)
core.setOutput('sha', precheckResults.sha)
Expand Down

0 comments on commit 47182c1

Please sign in to comment.