Skip to content

Commit 0821dfd

Browse files
authored
Merge pull request #78 from ayame113/fix/failure-reaction-typo
fix: typo in "failure_reaction"
2 parents 129c57b + 1ec083b commit 0821dfd

File tree

5 files changed

+34
-4
lines changed

5 files changed

+34
-4
lines changed

__tests__/functions/post.test.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,33 @@ test('throws an error', async () => {
9797
expect(setFailedMock).toHaveBeenCalledWith('test error')
9898
}
9999
})
100+
101+
test('use reaction specified in input on success', async () => {
102+
const reactionInput = {
103+
status: 'success',
104+
success_reaction: 'rocket'
105+
}
106+
jest.spyOn(core, 'getInput').mockImplementation(name => {
107+
return reactionInput[name]
108+
})
109+
const postReactionsMock = jest.spyOn(postReactions, 'postReactions')
110+
111+
expect(await post()).toBeUndefined()
112+
expect(postReactionsMock).toHaveBeenCalled()
113+
expect(postReactionsMock.mock.calls[0][2]).toBe('rocket')
114+
})
115+
116+
test('use reaction specified in input on failure', async () => {
117+
const reactionInput = {
118+
status: 'failure',
119+
failure_reaction: 'confused'
120+
}
121+
jest.spyOn(core, 'getInput').mockImplementation(name => {
122+
return reactionInput[name]
123+
})
124+
const postReactionsMock = jest.spyOn(postReactions, 'postReactions')
125+
126+
expect(await post()).toBeUndefined()
127+
expect(postReactionsMock).toHaveBeenCalled()
128+
expect(postReactionsMock.mock.calls[0][2]).toBe('confused')
129+
})

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/functions/post.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export async function post() {
5858
if (success) {
5959
reaction = core.getInput('success_reaction') || thumbsUp
6060
} else {
61-
reaction = core.getInput('failed_reaction') || thumbsDown
61+
reaction = core.getInput('failure_reaction') || thumbsDown
6262
}
6363

6464
// Update the reactions on the command comment

0 commit comments

Comments
 (0)