CH-J Server Managerserver management over SSH
Menu
Published source

CH-J Server Manager

Browse directories and files for a specific application release.

Download source ZIP
CH-J Proprietary Software License 1.14

Source is provided under the CH-J Proprietary Software License 1.14. Its availability does not change the license terms or grant additional rights.

821 B · 21 linesDownload file
1"use strict";
3const test = require("node:test");
4const assert = require("node:assert/strict");
5const { compareVersions, parseVersion } = require("../src/shared/version");
7test("version parser accepts application versions", () => {
8 assert.deepEqual(parseVersion("v0.0.1").numbers, [0, 0, 1, 0]);
9 assert.equal(parseVersion("1.2.3-alpha.1+build").prerelease.join("."), "alpha.1");
10});
12test("version comparison handles stable and prerelease versions", () => {
13 assert.equal(compareVersions("0.0.2", "0.0.1"), 1);
14 assert.equal(compareVersions("1.0.0-alpha.2", "1.0.0-alpha.10"), -1);
15 assert.equal(compareVersions("1.0.0", "1.0.0-beta.1"), 1);
16 assert.equal(compareVersions("1.0", "1.0.0"), 0);
17});
19test("invalid version is rejected", () => {
20 assert.throws(() => parseVersion("latest"), /Invalid version/);
21});

SHA-256: 4bdc9a56e23661f15a55887a38c107b5ca59cce848e75638bc8d78e1246b536c

Archive SHA-256: 5ac91caf4fa32a6fdb114f2430deed486fbe7489d5eea343d1f034169fafb5e0