mirror of
https://github.com/pnx/neotest-phpunit
synced 2026-06-16 03:54:55 +02:00
[Feature] Add Customizable Sail Project Path (#6)
* Add sail_project_path to config * Use sail_project_path in init.lua * Update README.md --------- Co-authored-by: Ziyad Sfaxi <ziyadsfaxi@Ziyads-MacBook-Pro-2.local>
This commit is contained in:
parent
25501800b5
commit
86737ada67
3 changed files with 6 additions and 1 deletions
|
|
@ -65,6 +65,10 @@ adapters = {
|
||||||
-- -- Default: "vendor/bin/sail"
|
-- -- Default: "vendor/bin/sail"
|
||||||
sail_executable = "vendor/bin/sail",
|
sail_executable = "vendor/bin/sail",
|
||||||
|
|
||||||
|
-- Custom sail project root path.
|
||||||
|
-- -- Default: "/var/www/html"
|
||||||
|
sail_project_path = "/var/www/html",
|
||||||
|
|
||||||
-- Custom pest binary.
|
-- Custom pest binary.
|
||||||
-- -- Default: function that checks for sail presence
|
-- -- Default: function that checks for sail presence
|
||||||
pest_cmd = "vendor/bin/pest",
|
pest_cmd = "vendor/bin/pest",
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ local M = {
|
||||||
ignore_dirs = { "vendor", "node_modules" },
|
ignore_dirs = { "vendor", "node_modules" },
|
||||||
test_file_suffixes = { "Test.php" },
|
test_file_suffixes = { "Test.php" },
|
||||||
sail_executable = "vendor/bin/sail",
|
sail_executable = "vendor/bin/sail",
|
||||||
|
sail_project_path = "/var/www/html",
|
||||||
parallel = 0,
|
parallel = 0,
|
||||||
compact = false,
|
compact = false,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ function NeotestAdapter.build_spec(args)
|
||||||
|
|
||||||
if config('sail_enabled') then
|
if config('sail_enabled') then
|
||||||
debug("Sail enabled, adjusting path")
|
debug("Sail enabled, adjusting path")
|
||||||
path = "/var/www/html" .. string.sub(position.path, string.len(vim.loop.cwd() or "") + 1)
|
path = config('sail_project_path') .. string.sub(position.path, string.len(vim.loop.cwd() or "") + 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
local command = vim.tbl_flatten({
|
local command = vim.tbl_flatten({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue