Skip to content

Commit d432ec4

Browse files
committed
test: Stabilize path tree ancestry ordering
Sort expected child path lines so the renderer test does not depend on locale-sensitive ordering of home-directory and sibling paths.
1 parent 4f52adb commit d432ec4

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/utils/renderers/__tests__/path-tree.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ describe('formatPathTree', () => {
7878
});
7979

8080
it('preserves raw shared ancestry even when a descendant path would display differently alone', () => {
81+
const childLines = [
82+
`${homeDirectoryName}/Library/Logs/build.log — User Logs`,
83+
'other/Library/Logs/build.log — Other Logs',
84+
].sort();
85+
8186
expect(
8287
formatPathTree(
8388
[
@@ -86,11 +91,7 @@ describe('formatPathTree', () => {
8691
],
8792
{ formatPath: displayPath },
8893
),
89-
).toEqual([
90-
`└── ${homeParentPath}/`,
91-
` ├── ${homeDirectoryName}/Library/Logs/build.log — User Logs`,
92-
' └── other/Library/Logs/build.log — Other Logs',
93-
]);
94+
).toEqual([`└── ${homeParentPath}/`, ` ├── ${childLines[0]}`, ` └── ${childLines[1]}`]);
9495
});
9596

9697
it('sorts relative paths before rendering', () => {

0 commit comments

Comments
 (0)