mirror of
https://code.forgejo.org/actions/git-backporting.git
synced 2025-02-23 11:05:44 -05:00
* 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>
19 lines
No EOL
919 B
TypeScript
19 lines
No EOL
919 B
TypeScript
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}}");
|
|
});
|
|
}); |