fix(opencode): avoid snapshotting files over 2MB (#19043)
This commit is contained in:
@@ -181,7 +181,7 @@ test("symlink handling", async () => {
|
||||
})
|
||||
})
|
||||
|
||||
test("large file handling", async () => {
|
||||
test("file under size limit handling", async () => {
|
||||
await using tmp = await bootstrap()
|
||||
await Instance.provide({
|
||||
directory: tmp.path,
|
||||
@@ -196,6 +196,23 @@ test("large file handling", async () => {
|
||||
})
|
||||
})
|
||||
|
||||
test("large added files are skipped", async () => {
|
||||
await using tmp = await bootstrap()
|
||||
await Instance.provide({
|
||||
directory: tmp.path,
|
||||
fn: async () => {
|
||||
const before = await Snapshot.track()
|
||||
expect(before).toBeTruthy()
|
||||
|
||||
await Filesystem.write(`${tmp.path}/huge.txt`, new Uint8Array(2 * 1024 * 1024 + 1))
|
||||
|
||||
expect((await Snapshot.patch(before!)).files).toEqual([])
|
||||
expect(await Snapshot.diff(before!)).toBe("")
|
||||
expect(await Snapshot.track()).toBe(before)
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
test("nested directory revert", async () => {
|
||||
await using tmp = await bootstrap()
|
||||
await Instance.provide({
|
||||
|
||||
Reference in New Issue
Block a user