Files
feedBack/tests/js/capabilities_versioning.test.js
T
Bret Mogilefskyandbyrongamatos d3037b903e rename: slopsmith -> feedBack, byron -> got-feedBack
Renames across the entire codebase:
- slopsmith/Slopsmith/SLOPSMITH/SlopSmith -> feedBack/FeedBack/FEEDBACK/FeedBack
- byron/Byron/Byrongamatos -> got-feedBack/got-feedBack/got-feedBack
- /home/byron/ -> /opt/got-feedBack/
- byron@ougsoft.com -> hi@got-feedBack.org
- github.com/byrongamatos/ -> github.com/got-feedback/
- com.byron. -> com.got-feedback.
- SLOPSMITH_ env vars -> FEEDBACK_ with backward-compat fallback
- Protocol/storage strings migrated with read-old/write-new pattern
- window.slopsmith JS API -> window.feedBack (canonical) + backward-compat alias

Refs: #rename-slopsmith
2026-06-23 10:04:23 +02:00

24 lines
1.3 KiB
JavaScript

const { test } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const { loadCapabilities, ROOT } = require('./capabilities_test_harness');
test('unsupported capability-pipelines versions are incompatible and do not execute handlers', async () => {
const window = loadCapabilities();
const api = window.feedBack.capabilities;
const fixture = JSON.parse(fs.readFileSync(path.join(ROOT, 'tests', 'fixtures', 'plugin_capabilities', 'unsupported_capability_version.json'), 'utf8'));
let invoked = false;
fixture.capabilities.stems.handlers = { mute: () => { invoked = true; return { outcome: 'handled' }; } };
fixture.capabilities.stems.runtime = true;
api.registerParticipants([fixture]);
const result = await api.dispatch({ capability: 'stems', command: 'mute', source: 'test' });
const snapshot = api.snapshotDiagnostics();
assert.equal(invoked, false);
assert.equal(result.status, 'incompatible-version');
assert.equal(result.outcome, 'incompatible-version');
assert.equal(snapshot.unsupportedVersions.some(entry => entry.pluginId === 'future_capabilities'), true);
assert.equal(snapshot.participants.find(p => p.pluginId === 'future_capabilities').availability, 'incompatible');
});