Add all BENNC message types with unit tests
This commit is contained in:
11
tests/messages/keepalive.test.ts
Normal file
11
tests/messages/keepalive.test.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
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)
|
||||
})
|
||||
Reference in New Issue
Block a user