Skip to content

Commit

Permalink
Create index.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker committed Feb 6, 2025
1 parent 4a2210c commit 2e91d74
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { API } from 'homebridge'

import { describe, expect, it, vi } from 'vitest'

import registerPlatform from './index.js'
import { SwitchBotPlatform } from './platform.js'
import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js'

describe('index.ts', () => {
it('should register the platform with homebridge', () => {
const api = {
registerPlatform: vi.fn(),
} as unknown as API

registerPlatform(api)

expect(api.registerPlatform).toHaveBeenCalledWith(PLUGIN_NAME, PLATFORM_NAME, SwitchBotPlatform)
})
})

0 comments on commit 2e91d74

Please sign in to comment.