Skip to content

Commit df713f6

Browse files
committed
fix(diff): small default maxBuffer
By default, Node's spawnSync has a maxBuffer of 1 MB. This bumps it up to 10 MB, which should reduce the chance of diffs on large images failing.
1 parent 27fcd0b commit df713f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/diff-snapshot.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,11 @@ function runDiffImageToSnapshot(options) {
240240

241241
const writeDiffProcess = childProcess.spawnSync(
242242
process.execPath, [`${__dirname}/diff-process.js`],
243-
{ input: Buffer.from(serializedInput), stdio: ['pipe', 'inherit', 'inherit', 'pipe'] }
243+
{
244+
input: Buffer.from(serializedInput),
245+
stdio: ['pipe', 'inherit', 'inherit', 'pipe'],
246+
maxBuffer: 10 * 1024 * 1024, // 10 MB
247+
}
244248
);
245249

246250
if (writeDiffProcess.status === 0) {

0 commit comments

Comments
 (0)