2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-01-12 20:59:13 -05:00
|
|
|
|
|
|
|
use test_util as util;
|
2023-11-17 10:05:42 -05:00
|
|
|
use util::assert_contains;
|
2023-01-12 20:59:13 -05:00
|
|
|
|
2023-06-27 20:57:20 -04:00
|
|
|
#[test]
|
|
|
|
fn help_output() {
|
|
|
|
let output = util::deno_cmd()
|
|
|
|
.current_dir(util::testdata_path())
|
|
|
|
.arg("--help")
|
2023-11-17 10:05:42 -05:00
|
|
|
.run();
|
2023-06-27 20:57:20 -04:00
|
|
|
|
2023-11-17 10:05:42 -05:00
|
|
|
let stdout = output.combined_output();
|
2023-06-27 20:57:20 -04:00
|
|
|
let subcommand_descriptions = vec![
|
2024-08-12 11:55:33 -04:00
|
|
|
"Run a JavaScript or TypeScript program, or a task",
|
|
|
|
"Run a server",
|
|
|
|
"Run a task defined in the configuration file",
|
|
|
|
"Start an interactive Read-Eval-Print Loop (REPL) for Deno",
|
|
|
|
"Evaluate a script from the command line",
|
|
|
|
"Add dependencies",
|
2024-10-30 11:32:04 -04:00
|
|
|
"Installs dependencies either in the local project or globally to a bin directory",
|
|
|
|
"Uninstalls a dependency or an executable script in the installation root's bin directory",
|
2023-06-27 20:57:20 -04:00
|
|
|
"Run benchmarks",
|
|
|
|
"Type-check the dependencies",
|
2023-10-27 21:54:52 -04:00
|
|
|
"Compile the script into a self contained executable",
|
2023-06-27 20:57:20 -04:00
|
|
|
"Print coverage reports",
|
2024-08-12 11:55:33 -04:00
|
|
|
"Genereate and show documentation for a module or built-ins",
|
2023-06-27 20:57:20 -04:00
|
|
|
"Format source files",
|
|
|
|
"Show info about cache or info related to source file",
|
2024-08-12 11:55:33 -04:00
|
|
|
"Deno kernel for Jupyter notebooks",
|
2023-06-27 20:57:20 -04:00
|
|
|
"Lint source files",
|
2024-08-12 11:55:33 -04:00
|
|
|
"Initialize a new project",
|
2023-06-27 20:57:20 -04:00
|
|
|
"Run tests",
|
2024-08-12 11:55:33 -04:00
|
|
|
"Publish the current working directory's package or workspace",
|
2023-11-29 13:52:25 -05:00
|
|
|
#[cfg(feature = "upgrade")]
|
2023-06-27 20:57:20 -04:00
|
|
|
"Upgrade deno executable to given version",
|
|
|
|
];
|
|
|
|
|
|
|
|
for description in subcommand_descriptions {
|
2023-11-17 10:05:42 -05:00
|
|
|
assert_contains!(stdout, description);
|
2023-06-27 20:57:20 -04:00
|
|
|
}
|
|
|
|
}
|