( segment: UrlSegmentGroup, expected: string, hasChildren: boolean = false, )
| 630 | }); |
| 631 | |
| 632 | function expectSegment( |
| 633 | segment: UrlSegmentGroup, |
| 634 | expected: string, |
| 635 | hasChildren: boolean = false, |
| 636 | ): void { |
| 637 | if (segment.segments.filter((s) => s.path === '').length > 0) { |
| 638 | throw new Error(`UrlSegments cannot be empty ${segment.segments}`); |
| 639 | } |
| 640 | const p = segment.segments.map((p) => serializePath(p)).join('/'); |
| 641 | expect(p).toEqual(expected); |
| 642 | expect(Object.keys(segment.children).length > 0).toEqual(hasChildren); |
| 643 | } |
no test coverage detected