mirror of
https://github.com/thelounge/thelounge
synced 2024-11-10 06:34:21 +00:00
Add project version in outputs that mention source SHA
This commit is contained in:
parent
efae5fd28d
commit
34f4d0abf4
2 changed files with 18 additions and 1 deletions
|
@ -51,7 +51,8 @@ Helper.config = require(path.resolve(path.join(
|
|||
|
||||
function getVersion() {
|
||||
const gitCommit = getGitCommit();
|
||||
return gitCommit ? `source (${gitCommit})` : `v${pkg.version}`;
|
||||
const version = `v${pkg.version}`;
|
||||
return gitCommit ? `source (${gitCommit} / ${version})` : version;
|
||||
}
|
||||
|
||||
let _gitCommit;
|
||||
|
|
|
@ -36,4 +36,20 @@ describe("Helper", function() {
|
|||
expect(Helper.expandHome(undefined)).to.equal("");
|
||||
});
|
||||
});
|
||||
|
||||
describe("#getVersion()", function() {
|
||||
const version = Helper.getVersion();
|
||||
|
||||
it("should mention it is served from source code", function() {
|
||||
expect(version).to.include("source");
|
||||
});
|
||||
|
||||
it("should include a short Git SHA", function() {
|
||||
expect(version).to.match(/\([0-9a-f]{7,11} /);
|
||||
});
|
||||
|
||||
it("should include a valid semver version", function() {
|
||||
expect(version).to.match(/v[0-9]+\.[0-9]+\.[0-9]+/);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue