UNPKG

homebridge-hikvision-local

Version:

Homebridge plugin that connects to your HikVision DVR via a local connection and exposes your cameras in Homebridge. The plugin is heavily based on excellent [homebridge-camera-ffmpeg](https://github.com/Sunoo/homebridge-camera-ffmpeg) and the various hom

28 lines 991 B
// Mock the HikVisionNVR module before importing index jest.mock('./HikVisionNVR.js', () => ({ HikVisionNVR: jest.fn().mockImplementation(() => ({ // Mock implementation if needed })), })); describe('HikvisionLocal Platform', () => { let mockAPI; beforeEach(() => { jest.clearAllMocks(); mockAPI = { registerPlatform: jest.fn(), on: jest.fn(), }; }); it('should export default function', () => { const indexModule = require('./index'); expect(typeof indexModule.default).toBe('function'); }); it('should register the platform with homebridge', () => { const indexModule = require('./index'); indexModule.default(mockAPI); expect(mockAPI.registerPlatform).toHaveBeenCalledTimes(1); expect(mockAPI.registerPlatform).toHaveBeenCalledWith(expect.any(String), expect.any(String), expect.any(Function)); }); }); export {}; //# sourceMappingURL=index.test.js.map