Add Aimedb command tests
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
const { Decoder } = require('./cmd')
|
||||
|
||||
function decode(req) {
|
||||
const decoder = new Decoder()
|
||||
|
||||
decoder.write(req)
|
||||
|
||||
return decoder.read()
|
||||
}
|
||||
|
||||
test('decode hello', () => {
|
||||
const req = Buffer.from([
|
||||
0x3e, 0xa1, 0x87, 0x30, 0x64, 0x00, 0x20, 0x00,
|
||||
0x00, 0x00, 0x53, 0x44, 0x42, 0x54, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x41, 0x36, 0x39, 0x45,
|
||||
0x30, 0x31, 0x41, 0x39, 0x39, 0x39, 0x39, 0x00,
|
||||
])
|
||||
|
||||
const obj = decode(req)
|
||||
|
||||
expect(obj.gameId).toBe('SDBT')
|
||||
expect(obj.keychipId).toBe('A69E01A9999')
|
||||
})
|
||||
Reference in New Issue
Block a user