(records: Record<string, string>[], extra: Partial<QueryGraphResult> = {})
| 8 | const row = (value: GraphNode, prefix = '') => Object.fromEntries(Object.entries({ id: value.id, label: value.label, name: value.name, qn: value.qualified_name, |
| 9 | file: value.file_path, start_line: value.start_line, end_line: value.end_line }).map(([key, value]) => [prefix + key, String(value ?? '')])); |
| 10 | const page = (records: Record<string, string>[], extra: Partial<QueryGraphResult> = {}): QueryGraphResult => { |
| 11 | const columns = Object.keys(records[0] ?? { id: '' }); |
| 12 | return { columns, rows: records.map(record => columns.map(column => record[column]!)), total: records.length, ...extra }; |
| 13 | }; |
| 14 | const edgeRow = (id: number, a: GraphNode, b: GraphNode, type = 'CALLS') => ({ edge_id: String(id), edge_type: type, edge_line: '2', ...row(a, 'a_'), ...row(b, 'b_') }); |
| 15 | |
| 16 | describe('complete scoped graph acquisition', () => { |
no test coverage detected