From e39280a2dc3268f7bc9d497e0f5dd4a707b25b82 Mon Sep 17 00:00:00 2001 From: Rob Date: Wed, 29 Mar 2017 09:59:20 +0200 Subject: [PATCH] [test] append Large event to a stream --- test/appendToStream_test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/appendToStream_test.js b/test/appendToStream_test.js index 120687c..d76a9a3 100644 --- a/test/appendToStream_test.js +++ b/test/appendToStream_test.js @@ -55,6 +55,21 @@ module.exports = { test.done(err); }); }, + 'Append Large event': function(test) { + test.expect(2); + const largeData = Buffer.alloc(3 * 1024 *1024, 1); + const event = client.createJsonEventData(uuid.v4(), {a: largeData.toString()}, null, 'largePayloadEvent'); + + this.conn.appendToStream(this.testStreamName, client.expectedVersion.any, event) + .then(function(result) { + test.areEqual("result.nextExpectedVersion", result.nextExpectedVersion, 0); + test.ok(result.logPosition, "No log position in result."); + test.done(); + }) + .catch(function(err) { + test.done(err); + }); + }, 'Append To Stream Wrong Expected Version': function(test) { test.expect(1); var event = client.createJsonEventData(uuid.v4(), {a: Math.random(), b: uuid.v4()}, null, 'testEvent');