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", () => {
|
||||
const jsonSpy = jest.spyOn(store, "saveToFile");
|
||||
const fileSpy = jest.spyOn(store, "saveToFile");
|
||||
|
||||
store.updateAll({
|
||||
a: "foo", b: "bar", c: "hello",
|
||||
});
|
||||
|
||||
expect(jsonSpy).toHaveBeenCalledTimes(1);
|
||||
expect(fileSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("persists changes one-by-one without transaction", () => {
|
||||
const jsonSpy = jest.spyOn(store, "saveToFile");
|
||||
const fileSpy = jest.spyOn(store, "saveToFile");
|
||||
|
||||
store.a = "a";
|
||||
store.b = "b";
|
||||
|
||||
expect(jsonSpy).toHaveBeenCalledTimes(2);
|
||||
expect(fileSpy).toHaveBeenCalledTimes(2);
|
||||
|
||||
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)", () => {
|
||||
const jsonSpy = jest.spyOn(store, "saveToFile");
|
||||
const fileSpy = jest.spyOn(store, "saveToFile");
|
||||
|
||||
store.onSync({ 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