hookshot/tests/jira/Utils.ts
Will Hunt 819c089aa4
Update minimum Node version to 22 (#990)
* Update dependencies

* Node 22 is now the new minimum version.

* changelog.

* Begin porting eslint to new config format.

* Make linter happy.

* Update reqwest to fix SSL issue?

* Fix test types

* quick check on ubuntu LTS 24.04

* Change cache key

* update rust action

* revert mocha due to esminess

* Remove the only usage of pqueue

* Use babel for TS transformations to get around ESM import bug.

* Dependency bundle upgrade

* Drop babel, not actually used.

* lint

* lint

* update default config (mostly sections moving around)
2024-11-28 15:04:01 +00:00

30 lines
1.1 KiB
TypeScript

import { expect } from "chai";
import { generateJiraWebLinkFromIssue, generateJiraWebLinkFromVersion } from "../../src/jira";
describe("Jira", () => {
describe("Utils", () => {
it("processes a jira issue into a URL", () => {
expect(generateJiraWebLinkFromIssue({
self: "https://my-test-jira/",
key: "TEST-111",
})).to.equal("https://my-test-jira/browse/TEST-111");
});
it("processes a jira issue into a URL with a port", () => {
expect(generateJiraWebLinkFromIssue({
self: "https://my-test-jira:9995/",
key: "TEST-111",
})).to.equal("https://my-test-jira:9995/browse/TEST-111");
});
it("processes a jira issue into a URL with a port and a version", () => {
expect(generateJiraWebLinkFromVersion({
self: "https://my-test-jira:9995/",
description: "foo",
name: "bar",
projectId: "TEST-111",
id: "v1.0.0",
})).to.equal("https://my-test-jira:9995/projects/TEST-111/versions/v1.0.0");
});
});
});