mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
test: fix flaky compat tests (#13921)
This commit is contained in:
parent
5ebaa7943a
commit
1a764790f2
1 changed files with 12 additions and 2 deletions
|
@ -50,18 +50,21 @@ itest!(import_esm_from_cjs {
|
||||||
args:
|
args:
|
||||||
"run --compat --unstable -A --quiet compat/import_esm_from_cjs/index.js",
|
"run --compat --unstable -A --quiet compat/import_esm_from_cjs/index.js",
|
||||||
output_str: Some("function\n"),
|
output_str: Some("function\n"),
|
||||||
|
envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())],
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(test_runner_cjs {
|
itest!(test_runner_cjs {
|
||||||
args: "test --compat --unstable -A --quiet compat/test_runner/cjs.js",
|
args: "test --compat --unstable -A --quiet compat/test_runner/cjs.js",
|
||||||
exit_code: 1,
|
exit_code: 1,
|
||||||
output: "compat/test_runner/cjs.out",
|
output: "compat/test_runner/cjs.out",
|
||||||
|
envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())],
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(test_runner_esm {
|
itest!(test_runner_esm {
|
||||||
args: "test --compat --unstable -A --quiet compat/test_runner/esm.mjs",
|
args: "test --compat --unstable -A --quiet compat/test_runner/esm.mjs",
|
||||||
exit_code: 1,
|
exit_code: 1,
|
||||||
output: "compat/test_runner/esm.out",
|
output: "compat/test_runner/esm.out",
|
||||||
|
envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())],
|
||||||
});
|
});
|
||||||
|
|
||||||
// Top level assertion test mostly just make sure that the test runner finishes correctly on compat mode
|
// Top level assertion test mostly just make sure that the test runner finishes correctly on compat mode
|
||||||
|
@ -70,41 +73,48 @@ itest!(top_level_assertion_cjs {
|
||||||
args: "test --compat --unstable -A --quiet compat/test_runner/top_level_assertion_cjs.js",
|
args: "test --compat --unstable -A --quiet compat/test_runner/top_level_assertion_cjs.js",
|
||||||
exit_code: 0,
|
exit_code: 0,
|
||||||
output: "compat/test_runner/top_level_assertion_cjs.out",
|
output: "compat/test_runner/top_level_assertion_cjs.out",
|
||||||
|
envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())],
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(top_level_assertion_esm {
|
itest!(top_level_assertion_esm {
|
||||||
args: "test --compat --unstable -A --quiet compat/test_runner/top_level_assertion_esm.mjs",
|
args: "test --compat --unstable -A --quiet compat/test_runner/top_level_assertion_esm.mjs",
|
||||||
exit_code: 0,
|
exit_code: 0,
|
||||||
output: "compat/test_runner/top_level_assertion_esm.out",
|
output: "compat/test_runner/top_level_assertion_esm.out",
|
||||||
|
envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())],
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(top_level_fail_cjs {
|
itest!(top_level_fail_cjs {
|
||||||
args: "test --compat --unstable -A --quiet compat/test_runner/top_level_fail_cjs.js",
|
args: "test --compat --unstable -A --quiet compat/test_runner/top_level_fail_cjs.js",
|
||||||
exit_code: 1,
|
exit_code: 1,
|
||||||
output: "compat/test_runner/top_level_fail_cjs.out",
|
output: "compat/test_runner/top_level_fail_cjs.out",
|
||||||
|
envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())],
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(top_level_fail_esm {
|
itest!(top_level_fail_esm {
|
||||||
args: "test --compat --unstable -A --quiet compat/test_runner/top_level_fail_esm.mjs",
|
args: "test --compat --unstable -A --quiet compat/test_runner/top_level_fail_esm.mjs",
|
||||||
exit_code: 1,
|
exit_code: 1,
|
||||||
output: "compat/test_runner/top_level_fail_esm.out",
|
output: "compat/test_runner/top_level_fail_esm.out",
|
||||||
|
envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())],
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(compat_worker {
|
itest!(compat_worker {
|
||||||
args: "run --compat --unstable -A --quiet --no-check compat/worker/worker_test.mjs",
|
args: "run --compat --unstable -A --quiet --no-check compat/worker/worker_test.mjs",
|
||||||
output: "compat/worker/worker_test.out",
|
output: "compat/worker/worker_test.out",
|
||||||
|
envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())],
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(cjs_esm_interop {
|
itest!(cjs_esm_interop {
|
||||||
args:
|
args:
|
||||||
"run --compat --unstable -A --quiet --no-check compat/import_cjs_from_esm/main.mjs",
|
"run --compat --unstable -A --quiet --no-check compat/import_cjs_from_esm/main.mjs",
|
||||||
output: "compat/import_cjs_from_esm.out",
|
output: "compat/import_cjs_from_esm.out",
|
||||||
|
envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())],
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(cjs_esm_interop_dynamic {
|
itest!(cjs_esm_interop_dynamic {
|
||||||
args:
|
args:
|
||||||
"run --compat --unstable -A --quiet --no-check compat/import_cjs_from_esm/main_dynamic.mjs",
|
"run --compat --unstable -A --quiet --no-check compat/import_cjs_from_esm/main_dynamic.mjs",
|
||||||
output: "compat/import_cjs_from_esm.out",
|
output: "compat/import_cjs_from_esm.out",
|
||||||
|
envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())],
|
||||||
});
|
});
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -127,7 +137,7 @@ fn require_in_repl() {
|
||||||
Some(vec![
|
Some(vec![
|
||||||
"const foo = require('./compat/import_esm_from_cjs/index');",
|
"const foo = require('./compat/import_esm_from_cjs/index');",
|
||||||
]),
|
]),
|
||||||
None,
|
Some(vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())]),
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
assert!(out.contains("function"));
|
assert!(out.contains("function"));
|
||||||
|
@ -156,7 +166,7 @@ fn native_modules_as_global_vars() {
|
||||||
true,
|
true,
|
||||||
vec!["repl", "--compat", "--unstable", "--quiet"],
|
vec!["repl", "--compat", "--unstable", "--quiet"],
|
||||||
Some(vec!["if(cluster && v8 && sys) { true } else { false }"]),
|
Some(vec!["if(cluster && v8 && sys) { true } else { false }"]),
|
||||||
None,
|
Some(vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())]),
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
assert!(out.contains("true"));
|
assert!(out.contains("true"));
|
||||||
|
|
Loading…
Reference in a new issue