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

Function checkStyle

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

Source from the content-addressed store, hash-verified

13}
14
15function checkStyle(jsonStr: string, expectGrid: Partial<TableNode>[][]) {
16 const tree = parseJSON(jsonStr);
17 const tableGrid = buildTableGrid(tree);
18 const actualGrid: Partial<TableNode>[][] = tableGrid.grid.map((row) =>
19 row.map((cell) => {
20 const nd: Partial<TableNode> = {
21 x: cell.x,
22 width: cell.width,
23 type: cell.type,
24 };
25 if (!isDummyType(cell.type)) {
26 nd.text = cell.text;
27 }
28 return nd;
29 }),
30 );
31 expect(actualGrid).toEqual(expectGrid);
32}
33
34describe("buildTableGrid", () => {
35 test("value", () => {

Callers 1

table.test.tsFile · 0.85

Calls 3

parseJSONFunction · 0.90
buildTableGridFunction · 0.90
isDummyTypeFunction · 0.90

Tested by

no test coverage detected