Skip to content

Commit

Permalink
feat: add configurable maxBuffer option to runDiffImageToSnapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
haze committed Dec 11, 2023
1 parent 7b1e622 commit 6371fef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/diff-snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ function diffImageToSnapshot(options) {

function runDiffImageToSnapshot(options) {
options.receivedImageBuffer = options.receivedImageBuffer.toString('base64');
if (options.maxBufferSizeInBytes === undefined) {
options.maxBufferSizeInBytes = 10 * 1024 * 1024; // 10 MB
}

const serializedInput = JSON.stringify(options);

Expand All @@ -421,7 +424,7 @@ function runDiffImageToSnapshot(options) {
{
input: Buffer.from(serializedInput),
stdio: ['pipe', 'inherit', 'inherit', 'pipe'],
maxBuffer: 10 * 1024 * 1024, // 10 MB
maxBuffer: options.maxBufferSizeInBytes,
}
);

Expand Down

0 comments on commit 6371fef

Please sign in to comment.