Print if there is a diff in packets in the cycle packet test (#1273)

This commit is contained in:
Romain Beaumont 2023-12-29 23:11:31 +01:00 committed by GitHub
parent ccaf538ffd
commit 614be919d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,6 +24,10 @@ for (const supportedVersion of supportedVersions) {
const parsed = convertBufferToObject(buffer).data
const parsedBuffer = convertObjectToBuffer(parsed)
const areEq = buffer.equals(parsedBuffer)
if (!areEq) {
console.log('original buffer', buffer.toString('hex'))
console.log('cycled buffer', parsedBuffer.toString('hex'))
}
assert.strictEqual(areEq, true, `Error when testing ${+packetIx + 1} ${packetName} packet`)
}
describe(`Test cycle packet for version ${supportedVersion}v`, () => {