mirror of
https://github.com/pnx/neotest-phpunit
synced 2026-06-25 10:33:42 +02:00
Better root and test dir matching
This commit is contained in:
parent
a505827192
commit
179ada37aa
1 changed files with 2 additions and 2 deletions
|
|
@ -13,7 +13,7 @@ local NeotestAdapter = { name = "neotest-pest" }
|
||||||
---@async
|
---@async
|
||||||
---@param dir string @Directory to treat as cwd
|
---@param dir string @Directory to treat as cwd
|
||||||
---@return string | nil @Absolute root dir of test suite
|
---@return string | nil @Absolute root dir of test suite
|
||||||
NeotestAdapter.root = lib.files.match_root_pattern("composer.json", "pest.xml")
|
NeotestAdapter.root = lib.files.match_root_pattern("composer.json", "tests/Pest.php")
|
||||||
|
|
||||||
---Filter directories when searching for test files
|
---Filter directories when searching for test files
|
||||||
---@async
|
---@async
|
||||||
|
|
@ -22,7 +22,7 @@ NeotestAdapter.root = lib.files.match_root_pattern("composer.json", "pest.xml")
|
||||||
---@param root string Root directory of project
|
---@param root string Root directory of project
|
||||||
---@return boolean True when matching
|
---@return boolean True when matching
|
||||||
function NeotestAdapter.filter_dir(name, rel_path, root)
|
function NeotestAdapter.filter_dir(name, rel_path, root)
|
||||||
return name ~= "tests" or string.match(rel_path, "tests")
|
return vim.startswith(rel_path, "tests")
|
||||||
end
|
end
|
||||||
|
|
||||||
---@async
|
---@async
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue