From 363a02b82dd01083c108a80d6a1b470c4d2eadf1 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 24 Aug 2016 15:01:52 -0700 Subject: [PATCH] Add more remote Buffer specs --- spec/api-ipc-spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js index 829d26dd8819..2260f274f8e0 100644 --- a/spec/api-ipc-spec.js +++ b/spec/api-ipc-spec.js @@ -163,6 +163,17 @@ describe('ipc module', function () { assert.deepEqual(printName.echo(now), now) }) + it('supports instanceof Buffer', function () { + const buffer = Buffer.from('test') + assert.ok(buffer.equals(printName.echo(buffer))) + + const objectWithBuffer = {a: 'foo', b: Buffer.from('bar')} + assert.ok(objectWithBuffer.b.equals(printName.echo(objectWithBuffer).b)) + + const arrayWithBuffer = [1,2, Buffer.from('baz')] + assert.ok(arrayWithBuffer[2].equals(printName.echo(arrayWithBuffer)[2])) + }) + it('supports TypedArray', function () { const values = [1, 2, 3, 4] const typedArray = printName.typedArray(values)