skillhub/cli/test/unit/integrations/update-assessment.test.ts
XiaoSeS 3560679793
Some checks failed
Deploy Docs / build (push) Has been cancelled
Security / Dependency Review (push) Has been cancelled
Security / CodeQL (java-kotlin) (push) Has been cancelled
Security / CodeQL (javascript-typescript) (push) Has been cancelled
Security / CodeQL (python) (push) Has been cancelled
Deploy Docs / Deploy (push) Has been cancelled
feat(dsh): add native SkillHub plugin for DeepSeek Harness (#956)
Add the native SkillHub plugin for DeepSeek Harness with a scoped skill center, conversation search/install tools, exact-version installation and protected lifecycle management. Prepare the independently versioned 0.1.0 npm candidate with an empty default Registry and documented compatibility limits.

Keep formal specifications and executable regression tests; remove archived development screenshots and runtime reports from the final tree. Review fixes cover independent scopes, installed references, pre-staging recovery and idempotent discovery.

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
2026-10-16 19:22:26 +08:00

20 lines
1.5 KiB
TypeScript

import { expect, test } from 'bun:test'
import { assessSkillUpdate } from '../../../src/integrations/update-assessment'
test('update assessment preserves CLI version ordering and never treats changed same-version content as an upgrade', () => {
const installed = { version: '1.2.0', fingerprint: 'original' }
for (const [candidate, state, reason] of [
[{ version: '1.3.0', fingerprint: 'new' }, 'upgradable', 'newer-version'],
[{ version: '1.2.0', fingerprint: 'original' }, 'current', 'same-content'],
[{ version: '1.2.0+build', fingerprint: 'new' }, 'blocked', 'same-version-content-changed'],
[{ version: '1.2.0', fingerprint: 'new' }, 'blocked', 'same-version-content-changed'],
[{ version: '1.1.0', fingerprint: 'old' }, 'blocked', 'remote-older'],
[{ version: 'release-next', fingerprint: 'new' }, 'blocked', 'unknown-order'],
[{ version: '1.3.0' }, 'blocked', 'missing-fingerprint'],
] as const) {
expect(assessSkillUpdate(installed, candidate)).toEqual({ currentVersion: '1.2.0', candidateVersion: candidate.version, state, reason })
}
expect(assessSkillUpdate({ version: '1.2.0' }, { version: '1.3.0', fingerprint: 'new' }).reason).toBe('missing-fingerprint')
expect(assessSkillUpdate({ version: 'release', fingerprint: 'same' }, { version: 'release', fingerprint: 'same' }).state).toBe('current')
expect(assessSkillUpdate({ version: '2.0.0-rc.1', fingerprint: 'old' }, { version: '2.0.0', fingerprint: 'new' }).state).toBe('upgradable')
})