diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js index 1914375ba2ec58..da6bc0cec05948 100644 --- a/test/parallel/test-v8-serdes.js +++ b/test/parallel/test-v8-serdes.js @@ -3,6 +3,7 @@ const common = require('../common'); const assert = require('assert'); const v8 = require('v8'); +const os = require('os'); const circular = {}; circular.circular = circular; @@ -124,6 +125,10 @@ const objects = [ let buf = Buffer.alloc(32 + 9); buf.write('ff0d5c0404addeefbe', 32, 'hex'); buf = buf.slice(32); + + const expectedResult = os.endianness() === 'LE' ? + new Uint16Array([0xdead, 0xbeef]) : new Uint16Array([0xadde, 0xefbe]); + assert.deepStrictEqual(v8.deserialize(buf), - new Uint16Array([0xdead, 0xbeef])); + expectedResult); }