2019-09-10 11:09:54 -04:00
|
|
|
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
2019-09-16 21:05:14 -04:00
|
|
|
#[macro_use]
|
2019-09-19 14:48:05 -04:00
|
|
|
extern crate lazy_static;
|
|
|
|
extern crate tempfile;
|
|
|
|
mod util;
|
|
|
|
use util::*;
|
2019-09-16 21:05:14 -04:00
|
|
|
|
2019-09-19 14:48:05 -04:00
|
|
|
#[test]
|
|
|
|
fn benchmark_test() {
|
|
|
|
run_python_script("tools/benchmark_test.py")
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn deno_dir_test() {
|
|
|
|
let g = http_server();
|
|
|
|
run_python_script("tools/deno_dir_test.py");
|
|
|
|
drop(g);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO(#2933): Rewrite this test in rust.
|
|
|
|
#[test]
|
|
|
|
fn fetch_test() {
|
|
|
|
let g = http_server();
|
|
|
|
run_python_script("tools/fetch_test.py");
|
|
|
|
drop(g);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO(#2933): Rewrite this test in rust.
|
|
|
|
#[test]
|
|
|
|
fn fmt_test() {
|
|
|
|
let g = http_server();
|
|
|
|
run_python_script("tools/fmt_test.py");
|
|
|
|
drop(g);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn js_unit_tests() {
|
|
|
|
let g = http_server();
|
|
|
|
let mut deno = deno_cmd()
|
|
|
|
.current_dir(root_path())
|
|
|
|
.arg("run")
|
|
|
|
.arg("--reload")
|
|
|
|
.arg("--allow-run")
|
|
|
|
.arg("--allow-env")
|
2019-10-04 20:28:51 -04:00
|
|
|
.arg("cli/js/unit_test_runner.ts")
|
2019-09-19 14:48:05 -04:00
|
|
|
.spawn()
|
|
|
|
.expect("failed to spawn script");
|
|
|
|
let status = deno.wait().expect("failed to wait for the child process");
|
|
|
|
assert_eq!(Some(0), status.code());
|
|
|
|
assert!(status.success());
|
|
|
|
drop(g);
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO(#2933): Rewrite this test in rust.
|
|
|
|
#[test]
|
|
|
|
fn repl_test() {
|
|
|
|
run_python_script("tools/repl_test.py")
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn setup_test() {
|
|
|
|
run_python_script("tools/setup_test.py")
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn target_test() {
|
|
|
|
run_python_script("tools/target_test.py")
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn util_test() {
|
|
|
|
run_python_script("tools/util_test.py")
|
|
|
|
}
|
2019-09-10 11:09:54 -04:00
|
|
|
|
|
|
|
macro_rules! itest(
|
|
|
|
($name:ident {$( $key:ident: $value:expr,)*}) => {
|
|
|
|
#[test]
|
|
|
|
fn $name() {
|
2019-09-19 14:48:05 -04:00
|
|
|
(CheckOutputIntegrationTest {
|
2019-09-10 11:09:54 -04:00
|
|
|
$(
|
|
|
|
$key: $value,
|
|
|
|
)*
|
|
|
|
.. Default::default()
|
|
|
|
}).run()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
itest!(_001_hello {
|
|
|
|
args: "run --reload 001_hello.js",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "001_hello.js.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_002_hello {
|
|
|
|
args: "run --reload 002_hello.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "002_hello.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_003_relative_import {
|
|
|
|
args: "run --reload 003_relative_import.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "003_relative_import.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_004_set_timeout {
|
|
|
|
args: "run --reload 004_set_timeout.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "004_set_timeout.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_005_more_imports {
|
|
|
|
args: "run --reload 005_more_imports.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "005_more_imports.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_006_url_imports {
|
|
|
|
args: "run --reload 006_url_imports.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "006_url_imports.ts.out",
|
|
|
|
http_server: true,
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_012_async {
|
|
|
|
args: "run --reload 012_async.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "012_async.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_013_dynamic_import {
|
|
|
|
args: "013_dynamic_import.ts --reload --allow-read",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "013_dynamic_import.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_014_duplicate_import {
|
|
|
|
args: "014_duplicate_import.ts --reload --allow-read",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "014_duplicate_import.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_015_duplicate_parallel_import {
|
|
|
|
args: "015_duplicate_parallel_import.js --reload --allow-read",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "015_duplicate_parallel_import.js.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_016_double_await {
|
|
|
|
args: "run --allow-read --reload 016_double_await.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "016_double_await.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_017_import_redirect {
|
|
|
|
args: "run --reload 017_import_redirect.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "017_import_redirect.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_018_async_catch {
|
|
|
|
args: "run --reload 018_async_catch.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "018_async_catch.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_019_media_types {
|
|
|
|
args: "run --reload 019_media_types.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "019_media_types.ts.out",
|
|
|
|
http_server: true,
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_020_json_modules {
|
|
|
|
args: "run --reload 020_json_modules.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "020_json_modules.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_021_mjs_modules {
|
|
|
|
args: "run --reload 021_mjs_modules.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "021_mjs_modules.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_022_info_flag_script {
|
2019-09-19 14:48:05 -04:00
|
|
|
args: "info http://127.0.0.1:4545/cli/tests/019_media_types.ts",
|
|
|
|
output: "022_info_flag_script.out",
|
|
|
|
http_server: true,
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_023_no_ext_with_headers {
|
|
|
|
args: "run --reload 023_no_ext_with_headers",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "023_no_ext_with_headers.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
// FIXME(bartlomieju): this test should use remote file
|
|
|
|
// itest!(_024_import_no_ext_with_headers {
|
|
|
|
// args: "run --reload 024_import_no_ext_with_headers.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
// output: "024_import_no_ext_with_headers.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
// });
|
|
|
|
|
|
|
|
itest!(_025_hrtime {
|
|
|
|
args: "run --allow-hrtime --reload 025_hrtime.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "025_hrtime.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_025_reload_js_type_error {
|
|
|
|
args: "run --reload 025_reload_js_type_error.js",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "025_reload_js_type_error.js.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_026_redirect_javascript {
|
|
|
|
args: "run --reload 026_redirect_javascript.js",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "026_redirect_javascript.js.out",
|
|
|
|
http_server: true,
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_026_workers {
|
|
|
|
args: "run --reload 026_workers.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "026_workers.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_027_redirect_typescript {
|
|
|
|
args: "run --reload 027_redirect_typescript.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "027_redirect_typescript.ts.out",
|
|
|
|
http_server: true,
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_028_args {
|
|
|
|
args: "run --reload 028_args.ts --arg1 val1 --arg2=val2 -- arg3 arg4",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "028_args.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_029_eval {
|
|
|
|
args: "eval console.log(\"hello\")",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "029_eval.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_030_xeval {
|
|
|
|
args: "xeval console.log($.toUpperCase())",
|
|
|
|
input: Some("a\nb\n\nc"),
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "030_xeval.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_031_xeval_replvar {
|
|
|
|
args: "xeval -I val console.log(val.toUpperCase());",
|
|
|
|
input: Some("a\nb\n\nc"),
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "031_xeval_replvar.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_032_xeval_delim {
|
|
|
|
args: "xeval -d DELIM console.log($.toUpperCase());",
|
|
|
|
input: Some("aDELIMbDELIMDELIMc"),
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "032_xeval_delim.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_033_import_map {
|
|
|
|
args:
|
|
|
|
"run --reload --importmap=importmaps/import_map.json importmaps/test.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "033_import_map.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_034_onload {
|
|
|
|
args: "run --reload 034_onload/main.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "034_onload.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_035_no_fetch_flag {
|
2019-09-19 14:48:05 -04:00
|
|
|
args:
|
|
|
|
"--reload --no-fetch http://127.0.0.1:4545/cli/tests/019_media_types.ts",
|
|
|
|
output: "035_no_fetch_flag.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
exit_code: 1,
|
|
|
|
check_stderr: true,
|
2019-09-19 14:48:05 -04:00
|
|
|
http_server: true,
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_036_import_map_fetch {
|
|
|
|
args:
|
|
|
|
"fetch --reload --importmap=importmaps/import_map.json importmaps/test.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "036_import_map_fetch.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_037_current_thread {
|
|
|
|
args: "run --current-thread --reload 034_onload/main.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "034_onload.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_038_checkjs {
|
|
|
|
// checking if JS file is run through TS compiler
|
|
|
|
args: "run --reload --config 038_checkjs.tsconfig.json 038_checkjs.js",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "038_checkjs.js.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_039_worker_deno_ns {
|
|
|
|
args: "run --reload 039_worker_deno_ns.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "039_worker_deno_ns.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_040_worker_blob {
|
|
|
|
args: "run --reload 040_worker_blob.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "040_worker_blob.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_041_dyn_import_eval {
|
|
|
|
args: "eval import('./subdir/mod4.js').then(console.log)",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "041_dyn_import_eval.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_041_info_flag {
|
|
|
|
args: "info",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "041_info_flag.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_042_dyn_import_evalcontext {
|
|
|
|
args: "run --allow-read --reload 042_dyn_import_evalcontext.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "042_dyn_import_evalcontext.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
2019-09-24 10:46:57 -04:00
|
|
|
itest!(_044_bad_resource {
|
|
|
|
args: "run --reload --allow-read 044_bad_resource.ts",
|
|
|
|
output: "044_bad_resource.ts.out",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
|
|
|
});
|
|
|
|
|
2019-09-24 18:52:01 -04:00
|
|
|
itest!(_045_proxy {
|
|
|
|
args: "run --allow-net --allow-env --allow-run --reload 045_proxy_test.ts",
|
|
|
|
output: "045_proxy_test.ts.out",
|
|
|
|
});
|
|
|
|
|
2019-10-02 10:46:36 -04:00
|
|
|
itest!(_046_tsx {
|
|
|
|
args: "run --reload 046_jsx_test.tsx",
|
|
|
|
output: "046_jsx_test.tsx.out",
|
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_047_jsx {
|
|
|
|
args: "run --reload 047_jsx_test.jsx",
|
|
|
|
output: "047_jsx_test.jsx.out",
|
|
|
|
});
|
|
|
|
|
2019-10-16 13:35:04 -04:00
|
|
|
itest!(_048_media_types_jsx {
|
|
|
|
args: "run --reload 048_media_types_jsx.ts",
|
|
|
|
output: "048_media_types_jsx.ts.out",
|
|
|
|
http_server: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
itest!(_049_info_flag_script_jsx {
|
|
|
|
args: "info http://127.0.0.1:4545/cli/tests/048_media_types_jsx.ts",
|
|
|
|
output: "049_info_flag_script_jsx.out",
|
|
|
|
http_server: true,
|
|
|
|
});
|
|
|
|
|
2019-09-10 11:09:54 -04:00
|
|
|
itest!(async_error {
|
|
|
|
exit_code: 1,
|
|
|
|
args: "run --reload async_error.ts",
|
|
|
|
check_stderr: true,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "async_error.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(circular1 {
|
|
|
|
args: "run --reload circular1.js",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "circular1.js.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(config {
|
|
|
|
args: "run --reload --config config.tsconfig.json config.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "config.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_001 {
|
|
|
|
args: "run --reload error_001.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_001.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_002 {
|
|
|
|
args: "run --reload error_002.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_002.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_003_typescript {
|
|
|
|
args: "run --reload error_003_typescript.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_003_typescript.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
// Supposing that we've already attempted to run error_003_typescript.ts
|
|
|
|
// we want to make sure that JS wasn't emitted. Running again without reload flag
|
|
|
|
// should result in the same output.
|
|
|
|
// https://github.com/denoland/deno/issues/2436
|
|
|
|
itest!(error_003_typescript2 {
|
|
|
|
args: "run error_003_typescript.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_003_typescript.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_004_missing_module {
|
|
|
|
args: "run --reload error_004_missing_module.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_004_missing_module.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_005_missing_dynamic_import {
|
|
|
|
args: "run --reload error_005_missing_dynamic_import.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_005_missing_dynamic_import.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_006_import_ext_failure {
|
|
|
|
args: "run --reload error_006_import_ext_failure.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_006_import_ext_failure.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_007_any {
|
|
|
|
args: "run --reload error_007_any.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_007_any.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_008_checkjs {
|
|
|
|
args: "run --reload error_008_checkjs.js",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_008_checkjs.js.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_011_bad_module_specifier {
|
|
|
|
args: "run --reload error_011_bad_module_specifier.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_011_bad_module_specifier.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_012_bad_dynamic_import_specifier {
|
|
|
|
args: "run --reload error_012_bad_dynamic_import_specifier.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_012_bad_dynamic_import_specifier.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_013_missing_script {
|
|
|
|
args: "run --reload missing_file_name",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_013_missing_script.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_014_catch_dynamic_import_error {
|
|
|
|
args: "error_014_catch_dynamic_import_error.js --reload --allow-read",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_014_catch_dynamic_import_error.js.out",
|
2019-09-24 18:37:04 -04:00
|
|
|
exit_code: 1,
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_015_dynamic_import_permissions {
|
|
|
|
args: "--reload --no-prompt error_015_dynamic_import_permissions.js",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_015_dynamic_import_permissions.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
http_server: true,
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
// We have an allow-net flag but not allow-read, it should still result in error.
|
|
|
|
itest!(error_016_dynamic_import_permissions2 {
|
|
|
|
args:
|
|
|
|
"--no-prompt --reload --allow-net error_016_dynamic_import_permissions2.js",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_016_dynamic_import_permissions2.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
http_server: true,
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_stack {
|
|
|
|
args: "run --reload error_stack.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_stack.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_syntax {
|
|
|
|
args: "run --reload error_syntax.js",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_syntax.js.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(error_type_definitions {
|
|
|
|
args: "run --reload error_type_definitions.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "error_type_definitions.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
2019-09-25 10:46:58 -04:00
|
|
|
itest!(error_worker_dynamic {
|
|
|
|
args: "run --reload error_worker_dynamic.ts",
|
|
|
|
check_stderr: true,
|
|
|
|
exit_code: 1,
|
|
|
|
output: "error_worker_dynamic.ts.out",
|
|
|
|
});
|
|
|
|
|
2019-09-10 11:09:54 -04:00
|
|
|
itest!(exit_error42 {
|
|
|
|
exit_code: 42,
|
|
|
|
args: "run --reload exit_error42.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "exit_error42.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(https_import {
|
|
|
|
args: "run --reload https_import.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "https_import.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(if_main {
|
|
|
|
args: "run --reload if_main.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "if_main.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(import_meta {
|
|
|
|
args: "run --reload import_meta.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "import_meta.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(seed_random {
|
|
|
|
args: "run --seed=100 seed_random.js",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "seed_random.js.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(type_definitions {
|
|
|
|
args: "run --reload type_definitions.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "type_definitions.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(types {
|
|
|
|
args: "types",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "types.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(unbuffered_stderr {
|
|
|
|
args: "run --reload unbuffered_stderr.ts",
|
|
|
|
check_stderr: true,
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "unbuffered_stderr.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(unbuffered_stdout {
|
|
|
|
args: "run --reload unbuffered_stdout.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "unbuffered_stdout.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(v8_flags {
|
|
|
|
args: "run --v8-flags=--expose-gc v8_flags.js",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "v8_flags.js.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(v8_help {
|
|
|
|
args: "--v8-options",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "v8_help.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(version {
|
|
|
|
args: "version",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "version.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(version_long_flag {
|
|
|
|
args: "--version",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "version.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(version_short_flag {
|
|
|
|
args: "-v",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "version.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(wasm {
|
|
|
|
args: "run wasm.ts",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "wasm.ts.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
itest!(wasm_async {
|
|
|
|
args: "wasm_async.js",
|
2019-09-19 14:48:05 -04:00
|
|
|
output: "wasm_async.out",
|
2019-09-10 11:09:54 -04:00
|
|
|
});
|
2019-09-24 18:37:04 -04:00
|
|
|
|
|
|
|
itest!(top_level_await {
|
|
|
|
args: "--allow-read top_level_await.js",
|
|
|
|
output: "top_level_await.out",
|
|
|
|
});
|
2019-09-30 12:38:23 -04:00
|
|
|
|
|
|
|
itest!(top_level_await_ts {
|
|
|
|
args: "--allow-read top_level_await.ts",
|
|
|
|
output: "top_level_await.out",
|
|
|
|
});
|