mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cleanup variable names in tests
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
84f54aa5dc
commit
deaee41d61
@ -136,22 +136,22 @@ describe("BaseStore", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("persists transaction only once", () => {
|
it("persists transaction only once", () => {
|
||||||
const jsonSpy = jest.spyOn(store, "saveToFile");
|
const fileSpy = jest.spyOn(store, "saveToFile");
|
||||||
|
|
||||||
store.updateAll({
|
store.updateAll({
|
||||||
a: "foo", b: "bar", c: "hello",
|
a: "foo", b: "bar", c: "hello",
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(jsonSpy).toHaveBeenCalledTimes(1);
|
expect(fileSpy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("persists changes one-by-one without transaction", () => {
|
it("persists changes one-by-one without transaction", () => {
|
||||||
const jsonSpy = jest.spyOn(store, "saveToFile");
|
const fileSpy = jest.spyOn(store, "saveToFile");
|
||||||
|
|
||||||
store.a = "a";
|
store.a = "a";
|
||||||
store.b = "b";
|
store.b = "b";
|
||||||
|
|
||||||
expect(jsonSpy).toHaveBeenCalledTimes(2);
|
expect(fileSpy).toHaveBeenCalledTimes(2);
|
||||||
|
|
||||||
const data = JSON.parse(readFileSync("tmp/test-store.json").toString());
|
const data = JSON.parse(readFileSync("tmp/test-store.json").toString());
|
||||||
|
|
||||||
@ -159,13 +159,13 @@ describe("BaseStore", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("persists changes coming via onSync (sync from different process)", () => {
|
it("persists changes coming via onSync (sync from different process)", () => {
|
||||||
const jsonSpy = jest.spyOn(store, "saveToFile");
|
const fileSpy = jest.spyOn(store, "saveToFile");
|
||||||
|
|
||||||
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()).toEqual({ a: "foo", b: "", c: "bar" });
|
||||||
|
|
||||||
expect(jsonSpy).toHaveBeenCalledTimes(1);
|
expect(fileSpy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user