mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
parent
c64aa50c0e
commit
1463a4ad58
93 changed files with 375 additions and 264 deletions
|
@ -3,169 +3,9 @@
|
|||
// Most of the tests for this are in deno_task_shell.
|
||||
// These tests are intended to only test integration.
|
||||
|
||||
use test_util::env_vars_for_npm_tests;
|
||||
use test_util::itest;
|
||||
use test_util::TestContext;
|
||||
|
||||
itest!(task_no_args {
|
||||
args: "task -q --config task/deno_json/deno.json",
|
||||
output: "task/deno_json/task_no_args.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(task_cwd {
|
||||
args: "task -q --config task/deno_json/deno.json --cwd .. echo_cwd",
|
||||
output: "task/deno_json/task_cwd.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
exit_code: 0,
|
||||
});
|
||||
|
||||
itest!(task_init_cwd {
|
||||
args: "task -q --config task/deno_json/deno.json --cwd .. echo_init_cwd",
|
||||
output: "task/deno_json/task_init_cwd.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
exit_code: 0,
|
||||
});
|
||||
|
||||
itest!(task_init_cwd_already_set {
|
||||
args: "task -q --config task/deno_json/deno.json echo_init_cwd",
|
||||
output: "task/deno_json/task_init_cwd_already_set.out",
|
||||
envs: vec![
|
||||
("NO_COLOR".to_string(), "1".to_string()),
|
||||
("INIT_CWD".to_string(), "HELLO".to_string())
|
||||
],
|
||||
exit_code: 0,
|
||||
});
|
||||
|
||||
itest!(task_cwd_resolves_config_from_specified_dir {
|
||||
args: "task -q --cwd task/deno_json",
|
||||
output: "task/deno_json/task_no_args.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(task_non_existent {
|
||||
args: "task --config task/deno_json/deno.json non_existent",
|
||||
output: "task/deno_json/task_non_existent.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn task_emoji() {
|
||||
// this bug only appears when using a pty/tty
|
||||
TestContext::default()
|
||||
.new_command()
|
||||
.args_vec(["task", "--config", "task/deno_json/deno.json", "echo_emoji"])
|
||||
.with_pty(|mut console| {
|
||||
console.expect("Task echo_emoji echo 🔥\r\n🔥");
|
||||
});
|
||||
}
|
||||
|
||||
itest!(task_boolean_logic {
|
||||
args: "task -q --config task/deno_json/deno.json boolean_logic",
|
||||
output: "task/deno_json/task_boolean_logic.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
||||
itest!(task_exit_code_5 {
|
||||
args: "task --config task/deno_json/deno.json exit_code_5",
|
||||
output: "task/deno_json/task_exit_code_5.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
exit_code: 5,
|
||||
});
|
||||
|
||||
itest!(task_additional_args {
|
||||
args: "task -q --config task/deno_json/deno.json echo 2",
|
||||
output: "task/deno_json/task_additional_args.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
||||
itest!(task_additional_args_no_shell_expansion {
|
||||
args_vec: vec![
|
||||
"task",
|
||||
"-q",
|
||||
"--config",
|
||||
"task/deno_json/deno.json",
|
||||
"echo",
|
||||
"$(echo 5)"
|
||||
],
|
||||
output: "task/deno_json/task_additional_args_no_shell_expansion.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
||||
itest!(task_additional_args_nested_strings {
|
||||
args_vec: vec![
|
||||
"task",
|
||||
"-q",
|
||||
"--config",
|
||||
"task/deno_json/deno.json",
|
||||
"echo",
|
||||
"string \"quoted string\""
|
||||
],
|
||||
output: "task/deno_json/task_additional_args_nested_strings.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
||||
itest!(task_additional_args_no_logic {
|
||||
args_vec: vec![
|
||||
"task",
|
||||
"-q",
|
||||
"--config",
|
||||
"task/deno_json/deno.json",
|
||||
"echo",
|
||||
"||",
|
||||
"echo",
|
||||
"5"
|
||||
],
|
||||
output: "task/deno_json/task_additional_args_no_logic.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
||||
itest!(task_deno_exe_no_env {
|
||||
args_vec: vec![
|
||||
"task",
|
||||
"-q",
|
||||
"--config",
|
||||
"task/deno_json/deno.json",
|
||||
"deno_echo"
|
||||
],
|
||||
output: "task/deno_json/task_deno_exe_no_env.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
env_clear: true,
|
||||
});
|
||||
|
||||
itest!(task_piped_stdin {
|
||||
args_vec: vec![
|
||||
"task",
|
||||
"-q",
|
||||
"--config",
|
||||
"task/deno_json/deno.json",
|
||||
"piped"
|
||||
],
|
||||
output: "task/deno_json/task_piped_stdin.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
||||
itest!(task_package_json_no_arg {
|
||||
args: "task",
|
||||
cwd: Some("task/package_json/"),
|
||||
output: "task/package_json/no_args.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(task_package_json_echo {
|
||||
args: "task --quiet echo",
|
||||
cwd: Some("task/package_json/"),
|
||||
output: "task/package_json/echo.out",
|
||||
// use a temp dir because the node_modules folder will be created
|
||||
copy_temp_dir: Some("task/package_json/"),
|
||||
envs: env_vars_for_npm_tests(),
|
||||
exit_code: 0,
|
||||
http_server: true,
|
||||
});
|
||||
// use test_util::env_vars_for_npm_tests;
|
||||
// use test_util::itest;
|
||||
// use test_util::TestContext;
|
||||
|
||||
// TODO(2.0): this should first run `deno install`
|
||||
// itest!(task_package_json_npm_bin {
|
||||
|
@ -191,24 +31,6 @@ itest!(task_package_json_echo {
|
|||
// http_server: true,
|
||||
// });
|
||||
|
||||
itest!(task_both_no_arg {
|
||||
args: "task",
|
||||
cwd: Some("task/both/"),
|
||||
output: "task/both/no_args.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(task_both_deno_json_selected {
|
||||
args: "task other",
|
||||
cwd: Some("task/both/"),
|
||||
output: "task/both/deno_selected.out",
|
||||
copy_temp_dir: Some("task/both/"),
|
||||
envs: env_vars_for_npm_tests(),
|
||||
exit_code: 0,
|
||||
http_server: true,
|
||||
});
|
||||
|
||||
// TODO(2.0): not entirely clear what's wrong with this test
|
||||
// itest!(task_both_package_json_selected {
|
||||
// args: "task bin asdf",
|
||||
|
@ -220,26 +42,6 @@ itest!(task_both_deno_json_selected {
|
|||
// http_server: true,
|
||||
// });
|
||||
|
||||
itest!(task_both_prefers_deno {
|
||||
args: "task output some text",
|
||||
cwd: Some("task/both/"),
|
||||
output: "task/both/prefers_deno.out",
|
||||
copy_temp_dir: Some("task/both/"),
|
||||
envs: env_vars_for_npm_tests(),
|
||||
exit_code: 0,
|
||||
http_server: true,
|
||||
});
|
||||
|
||||
itest!(task_npx_non_existent {
|
||||
args: "task non-existent",
|
||||
cwd: Some("task/npx/"),
|
||||
output: "task/npx/non_existent.out",
|
||||
copy_temp_dir: Some("task/npx/"),
|
||||
envs: env_vars_for_npm_tests(),
|
||||
exit_code: 1,
|
||||
http_server: true,
|
||||
});
|
||||
|
||||
// TODO(2.0): not entirely clear what's wrong with this test but it hangs for more than 60s
|
||||
// itest!(task_npx_on_own {
|
||||
// args: "task on-own",
|
||||
|
@ -250,57 +52,3 @@ itest!(task_npx_non_existent {
|
|||
// exit_code: 1,
|
||||
// http_server: true,
|
||||
// });
|
||||
|
||||
itest!(task_pre_post {
|
||||
args: "task test",
|
||||
cwd: Some("task/package_json_pre_post/"),
|
||||
output: "task/package_json_pre_post/bin.out",
|
||||
copy_temp_dir: Some("task/package_json_pre_post/"),
|
||||
exit_code: 0,
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
||||
itest!(task_pre {
|
||||
args: "task test",
|
||||
cwd: Some("task/package_json_pre/"),
|
||||
output: "task/package_json_pre/bin.out",
|
||||
copy_temp_dir: Some("task/package_json_pre/"),
|
||||
exit_code: 0,
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
||||
itest!(task_post {
|
||||
args: "task test",
|
||||
cwd: Some("task/package_json_post/"),
|
||||
output: "task/package_json_post/bin.out",
|
||||
copy_temp_dir: Some("task/package_json_post/"),
|
||||
exit_code: 0,
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
||||
itest!(task_post_only {
|
||||
args: "task test",
|
||||
cwd: Some("task/package_json_post_only/"),
|
||||
output: "task/package_json_post_only/bin.out",
|
||||
copy_temp_dir: Some("task/package_json_post_only/"),
|
||||
exit_code: 1,
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
||||
itest!(task_pre_only {
|
||||
args: "task test",
|
||||
cwd: Some("task/package_json_pre_only/"),
|
||||
output: "task/package_json_pre_only/bin.out",
|
||||
copy_temp_dir: Some("task/package_json_pre_only/"),
|
||||
exit_code: 1,
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
||||
itest!(task_deno_no_pre_post {
|
||||
args: "task test",
|
||||
cwd: Some("task/deno_json_pre_post/"),
|
||||
output: "task/deno_json_pre_post/bin.out",
|
||||
copy_temp_dir: Some("task/deno_json_pre_post/"),
|
||||
exit_code: 0,
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
});
|
||||
|
|
7
tests/specs/task/additional_args/__test__.jsonc
Normal file
7
tests/specs/task/additional_args/__test__.jsonc
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"args": "task -q --config deno.json echo 2",
|
||||
"output": "task_additional_args.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
}
|
||||
}
|
5
tests/specs/task/additional_args/deno.json
Normal file
5
tests/specs/task/additional_args/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"echo": "echo 1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"args": "task -q --config deno.json echo string \"quoted string\"",
|
||||
"output": "task_additional_args_nested_strings.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"echo": "echo 1"
|
||||
}
|
||||
}
|
7
tests/specs/task/additional_args_no_logic/__test__.jsonc
Normal file
7
tests/specs/task/additional_args_no_logic/__test__.jsonc
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"args": "task -q --config deno.json echo || echo 5",
|
||||
"output": "task_additional_args_no_logic.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
}
|
||||
}
|
5
tests/specs/task/additional_args_no_logic/deno.json
Normal file
5
tests/specs/task/additional_args_no_logic/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"echo": "echo 1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"args": "task -q --config deno.json echo $(echo 5)",
|
||||
"output": "task_additional_args_no_shell_expansion.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"echo": "echo 1"
|
||||
}
|
||||
}
|
7
tests/specs/task/boolean_logic/__test__.jsonc
Normal file
7
tests/specs/task/boolean_logic/__test__.jsonc
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"args": "task -q --config deno.json boolean_logic",
|
||||
"output": "task_boolean_logic.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
}
|
||||
}
|
5
tests/specs/task/boolean_logic/deno.json
Normal file
5
tests/specs/task/boolean_logic/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"boolean_logic": "sleep 0.1 && echo 3 && echo 4 & echo 1 && echo 2 || echo NOPE"
|
||||
}
|
||||
}
|
9
tests/specs/task/both_deno_json_selected/__test__.jsonc
Normal file
9
tests/specs/task/both_deno_json_selected/__test__.jsonc
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"args": "task --config deno.json other",
|
||||
"output": "deno_selected.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1",
|
||||
"NPM_CONFIG_REGISTRY": "http://localhost:4260/"
|
||||
},
|
||||
"exitCode": 0
|
||||
}
|
6
tests/specs/task/both_deno_json_selected/deno.json
Normal file
6
tests/specs/task/both_deno_json_selected/deno.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"tasks": {
|
||||
"output": "deno eval 'console.log(1)'",
|
||||
"other": "deno eval 'console.log(2)'"
|
||||
}
|
||||
}
|
8
tests/specs/task/both_no_arg/__test__.jsonc
Normal file
8
tests/specs/task/both_no_arg/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task --config deno.json",
|
||||
"output": "no_args.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 1
|
||||
}
|
6
tests/specs/task/both_no_arg/deno.json
Normal file
6
tests/specs/task/both_no_arg/deno.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"tasks": {
|
||||
"output": "deno eval 'console.log(1)'",
|
||||
"other": "deno eval 'console.log(2)'"
|
||||
}
|
||||
}
|
9
tests/specs/task/both_no_arg/package.json
Normal file
9
tests/specs/task/both_no_arg/package.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"scripts": {
|
||||
"bin": "cli-esm testing this out",
|
||||
"output": "echo should never be called or shown"
|
||||
},
|
||||
"dependencies": {
|
||||
"other": "npm:@denotest/bin@1.0"
|
||||
}
|
||||
}
|
9
tests/specs/task/both_prefers_deno/__test__.jsonc
Normal file
9
tests/specs/task/both_prefers_deno/__test__.jsonc
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"args": "task --config deno.json output some text",
|
||||
"output": "prefers_deno.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1",
|
||||
"NPM_CONFIG_REGISTRY": "http://localhost:4260/"
|
||||
},
|
||||
"exitCode": 0
|
||||
}
|
6
tests/specs/task/both_prefers_deno/deno.json
Normal file
6
tests/specs/task/both_prefers_deno/deno.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"tasks": {
|
||||
"output": "deno eval 'console.log(1)'",
|
||||
"other": "deno eval 'console.log(2)'"
|
||||
}
|
||||
}
|
8
tests/specs/task/cwd/__test__.jsonc
Normal file
8
tests/specs/task/cwd/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task -q --config deno.json --cwd .. echo_cwd",
|
||||
"output": "task_cwd.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 0
|
||||
}
|
5
tests/specs/task/cwd/deno.json
Normal file
5
tests/specs/task/cwd/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"echo_cwd": "echo $(pwd)"
|
||||
}
|
||||
}
|
1
tests/specs/task/cwd/task_cwd.out
Normal file
1
tests/specs/task/cwd/task_cwd.out
Normal file
|
@ -0,0 +1 @@
|
|||
[WILDCARD]task
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task -q --cwd deno.json",
|
||||
"output": "task_no_args.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 1
|
||||
}
|
7
tests/specs/task/deno_exe_no_env/__test__.jsonc
Normal file
7
tests/specs/task/deno_exe_no_env/__test__.jsonc
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"args": "task -q --config deno.json deno_echo",
|
||||
"output": "task_deno_exe_no_env.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
}
|
||||
}
|
5
tests/specs/task/deno_exe_no_env/deno.json
Normal file
5
tests/specs/task/deno_exe_no_env/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"deno_echo": "deno eval 'console.log(5)'"
|
||||
}
|
||||
}
|
8
tests/specs/task/deno_no_pre_post/__test__.jsonc
Normal file
8
tests/specs/task/deno_no_pre_post/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task --config deno.json test",
|
||||
"output": "bin.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 0
|
||||
}
|
4
tests/specs/task/emoji/__test__.jsonc
Normal file
4
tests/specs/task/emoji/__test__.jsonc
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"args": "task -q --cwd deno.json echo_emoji",
|
||||
"output": "main.out"
|
||||
}
|
5
tests/specs/task/emoji/deno.json
Normal file
5
tests/specs/task/emoji/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"echo_emoji": "echo 🔥"
|
||||
}
|
||||
}
|
1
tests/specs/task/emoji/main.out
Normal file
1
tests/specs/task/emoji/main.out
Normal file
|
@ -0,0 +1 @@
|
|||
🔥
|
8
tests/specs/task/exit_code_5/__test__.jsonc
Normal file
8
tests/specs/task/exit_code_5/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task --config deno.json exit_code_5",
|
||||
"output": "task_exit_code_5.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 5
|
||||
}
|
5
tests/specs/task/exit_code_5/deno.json
Normal file
5
tests/specs/task/exit_code_5/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"exit_code_5": "echo $(echo 10 ; exit 2) && exit 5"
|
||||
}
|
||||
}
|
8
tests/specs/task/init_cwd/__test__.jsonc
Normal file
8
tests/specs/task/init_cwd/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task -q --config deno.json --cwd .. echo_init_cwd",
|
||||
"output": "task_init_cwd.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 0
|
||||
}
|
5
tests/specs/task/init_cwd/deno.json
Normal file
5
tests/specs/task/init_cwd/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"echo_init_cwd": "echo $INIT_CWD"
|
||||
}
|
||||
}
|
1
tests/specs/task/init_cwd/task_init_cwd.out
Normal file
1
tests/specs/task/init_cwd/task_init_cwd.out
Normal file
|
@ -0,0 +1 @@
|
|||
[WILDCARD]init_cwd
|
9
tests/specs/task/init_cwd_already_set/__test__.jsonc
Normal file
9
tests/specs/task/init_cwd_already_set/__test__.jsonc
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"args": "task -q --config deno.json echo_init_cwd",
|
||||
"output": "task_init_cwd_already_set.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1",
|
||||
"INIT_CWD": "HELLO"
|
||||
},
|
||||
"exitCode": 0
|
||||
}
|
5
tests/specs/task/init_cwd_already_set/deno.json
Normal file
5
tests/specs/task/init_cwd_already_set/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"echo_init_cwd": "echo $INIT_CWD"
|
||||
}
|
||||
}
|
8
tests/specs/task/no_args/__test__.jsonc
Normal file
8
tests/specs/task/no_args/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task -q --config deno.json",
|
||||
"output": "task_no_args.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 1
|
||||
}
|
13
tests/specs/task/no_args/deno.json
Normal file
13
tests/specs/task/no_args/deno.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"tasks": {
|
||||
"boolean_logic": "sleep 0.1 && echo 3 && echo 4 & echo 1 && echo 2 || echo NOPE",
|
||||
"echo": "echo 1",
|
||||
"deno_echo": "deno eval 'console.log(5)'",
|
||||
"strings": "deno run main.ts && deno eval \"console.log(\\\"test\\\")\"",
|
||||
"piped": "echo 12345 | (deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)' && deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)')",
|
||||
"exit_code_5": "echo $(echo 10 ; exit 2) && exit 5",
|
||||
"echo_cwd": "echo $(pwd)",
|
||||
"echo_init_cwd": "echo $INIT_CWD",
|
||||
"echo_emoji": "echo 🔥"
|
||||
}
|
||||
}
|
19
tests/specs/task/no_args/task_no_args.out
Normal file
19
tests/specs/task/no_args/task_no_args.out
Normal file
|
@ -0,0 +1,19 @@
|
|||
Available tasks:
|
||||
- boolean_logic
|
||||
sleep 0.1 && echo 3 && echo 4 & echo 1 && echo 2 || echo NOPE
|
||||
- echo
|
||||
echo 1
|
||||
- deno_echo
|
||||
deno eval 'console.log(5)'
|
||||
- strings
|
||||
deno run main.ts && deno eval "console.log(\"test\")"
|
||||
- piped
|
||||
echo 12345 | (deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)' && deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)')
|
||||
- exit_code_5
|
||||
echo $(echo 10 ; exit 2) && exit 5
|
||||
- echo_cwd
|
||||
echo $(pwd)
|
||||
- echo_init_cwd
|
||||
echo $INIT_CWD
|
||||
- echo_emoji
|
||||
echo 🔥
|
8
tests/specs/task/non_existent/__test__.jsonc
Normal file
8
tests/specs/task/non_existent/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task --config deno.json non_existent",
|
||||
"output": "task_non_existent.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 1
|
||||
}
|
13
tests/specs/task/non_existent/deno.json
Normal file
13
tests/specs/task/non_existent/deno.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"tasks": {
|
||||
"boolean_logic": "sleep 0.1 && echo 3 && echo 4 & echo 1 && echo 2 || echo NOPE",
|
||||
"echo": "echo 1",
|
||||
"deno_echo": "deno eval 'console.log(5)'",
|
||||
"strings": "deno run main.ts && deno eval \"console.log(\\\"test\\\")\"",
|
||||
"piped": "echo 12345 | (deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)' && deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)')",
|
||||
"exit_code_5": "echo $(echo 10 ; exit 2) && exit 5",
|
||||
"echo_cwd": "echo $(pwd)",
|
||||
"echo_init_cwd": "echo $INIT_CWD",
|
||||
"echo_emoji": "echo 🔥"
|
||||
}
|
||||
}
|
9
tests/specs/task/npx_non_existent/__test__.jsonc
Normal file
9
tests/specs/task/npx_non_existent/__test__.jsonc
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"args": "task non-existent",
|
||||
"output": "non_existent.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1",
|
||||
"NPM_CONFIG_REGISTRY": "http://localhost:4260/"
|
||||
},
|
||||
"exitCode": 1
|
||||
}
|
6
tests/specs/task/npx_non_existent/package.json
Normal file
6
tests/specs/task/npx_non_existent/package.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"scripts": {
|
||||
"non-existent": "npx this-command-should-not-exist-for-you",
|
||||
"on-own": "npx"
|
||||
}
|
||||
}
|
9
tests/specs/task/package_json_echo/__test__.jsonc
Normal file
9
tests/specs/task/package_json_echo/__test__.jsonc
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"args": "task --quiet echo",
|
||||
"output": "echo.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1",
|
||||
"NPM_CONFIG_REGISTRY": "http://localhost:4260/"
|
||||
},
|
||||
"exitCode": 0
|
||||
}
|
10
tests/specs/task/package_json_echo/package.json
Normal file
10
tests/specs/task/package_json_echo/package.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"scripts": {
|
||||
"echo": "deno eval 'console.log(1)'",
|
||||
"bin": "@denotest/bin hi && cli-esm testing this out && npx cli-cjs test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@denotest/bin": "0.5",
|
||||
"other": "npm:@denotest/bin@1.0"
|
||||
}
|
||||
}
|
8
tests/specs/task/package_json_no_arg/__test__.jsonc
Normal file
8
tests/specs/task/package_json_no_arg/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task",
|
||||
"output": "no_args.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 1
|
||||
}
|
10
tests/specs/task/package_json_no_arg/package.json
Normal file
10
tests/specs/task/package_json_no_arg/package.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"scripts": {
|
||||
"echo": "deno eval 'console.log(1)'",
|
||||
"bin": "@denotest/bin hi && cli-esm testing this out && npx cli-cjs test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@denotest/bin": "0.5",
|
||||
"other": "npm:@denotest/bin@1.0"
|
||||
}
|
||||
}
|
7
tests/specs/task/piped_stdin/__test__.jsonc
Normal file
7
tests/specs/task/piped_stdin/__test__.jsonc
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"args": "task -q --config deno.json piped",
|
||||
"output": "task_piped_stdin.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
}
|
||||
}
|
5
tests/specs/task/piped_stdin/deno.json
Normal file
5
tests/specs/task/piped_stdin/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"tasks": {
|
||||
"piped": "echo 12345 | (deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)' && deno eval 'const b = new Uint8Array(1);Deno.stdin.readSync(b);console.log(b)')"
|
||||
}
|
||||
}
|
8
tests/specs/task/post/__test__.jsonc
Normal file
8
tests/specs/task/post/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task test",
|
||||
"output": "bin.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 0
|
||||
}
|
8
tests/specs/task/post_only/__test__.jsonc
Normal file
8
tests/specs/task/post_only/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task test",
|
||||
"output": "bin.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 1
|
||||
}
|
8
tests/specs/task/pre/__test__.jsonc
Normal file
8
tests/specs/task/pre/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task test",
|
||||
"output": "bin.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 0
|
||||
}
|
8
tests/specs/task/pre_only/__test__.jsonc
Normal file
8
tests/specs/task/pre_only/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task test",
|
||||
"output": "bin.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 1
|
||||
}
|
8
tests/specs/task/pre_post/__test__.jsonc
Normal file
8
tests/specs/task/pre_post/__test__.jsonc
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"args": "task test",
|
||||
"output": "bin.out",
|
||||
"envs": {
|
||||
"NO_COLOR": "1"
|
||||
},
|
||||
"exitCode": 0
|
||||
}
|
0
tests/testdata/task/both/echo.out
vendored
0
tests/testdata/task/both/echo.out
vendored
1
tests/testdata/task/deno_json/task_cwd.out
vendored
1
tests/testdata/task/deno_json/task_cwd.out
vendored
|
@ -1 +0,0 @@
|
|||
[WILDCARD]tests
|
|
@ -1 +0,0 @@
|
|||
[WILDCARD]testdata
|
|
@ -1 +0,0 @@
|
|||
0
|
|
@ -1 +0,0 @@
|
|||
0
|
|
@ -1 +0,0 @@
|
|||
0
|
|
@ -1 +0,0 @@
|
|||
0
|
|
@ -1 +0,0 @@
|
|||
1
|
|
@ -1 +0,0 @@
|
|||
0
|
|
@ -222,7 +222,7 @@ async function ensureNoNewITests() {
|
|||
"repl_tests.rs": 0,
|
||||
"run_tests.rs": 338,
|
||||
"shared_library_tests.rs": 0,
|
||||
"task_tests.rs": 30,
|
||||
"task_tests.rs": 4,
|
||||
"test_tests.rs": 74,
|
||||
"upgrade_tests.rs": 0,
|
||||
"vendor_tests.rs": 1,
|
||||
|
|
Loading…
Reference in a new issue