1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix base store tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-12-01 10:08:23 -05:00
parent 570d252950
commit 9dbc6bc293

View File

@ -115,7 +115,7 @@ describe("BaseStore", () => {
const data = JSON.parse(readFileSync("some-user-data-directory/test-store.json").toString()); const data = JSON.parse(readFileSync("some-user-data-directory/test-store.json").toString());
expect(data).toEqual({ a: "foo", b: "bar", c: "hello" }); expect(data).toMatchObject({ a: "foo", b: "bar", c: "hello" });
}); });
it("persists transaction only once", () => { it("persists transaction only once", () => {
@ -138,7 +138,7 @@ describe("BaseStore", () => {
const data = JSON.parse(readFileSync("some-user-data-directory/test-store.json").toString()); const data = JSON.parse(readFileSync("some-user-data-directory/test-store.json").toString());
expect(data).toEqual({ a: "a", b: "b", c: "" }); expect(data).toMatchObject({ a: "a", b: "b", c: "" });
}); });
it("persists changes coming via onSync (sync from different process)", () => { it("persists changes coming via onSync (sync from different process)", () => {
@ -146,7 +146,7 @@ describe("BaseStore", () => {
store.onSync({ a: "foo", b: "", c: "bar" }); store.onSync({ a: "foo", b: "", c: "bar" });
expect(store.toJSON()).toEqual({ a: "foo", b: "", c: "bar" }); expect(store.toJSON()).toMatchObject({ a: "foo", b: "", c: "bar" });
expect(fileSpy).toHaveBeenCalledTimes(1); expect(fileSpy).toHaveBeenCalledTimes(1);
}); });