Skip to content

The agent that grows with you

test(lsp): local .ts lint seam is the managed-Node runner, not the terminal _exec

teknium14569bb8d21fa
diff --git a/tests/agent/lsp/test_install_and_lint_fixes.py b/tests/agent/lsp/test_install_and_lint_fixes.py
index dba619a857b..55d1fb84a92 100644
--- a/tests/agent/lsp/test_install_and_lint_fixes.py
+++ b/tests/agent/lsp/test_install_and_lint_fixes.py
@@ -75,8 +75,8 @@ def test_check_lint_returns_error_for_real_ts_type_errors(tmp_path, monkeypatch)
result.stdout = real_tsc_error
return result
- with patch.object(fops, "_exec", side_effect=fake_exec), \
- patch.object(fops, "_has_command", return_value=True):
+ # Local .ts lint runs PM's npx directly, not through the terminal shell's _exec.
+ with patch.object(fops, "_run_managed_node_linter", side_effect=lambda ext, path: fake_exec(path)):
lint = fops._check_lint(str(ts_file))
assert lint.skipped is False
diff --git a/tests/agent/lsp/test_shell_linter_lsp_skip.py b/tests/agent/lsp/test_shell_linter_lsp_skip.py
index 2863e2ba4a2..aba63821e69 100644
--- a/tests/agent/lsp/test_shell_linter_lsp_skip.py
+++ b/tests/agent/lsp/test_shell_linter_lsp_skip.py
@@ -128,11 +128,10 @@ def test_ts_shell_linter_runs_when_no_ancestor_tsconfig(tmp_path):
with patch.object(fops, "_lsp_local_only", return_value=True), \
patch.object(fops, "_lsp_will_handle", return_value=False), \
- patch.object(fops, "_has_command", return_value=True), \
- patch.object(fops, "_exec", return_value=exec_result) as exec_mock:
+ patch.object(fops, "_run_managed_node_linter", return_value=exec_result) as exec_mock:
fops._check_lint(str(src))
- assert exec_mock.called, "shell tsc should run when there's no project tsconfig"
+ assert exec_mock.called, "tsc should run when there's no project tsconfig"
if __name__ == "__main__": # pragma: no cover