test: make timestamp test less restrict (#273)

This commit is contained in:
Zixuan Chen 2024-02-25 12:02:58 +08:00 committed by GitHub
parent 403eb18fa5
commit 7dd0d96be3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,10 +1,10 @@
import { describe, expect, expectTypeOf, it } from "vitest";
import {
getType,
isContainer,
Loro,
LoroList,
LoroMap,
isContainer,
getType,
VersionVector,
} from "../src";
import { Container } from "../dist/loro";
@ -340,7 +340,7 @@ it("enable timestamp", () => {
doc.commit();
{
const c = doc.getChangeAt({ peer: "1", counter: 4 });
expect(c.timestamp).toBeCloseTo(Date.now(), 0);
expect(c.timestamp).toBeCloseTo(Date.now(), -1);
}
});