@shopware-ag/dive
Version:
Shopware Spatial Framework
20 lines (14 loc) • 655 B
text/typescript
import { Object3D } from 'three';
import { implementsInterface } from '../implementsInterface.ts';
describe('dive/helper/implementsInterface', () => {
it('should not find interface', () => {
expect(implementsInterface(undefined, 'isInterface')).toBe(false);
expect(implementsInterface(null, 'isInterface')).toBe(false);
const obj = {} as unknown as Object3D;
expect(implementsInterface(obj, 'isInterface')).toBe(false);
});
it('should find interface', () => {
const obj = { isInterface: true } as unknown as Object3D;
expect(implementsInterface(obj, 'isInterface')).toBe(true);
});
});