chore: prohibit using mergeUpdates (#3701)

This commit is contained in:
Alex Yang
2023-08-11 11:55:17 -04:00
committed by GitHub
parent e9f4912665
commit 9639143df4
14 changed files with 142 additions and 94 deletions
@@ -435,15 +435,13 @@ describe('utils', () => {
});
test('overwrite binary', async () => {
await overwriteBinary('test', new Uint8Array([1, 2, 3]));
const doc = new Doc();
const map = doc.getMap();
map.set('1', 1);
await overwriteBinary('test', new Uint8Array(encodeStateAsUpdate(doc)));
{
const binary = await downloadBinary('test');
expect(binary).toEqual(new Uint8Array([1, 2, 3]));
}
await overwriteBinary('test', new Uint8Array([0, 0]));
{
const binary = await downloadBinary('test');
expect(binary).toEqual(new Uint8Array([0, 0]));
expect(binary).toEqual(new Uint8Array(encodeStateAsUpdate(doc)));
}
});
});