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

Function checkText

__tests__/table.test.ts:6–13  ·  view source on GitHub ↗
(jsonStr: string, expectGrid: Partial<TableNode>[][])

Source from the content-addressed store, hash-verified

4import { isDummyType } from "@/lib/table/utils";
5
6function checkText(jsonStr: string, expectGrid: Partial<TableNode>[][]) {
7 const tree = parseJSON(jsonStr);
8 const tableGrid = buildTableGrid(tree);
9 const actualGrid: Partial<TableNode>[][] = tableGrid.grid.map((row) =>
10 row.map((cell) => (isDummyType(cell.type) ? { type: cell.type } : { type: cell.type, text: cell.text })),
11 );
12 expect(actualGrid).toEqual(expectGrid);
13}
14
15function checkStyle(jsonStr: string, expectGrid: Partial<TableNode>[][]) {
16 const tree = parseJSON(jsonStr);

Callers 1

table.test.tsFile · 0.85

Calls 3

parseJSONFunction · 0.90
buildTableGridFunction · 0.90
isDummyTypeFunction · 0.90

Tested by

no test coverage detected