mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-06-28 21:53:47 +00:00
feat: implement error notification as pr comment (#124)
* feat: implement error notification as pr comment * Update action.yml Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com> * feat: implement gitlab client and surround with try catch * docs: add error notification enablment in the doc * feat: disable comment if dry-run * feat: update the default comment on error --------- Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
This commit is contained in:
parent
6042bcc40b
commit
2bb7f73112
28 changed files with 594 additions and 39 deletions
19
test/service/runner/runner-util.test.ts
Normal file
19
test/service/runner/runner-util.test.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { injectError, injectTargetBranch } from "@bp/service/runner/runner-util";
|
||||
|
||||
describe("check runner utilities", () => {
|
||||
test("properly inject error message", () => {
|
||||
expect(injectError("Original message: {{error}}", "to inject")).toStrictEqual("Original message: to inject");
|
||||
});
|
||||
|
||||
test("missing error placeholder in the original message", () => {
|
||||
expect(injectError("Original message: {{wrong}}", "to inject")).toStrictEqual("Original message: {{wrong}}");
|
||||
});
|
||||
|
||||
test("properly inject target branch into message", () => {
|
||||
expect(injectTargetBranch("Original message: {{target-branch}}", "to inject")).toStrictEqual("Original message: to inject");
|
||||
});
|
||||
|
||||
test("missing target branch placeholder in the original message", () => {
|
||||
expect(injectTargetBranch("Original message: {{wrong}}", "to inject")).toStrictEqual("Original message: {{wrong}}");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue