-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Encode snapshot data asynchronously, fixes #2932 * Async I/O when saving snapshots
- Loading branch information
1 parent
9bc615e
commit c384e9a
Showing
9 changed files
with
41 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,5 +84,5 @@ test(async t => { | |
t.equal(result.error.name, 'Error'); | ||
}); | ||
|
||
manager.save(); | ||
await manager.save(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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('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})); | ||
}); | ||
}); |