We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3d2730 commit e0dec35Copy full SHA for e0dec35
vitest/tests/utils.test.ts
@@ -139,6 +139,12 @@ describe("readHistoryFile", () => {
139
expect(result).toEqual(mockData);
140
});
141
142
+ it("should return an empty object when history file does not exist", () => {
143
+ vi.spyOn(fs, "existsSync").mockReturnValue(false);
144
+ const result = utils.readHistoryFile();
145
+ expect(result).toEqual({});
146
+ });
147
+
148
it("should return an empty object when fs.readFileSync throws an error", () => {
149
vi.spyOn(fs, "existsSync").mockReturnValue(true);
150
vi.spyOn(fs, "readFileSync").mockImplementation(() => {
0 commit comments