From 97937a097e8fe52cdefd55bf12a92e19d627aca4 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 3 Jan 2024 09:45:10 -0500 Subject: fix(jupyter): error message when install fails due to jupyter command not being on PATH (#21767) We were failing silently in this scenario. --- cli/tests/integration/jupyter_tests.rs | 8 ++++++++ cli/tests/integration/mod.rs | 5 ++++- cli/tests/testdata/jupyter/install_command_not_exists.out | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 cli/tests/integration/jupyter_tests.rs create mode 100644 cli/tests/testdata/jupyter/install_command_not_exists.out (limited to 'cli/tests') diff --git a/cli/tests/integration/jupyter_tests.rs b/cli/tests/integration/jupyter_tests.rs new file mode 100644 index 000000000..847290ef8 --- /dev/null +++ b/cli/tests/integration/jupyter_tests.rs @@ -0,0 +1,8 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +itest!(jupyter_install_command_not_exists { + args: "jupyter --unstable --install", + output: "jupyter/install_command_not_exists.out", + envs: vec![("PATH".to_string(), "".to_string())], + exit_code: 1, +}); diff --git a/cli/tests/integration/mod.rs b/cli/tests/integration/mod.rs index f599e2e87..19796f245 100644 --- a/cli/tests/integration/mod.rs +++ b/cli/tests/integration/mod.rs @@ -121,7 +121,10 @@ mod inspector; mod install; #[path = "js_unit_tests.rs"] mod js_unit_tests; -mod jsr_tests; +#[path = "jsr_tests.rs"] +mod jsr; +#[path = "jupyter_tests.rs"] +mod jupyter; #[path = "lint_tests.rs"] mod lint; #[path = "lsp_tests.rs"] diff --git a/cli/tests/testdata/jupyter/install_command_not_exists.out b/cli/tests/testdata/jupyter/install_command_not_exists.out new file mode 100644 index 000000000..3d599f7fc --- /dev/null +++ b/cli/tests/testdata/jupyter/install_command_not_exists.out @@ -0,0 +1,4 @@ +error: Failed to spawn 'jupyter' command. Is JupyterLab installed (https://jupyter.org/install) and available on the PATH? + +Caused by: +[WILDCARD] -- cgit v1.2.3