( segment: UrlSegmentGroup, expected: string, hasChildren: boolean = false, )
| 464 | }); |
| 465 | |
| 466 | function expectSegment( |
| 467 | segment: UrlSegmentGroup, |
| 468 | expected: string, |
| 469 | hasChildren: boolean = false, |
| 470 | ): void { |
| 471 | if (segment.segments.filter((s) => s.path === '').length > 0) { |
| 472 | throw new Error(`UrlSegments cannot be empty ${segment.segments}`); |
| 473 | } |
| 474 | const p = segment.segments.map((p) => serializePath(p)).join('/'); |
| 475 | expect(p).toEqual(expected); |
| 476 | expect(Object.keys(segment.children).length > 0).toEqual(hasChildren); |
| 477 | } |
no test coverage detected
searching dependent graphs…