MCPcopy
hub / github.com/loggerhead/json4u / expectOffset

Function expectOffset

__tests__/tree.test.ts:6–9  ·  view source on GitHub ↗
(offset: number, id: string | undefined)

Source from the content-addressed store, hash-verified

4 const tree = parseJSON('{ "array": [12345678987654321, 0.1234567891111111111] }');
5
6 const expectOffset = (offset: number, id: string | undefined) => {
7 const r = tree.findNodeAtOffset(offset);
8 expect(r?.node?.id).toEqual(id);
9 };
10
11 test("simple", () => {
12 expectOffset(6, "$/array");

Callers 1

tree.test.tsFile · 0.85

Calls 1

findNodeAtOffsetMethod · 0.80

Tested by

no test coverage detected