| ... | ... | @@ -1,19 +1,11 @@ |
| 1 | 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | 2 | |
| 3 | | import { |
| 4 | | fileContentRevision, |
| 5 | | projectFileCacheKey, |
| 6 | | projectFileEditorCacheKey, |
| 7 | | } from "./fileContentRevision"; |
| 3 | import { projectFileCacheKey, projectFileEditorCacheKey } from "./fileContentRevision"; |
| 8 | 4 | |
| 9 | | describe("fileContentRevision", () => { |
| 5 | describe("file cache identity", () => { |
| 10 | 6 | it("changes for same-length edits", () => { |
| 11 | | expect(fileContentRevision("nodeVersion")).not.toBe(fileContentRevision("nodeVeasdrs")); |
| 12 | | }); |
| 13 | | |
| 14 | | it("keeps identical contents stable", () => { |
| 15 | | expect(projectFileCacheKey("/repo", "file.json", "contents")).toBe( |
| 16 | | projectFileCacheKey("/repo", "file.json", "contents"), |
| 7 | expect(projectFileCacheKey("/repo", "file.json", "nodeVersion")).not.toBe( |
| 8 | projectFileCacheKey("/repo", "file.json", "nodeVeasdrs"), |
| 17 | 9 | ); |
| 18 | 10 | }); |
| 19 | 11 | |