Is it possible to mock the Queries Ontology API (like how whenObjectSet is used to mock Objects.search)? When I run a unit test for a function that calls Queries.fetchNotepadContent, the Query comes back undefined.
Here are some example snippets of code to illustrate:
// index.ts
import { Queries } from "@foundry/ontology-api";
async function getNotepadContent(notepad_rid: string): string {
return await Queries.fetchNotepadContent({ notepad_rid });
}
// __tests__/index.ts
import { getNotepadContent } from "..";
describe("test suite", () => {
test("get notepad content", async () => {
const notepad_rid = "notepad_rid";
const expected_result = "example";
// TODO - add mock for Query
const result = await getNotepadContent(notepad_rid);
expect(result).toEqual(expected_result);
});
});