forked from Blendman974/faceclaw
Fixes to evenhub extensions library
This commit is contained in:
1 parent
4bf2769d24
commit
07859c95ad
8 files changed
+203
-34
No files matched your search
@@ -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'));
|
||||
|
||||
Reference in new issue
Block a user