bennc-js/tests/messages/keepalive.test.ts
Jack Hadrill e758de7ef4
Some checks failed
continuous-integration/drone/push Build is failing
Add all BENNC message types with unit tests
2022-02-06 20:38:52 +00:00

12 lines
342 B
TypeScript

import { MessageTypes } from '../../src/common'
import { packers } from '../../src/mapping'
test('Create a keepalive (0x0005) packet.', () => {
// When
const packedPacket = packers[MessageTypes.Keepalive]()
// Then
const expectedResult = Buffer.from([0x00, 0x05, 0x00, 0x00])
expect(packedPacket).toMatchObject(expectedResult)
})