2022-02-06 20:34:13 +00:00
|
|
|
import { MessageTypes } from '../../src/common'
|
|
|
|
import { packers } from '../../src/mapping'
|
|
|
|
|
|
|
|
test('Create a keepalive (0x0005) packet.', () => {
|
|
|
|
// When
|
|
|
|
const packedPacket = packers[MessageTypes.Keepalive]()
|
|
|
|
|
|
|
|
// Then
|
2022-02-22 22:35:55 +00:00
|
|
|
const expectedResult = new Uint8Array([0x00, 0x05, 0x00, 0x00])
|
2022-02-06 20:34:13 +00:00
|
|
|
expect(packedPacket).toMatchObject(expectedResult)
|
|
|
|
})
|