Fixes to evenhub extensions library

This commit is contained in:
James Babcock committed 2026-10-24 01:51:34 -07:00
1 parent 4bf2769d24
commit 07859c95ad
8 files changed
+203 -34

No files matched your search

+10
View File
@@ -30,6 +30,16 @@ function page() {
return { win, fc, posted };
}
test('the package helper returns the shim, and treats unversioned 0.8.0-0.8.2 hosts as absent', () => {
const { loader } = require('./helpers/load-typescript.cjs');
const helper = (window) => loader(window === undefined ? {} : { window })('evenhub-extensions/src/index.ts').getFaceclawExtensions();
const { win, fc } = page();
assert.equal(helper(win), fc);
assert.equal(helper({ getFaceclawExtensions: () => ({ getVersion: () => 'Faceclaw/0.8.2' }) }), null);
assert.equal(helper({}), null);
assert.equal(helper(undefined), null);
});
test('the shim implements exactly the members the package declares', () => {
const { fc } = page();
assert.deepEqual(Object.keys(fc).sort(), interfaceMembers('FaceclawExtensions'));