refactor: Refactor and add a test

This commit is contained in:
Daniel J. Geiger
2023-09-22 17:33:34 -05:00
parent 62f5475c4a
commit ec26aeead2
6 changed files with 52 additions and 18 deletions
+4 -3
View File
@@ -1,3 +1,4 @@
import { vi } from "vitest";
import fallbackLangData from "./helpers/locales/en.json";
import {
SubtypeLoadedCb,
@@ -458,9 +459,9 @@ describe("subtypes", () => {
return { width: 1, height: 0, baseline: 0 };
};
jest
.spyOn(textElementUtils, "measureText")
.mockImplementation(mockMeasureText);
vi.spyOn(textElementUtils, "measureText").mockImplementation(
mockMeasureText,
);
elements.forEach((el) => {
if (isTextElement(el)) {