edit.test.ts 546 B

1234567891011121314151617181920
  1. import { describe, expect, it } from "vitest";
  2. import { EditErrorCode } from "../src/tools/edit.js";
  3. describe("Edit contracts", () => {
  4. it("exports the handler error codes from one source", () => {
  5. expect(EditErrorCode).toEqual({
  6. NO_CHANGE: 1,
  7. FILE_EXISTS_NO_OLD_STRING: 3,
  8. FILE_NOT_EXIST: 4,
  9. NOTEBOOK_FILE: 5,
  10. FILE_NOT_READ: 6,
  11. STALE_FILE: 7,
  12. OLD_STRING_NOT_FOUND: 8,
  13. AMBIGUOUS_REPLACE: 9,
  14. FILE_TOO_LARGE: 10,
  15. INVALID_PATH: 13,
  16. UNSUPPORTED_ENCODING: 15,
  17. });
  18. });
  19. });