File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 41
41
42
42
--- Validate a config
43
43
--- @param _config neotest-busted.Config
44
+ --- @param skip_executable_check ? boolean
44
45
--- @return boolean
45
46
--- @return any ?
46
- function config .validate (_config )
47
+ function config .validate (_config , skip_executable_check )
47
48
-- stylua: ignore start
48
49
local ok , error = pcall (vim .validate , {
49
50
busted_command = {
@@ -82,7 +83,7 @@ function config.validate(_config)
82
83
return ok , error
83
84
end
84
85
85
- if type (_config .busted_command ) == " string" then
86
+ if not skip_executable_check and type (_config .busted_command ) == " string" then
86
87
if vim .fn .executable (_config .busted_command ) == 0 then
87
88
return false , " busted command in configuration is not executable"
88
89
end
97
98
function config .configure (user_config )
98
99
_user_config = vim .tbl_deep_extend (" keep" , user_config or {}, default_config )
99
100
100
- local ok , error = config .validate (_user_config )
101
+ -- Skip checking the executable when running setup to avoid the error
102
+ -- message as neotest loads all adapters so users will see an error in a
103
+ -- non-lua/neovim directory with a relative path in `busted_command`
104
+ local ok , error = config .validate (_user_config , true )
101
105
102
106
if not ok then
103
107
vim .api .nvim_echo ({
You can’t perform that action at this time.
0 commit comments