12 lines
342 B
TypeScript
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)
|
||
|
})
|