Moved the NodeJS version of the application to the app/ directory.
This commit is contained in:
14
app/backend/test/version.test.ts
Normal file
14
app/backend/test/version.test.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { sortImageVersionsIfSemantic } from "../src/version";
|
||||
|
||||
describe("sortImageVersionsIfSemantic", () => {
|
||||
it("sorts only semantic versions", () => {
|
||||
const sorted = sortImageVersionsIfSemantic(["1.10.0", "1.2.0", "2.0.0"]);
|
||||
expect(sorted).toEqual(["1.2.0", "1.10.0", "2.0.0"]);
|
||||
});
|
||||
|
||||
it("sorts non-semantic versions naturally", () => {
|
||||
const original = ["latest", "1.0.0", "beta"];
|
||||
expect(sortImageVersionsIfSemantic(original)).toEqual(["1.0.0", "beta", "latest"]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user