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