diff --git a/GitGitGadget/index.js b/GitGitGadget/index.js index e2cc542..bb780f4 100644 --- a/GitGitGadget/index.js +++ b/GitGitGadget/index.js @@ -103,7 +103,7 @@ module.exports = async (context, req) => { } /* Only trigger the Pipeline for valid commands */ - if (!comment.body || !comment.body.match(/^\/(submit|preview|allow|disallow|test|cc)\b/)) { + if (!comment.body || !comment.body.match(/^\/(submit|preview|allow|disallow|test|cc|reply)\b/)) { context.res = { body: `Not a command: '${comment.body}'`, }; diff --git a/__tests__/index.test.js b/__tests__/index.test.js index 3457364..be12273 100644 --- a/__tests__/index.test.js +++ b/__tests__/index.test.js @@ -159,6 +159,15 @@ testIssueComment('/test', async (context) => { expect(mockRequest.end).not.toHaveBeenCalled() }) +testIssueComment('/reply \nThanks', async (context) => { + expect(context.done).not.toHaveBeenCalled() + expect(context.res).toEqual({ + body: 'Okay, triggered !' + }) + expect(mockRequest.write).not.toHaveBeenCalled() + expect(mockRequest.end).not.toHaveBeenCalled() +}) + testIssueComment('/verify-repository', 'nope', (context) => { expect(context.done).not.toHaveBeenCalled() expect(context.res).toEqual({