Skip to content

[Repo Assist] test: add 3 edge-case tests for findFiles depth/name priority and out-of-tree paths#118

Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/test-findfiles-depth-name-2026-04-01-37d3ee64a7caa08f
Draft

[Repo Assist] test: add 3 edge-case tests for findFiles depth/name priority and out-of-tree paths#118
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/test-findfiles-depth-name-2026-04-01-37d3ee64a7caa08f

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 1, 2026

🤖 This is an automated pull request from Repo Assist.

Summary

Adds 3 targeted edge-case tests to test/unit.test.js that document and verify the interaction between depth-first traversal and name-array order priority in findFiles, plus an out-of-tree path robustness check.

New Tests

Test What it verifies
depth beats name-array order A file listed later in the names array wins if it's in a closer (child) directory — depth always takes priority over name order
name-array order respected at same level When both names exist in the same directory, the first name in the array wins
returns null for out-of-tree absolute directory Passing an absolute path that's completely outside parent returns null or a safe absolute path — no crash

Motivation

These behaviors are implicit in the code but were not previously documented by tests. The depth-vs-name-order interaction is a common source of confusion when multiple phpcs config file names (e.g., phpcs.xml and .phpcs.xml) exist at different directory levels.

These tests complement the existing 7 tests and the open PR #113 (which tests empty-names, name-priority, and depth-priority from a different angle).

Test Status

node --test test/unit.test.js
✔ findFiles (10 pass, 0 fail)

All 10 tests pass (7 existing + 3 new).

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

…-tree paths

- depth beats name-array order: child match wins even if listed later
- name-array order respected when all candidates at the same level
- returns null (or safe value) for an out-of-tree absolute directory path

These tests document the interaction between depth-first traversal and
name-array priority, which is a common source of confusion when multiple
config file names exist at different levels of the directory tree.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants