Add all BENNC message types with unit tests

This commit is contained in:
Jack Hadrill
2022-02-06 20:34:13 +00:00
parent 7d1a0991e4
commit e758de7ef4
28 changed files with 708 additions and 12539 deletions

View 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)
})