Skip to content

Commit

Permalink
Add reproduction for #2932
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberborn committed Jan 8, 2022
1 parent 9bc615e commit 8949561
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/snapshot-tests/fixtures/large/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
9 changes: 9 additions & 0 deletions test/snapshot-tests/fixtures/large/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const {Buffer} = require('buffer');

const test = require(process.env.TEST_AVA_IMPORT_FROM);

for (let i = 0; i < 2; i++) {
test(`large snapshot ${i}`, t => {
t.snapshot(Buffer.alloc(1024 * 16));
});
}
15 changes: 15 additions & 0 deletions test/snapshot-tests/large.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import test from '@ava/test';

import {cwd, fixture} from '../helpers/exec.js';
import {withTemporaryFixture} from '../helpers/with-temporary-fixture.js';

// Reproduction for https://github.com/avajs/ava/issues/2932.
test.failing('can encode and decode large snapshots', async t => {
await withTemporaryFixture(cwd('large'), async cwd => {
const env = {
AVA_FORCE_CI: 'not-ci',
};
await fixture(['--update-snapshots'], {cwd, env});
await t.notThrowsAsync(fixture([], {cwd, env}));
});
});

0 comments on commit 8949561

Please sign in to comment.