( segment: UrlSegmentGroup, expected: string, hasChildren: boolean = false, )
| 475 | }); |
| 476 | |
| 477 | function expectSegment( |
| 478 | segment: UrlSegmentGroup, |
| 479 | expected: string, |
| 480 | hasChildren: boolean = false, |
| 481 | ): void { |
| 482 | if (segment.segments.filter((s) => s.path === '').length > 0) { |
| 483 | throw new Error(`UrlSegments cannot be empty ${segment.segments}`); |
| 484 | } |
| 485 | const p = segment.segments.map((p) => serializePath(p)).join('/'); |
| 486 | expect(p).toEqual(expected); |
| 487 | expect(Object.keys(segment.children).length > 0).toEqual(hasChildren); |
| 488 | } |
no test coverage detected