fix(10): centralize semver comparison policy across hooks and changeset
This commit is contained in:
@@ -15,7 +15,12 @@ const fs = require('node:fs');
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
|
||||
const { parseStateMd, formatGsdState, readGsdState } = require('../hooks/gsd-statusline.js');
|
||||
const {
|
||||
parseStateMd,
|
||||
formatGsdState,
|
||||
readGsdState,
|
||||
isInstalledAheadOfLatest,
|
||||
} = require('../hooks/gsd-statusline.js');
|
||||
|
||||
// ─── parseStateMd ───────────────────────────────────────────────────────────
|
||||
|
||||
@@ -217,6 +222,16 @@ describe('formatGsdState', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('isInstalledAheadOfLatest', () => {
|
||||
test('treats prerelease patch increment as ahead of prior stable', () => {
|
||||
assert.equal(isInstalledAheadOfLatest('1.2.1-beta.1', '1.2.0'), true);
|
||||
});
|
||||
|
||||
test('treats equal base version prerelease as not ahead', () => {
|
||||
assert.equal(isInstalledAheadOfLatest('1.2.0-rc.1', '1.2.0'), false);
|
||||
});
|
||||
});
|
||||
|
||||
// ─── readGsdState ───────────────────────────────────────────────────────────
|
||||
|
||||
describe('readGsdState', () => {
|
||||
|
||||
Reference in New Issue
Block a user