mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
chore: deprecate test itests (#25512)
This PR is part of #22907 --------- Signed-off-by: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
6ce16145dd
commit
e0b9c745c1
335 changed files with 1850 additions and 1410 deletions
|
@ -56,7 +56,6 @@
|
|||
"tests/testdata/run/byte_order_mark.ts",
|
||||
"tests/testdata/run/error_syntax_empty_trailing_line.mjs",
|
||||
"tests/testdata/run/inline_js_source_map*",
|
||||
"tests/testdata/test/glob/",
|
||||
"tests/testdata/test/markdown_windows.md",
|
||||
"tests/util/std",
|
||||
"tests/wpt/runner/expectation.json",
|
||||
|
|
|
@ -1,324 +1,12 @@
|
|||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
use deno_core::serde_json::json;
|
||||
use deno_core::url::Url;
|
||||
use test_util as util;
|
||||
use test_util::itest;
|
||||
use util::assert_contains;
|
||||
use util::assert_not_contains;
|
||||
use util::wildcard_match;
|
||||
use util::TestContext;
|
||||
use util::TestContextBuilder;
|
||||
|
||||
#[test]
|
||||
fn no_color() {
|
||||
let (out, _) = util::run_and_collect_output(
|
||||
false,
|
||||
"test test/no_color.ts",
|
||||
None,
|
||||
Some(vec![("NO_COLOR".to_owned(), "true".to_owned())]),
|
||||
false,
|
||||
);
|
||||
// ANSI escape codes should be stripped.
|
||||
assert!(out.contains("success ... ok"));
|
||||
assert!(out.contains("fail ... FAILED"));
|
||||
assert!(out.contains("ignored ... ignored"));
|
||||
assert!(out.contains("FAILED | 1 passed | 1 failed | 1 ignored"));
|
||||
}
|
||||
|
||||
itest!(overloads {
|
||||
args: "test test/overloads.ts",
|
||||
exit_code: 0,
|
||||
output: "test/overloads.out",
|
||||
});
|
||||
|
||||
itest!(meta {
|
||||
args: "test test/meta.ts",
|
||||
exit_code: 0,
|
||||
output: "test/meta.out",
|
||||
});
|
||||
|
||||
itest!(pass {
|
||||
args: "test test/pass.ts",
|
||||
exit_code: 0,
|
||||
output: "test/pass.out",
|
||||
});
|
||||
|
||||
itest!(ignore {
|
||||
args: "test test/ignore.ts",
|
||||
exit_code: 0,
|
||||
output: "test/ignore.out",
|
||||
});
|
||||
|
||||
itest!(ignore_permissions {
|
||||
args: "test test/ignore_permissions.ts",
|
||||
exit_code: 0,
|
||||
output: "test/ignore_permissions.out",
|
||||
});
|
||||
|
||||
itest!(fail {
|
||||
args: "test test/fail.ts",
|
||||
exit_code: 1,
|
||||
output: "test/fail.out",
|
||||
});
|
||||
|
||||
// GHA CI seems to have a problem with Emoji
|
||||
// https://github.com/denoland/deno/pull/23200#issuecomment-2134032695
|
||||
#[test]
|
||||
fn fail_with_contain_unicode_filename() {
|
||||
let context = TestContextBuilder::new().use_temp_cwd().build();
|
||||
let temp_dir = context.temp_dir();
|
||||
temp_dir.write(
|
||||
"fail_with_contain_unicode_filename🦕.ts",
|
||||
"Deno.test(\"test 0\", () => {
|
||||
throw new Error();
|
||||
});
|
||||
",
|
||||
);
|
||||
let output = context
|
||||
.new_command()
|
||||
.args("test fail_with_contain_unicode_filename🦕.ts")
|
||||
.run();
|
||||
output.skip_output_check();
|
||||
output.assert_exit_code(1);
|
||||
output.assert_matches_text(
|
||||
"Check [WILDCARD]/fail_with_contain_unicode_filename🦕.ts
|
||||
running 1 test from ./fail_with_contain_unicode_filename🦕.ts
|
||||
test 0 ... FAILED ([WILDCARD])
|
||||
|
||||
ERRORS
|
||||
|
||||
test 0 => ./fail_with_contain_unicode_filename🦕.ts:[WILDCARD]
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/fail_with_contain_unicode_filename🦕.ts:[WILDCARD]
|
||||
|
||||
FAILURES
|
||||
|
||||
test 0 => ./fail_with_contain_unicode_filename🦕.ts:[WILDCARD]
|
||||
|
||||
FAILED | 0 passed | 1 failed ([WILDCARD])
|
||||
|
||||
error: Test failed
|
||||
",
|
||||
);
|
||||
}
|
||||
|
||||
itest!(collect {
|
||||
args: "test --ignore=test/collect/ignore test/collect",
|
||||
exit_code: 0,
|
||||
output: "test/collect.out",
|
||||
});
|
||||
|
||||
itest!(test_with_config {
|
||||
args: "test --config test/collect/deno.jsonc test/collect",
|
||||
exit_code: 0,
|
||||
output: "test/collect.out",
|
||||
});
|
||||
|
||||
itest!(test_with_config2 {
|
||||
args: "test --config test/collect/deno2.jsonc test/collect",
|
||||
exit_code: 0,
|
||||
output: "test/collect2.out",
|
||||
});
|
||||
|
||||
itest!(test_with_malformed_config {
|
||||
args: "test --config test/collect/deno.malformed.jsonc",
|
||||
exit_code: 1,
|
||||
output: "test/collect_with_malformed_config.out",
|
||||
});
|
||||
|
||||
itest!(test_filtered_out_only {
|
||||
args: "test --quiet --filter foo test/filtered_out_only.ts",
|
||||
output: "test/filtered_out_only.out",
|
||||
});
|
||||
|
||||
itest!(parallel_flag {
|
||||
args: "test test/short-pass.ts --parallel",
|
||||
exit_code: 0,
|
||||
output: "test/short-pass.out",
|
||||
});
|
||||
|
||||
itest!(parallel_flag_with_env_variable {
|
||||
args: "test test/short-pass.ts --parallel",
|
||||
envs: vec![("DENO_JOBS".to_owned(), "2".to_owned())],
|
||||
exit_code: 0,
|
||||
output: "test/short-pass.out",
|
||||
});
|
||||
|
||||
itest!(load_unload {
|
||||
args: "test test/load_unload.ts",
|
||||
exit_code: 0,
|
||||
output: "test/load_unload.out",
|
||||
});
|
||||
|
||||
itest!(interval {
|
||||
args: "test test/interval.ts",
|
||||
exit_code: 0,
|
||||
output: "test/interval.out",
|
||||
});
|
||||
|
||||
itest!(doc {
|
||||
args: "test --doc --allow-all test/doc.ts",
|
||||
exit_code: 1,
|
||||
output: "test/doc.out",
|
||||
});
|
||||
|
||||
itest!(doc_only {
|
||||
args: "test --doc --allow-all test/doc_only",
|
||||
exit_code: 0,
|
||||
output: "test/doc_only.out",
|
||||
});
|
||||
|
||||
itest!(markdown {
|
||||
args: "test --doc --allow-all test/markdown.md",
|
||||
exit_code: 1,
|
||||
output: "test/markdown.out",
|
||||
});
|
||||
|
||||
itest!(markdown_windows {
|
||||
args: "test --doc --allow-all test/markdown_windows.md",
|
||||
exit_code: 1,
|
||||
output: "test/markdown_windows.out",
|
||||
});
|
||||
|
||||
itest!(markdown_full_block_names {
|
||||
args: "test --doc --allow-all test/markdown_full_block_names.md",
|
||||
exit_code: 1,
|
||||
output: "test/markdown_full_block_names.out",
|
||||
});
|
||||
|
||||
itest!(markdown_ignore_html_comment {
|
||||
args: "test --doc --allow-all test/markdown_with_comment.md",
|
||||
exit_code: 1,
|
||||
output: "test/markdown_with_comment.out",
|
||||
});
|
||||
|
||||
itest!(text {
|
||||
args: "test --doc --allow-all test/text.md",
|
||||
exit_code: 0,
|
||||
output: "test/text.out",
|
||||
});
|
||||
|
||||
itest!(quiet {
|
||||
args: "test --quiet test/quiet.ts",
|
||||
exit_code: 0,
|
||||
output: "test/quiet.out",
|
||||
});
|
||||
|
||||
itest!(fail_fast {
|
||||
args: "test --fail-fast test/fail_fast.ts test/fail_fast_other.ts",
|
||||
exit_code: 1,
|
||||
output: "test/fail_fast.out",
|
||||
});
|
||||
|
||||
itest!(only {
|
||||
args: "test test/only.ts",
|
||||
exit_code: 1,
|
||||
output: "test/only.out",
|
||||
});
|
||||
|
||||
itest!(no_check {
|
||||
args: "test --no-check test/no_check.ts",
|
||||
exit_code: 1,
|
||||
output: "test/no_check.out",
|
||||
});
|
||||
|
||||
itest!(no_run {
|
||||
args: "test --no-run test/no_run.ts",
|
||||
output: "test/no_run.out",
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(allow_all {
|
||||
args: "test --config ../config/deno.json --allow-all test/allow_all.ts",
|
||||
exit_code: 0,
|
||||
output: "test/allow_all.out",
|
||||
});
|
||||
|
||||
itest!(allow_none {
|
||||
args: "test --config ../config/deno.json test/allow_none.ts",
|
||||
exit_code: 1,
|
||||
output: "test/allow_none.out",
|
||||
});
|
||||
|
||||
itest!(ops_sanitizer_unstable {
|
||||
args: "test --trace-leaks test/sanitizer/ops_sanitizer_unstable.ts",
|
||||
exit_code: 1,
|
||||
output: "test/sanitizer/ops_sanitizer_unstable.out",
|
||||
});
|
||||
|
||||
itest!(ops_sanitizer_timeout_failure {
|
||||
args: "test test/sanitizer/ops_sanitizer_timeout_failure.ts",
|
||||
output: "test/sanitizer/ops_sanitizer_timeout_failure.out",
|
||||
});
|
||||
|
||||
itest!(ops_sanitizer_multiple_timeout_tests {
|
||||
args:
|
||||
"test --trace-leaks test/sanitizer/ops_sanitizer_multiple_timeout_tests.ts",
|
||||
exit_code: 1,
|
||||
output: "test/sanitizer/ops_sanitizer_multiple_timeout_tests.out",
|
||||
});
|
||||
|
||||
itest!(ops_sanitizer_multiple_timeout_tests_no_trace {
|
||||
args: "test test/sanitizer/ops_sanitizer_multiple_timeout_tests.ts",
|
||||
exit_code: 1,
|
||||
output: "test/sanitizer/ops_sanitizer_multiple_timeout_tests_no_trace.out",
|
||||
});
|
||||
|
||||
itest!(sanitizer_trace_ops_catch_error {
|
||||
args: "test -A --trace-leaks test/sanitizer/trace_ops_caught_error/main.ts",
|
||||
exit_code: 0,
|
||||
output: "test/sanitizer/trace_ops_caught_error/main.out",
|
||||
});
|
||||
|
||||
itest!(ops_sanitizer_closed_inside_started_before {
|
||||
args: "test --trace-leaks test/sanitizer/ops_sanitizer_closed_inside_started_before.ts",
|
||||
exit_code: 1,
|
||||
output: "test/sanitizer/ops_sanitizer_closed_inside_started_before.out",
|
||||
});
|
||||
|
||||
itest!(ops_sanitizer_nexttick {
|
||||
args: "test --no-check test/sanitizer/ops_sanitizer_nexttick.ts",
|
||||
output: "test/sanitizer/ops_sanitizer_nexttick.out",
|
||||
});
|
||||
|
||||
itest!(resource_sanitizer {
|
||||
args: "test --allow-read test/sanitizer/resource_sanitizer.ts",
|
||||
exit_code: 1,
|
||||
output: "test/sanitizer/resource_sanitizer.out",
|
||||
});
|
||||
|
||||
itest!(ops_sanitizer_tcp {
|
||||
args: "test --allow-net --trace-leaks test/sanitizer/ops_sanitizer_tcp.ts",
|
||||
exit_code: 1,
|
||||
output: "test/sanitizer/ops_sanitizer_tcp.out",
|
||||
});
|
||||
|
||||
itest!(exit_sanitizer {
|
||||
args: "test test/sanitizer/exit_sanitizer.ts",
|
||||
output: "test/sanitizer/exit_sanitizer.out",
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(junit {
|
||||
args: "test --reporter junit test/pass.ts",
|
||||
output: "test/pass.junit.out",
|
||||
});
|
||||
|
||||
itest!(junit_nested {
|
||||
args: "test --reporter junit test/nested_failures.ts",
|
||||
output: "test/nested_failures.junit.out",
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(junit_multiple_test_files {
|
||||
args: "test --reporter junit test/pass.ts test/fail.ts",
|
||||
output: "test/junit_multiple_test_files.junit.out",
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn junit_path() {
|
||||
let context = TestContextBuilder::new().use_temp_cwd().build();
|
||||
|
@ -336,245 +24,6 @@ fn junit_path() {
|
|||
.assert_matches_text("<?xml [WILDCARD]");
|
||||
}
|
||||
|
||||
itest!(clear_timeout {
|
||||
args: "test test/clear_timeout.ts",
|
||||
exit_code: 0,
|
||||
output: "test/clear_timeout.out",
|
||||
});
|
||||
|
||||
itest!(hide_empty_suites {
|
||||
args: "test --filter none test/pass.ts",
|
||||
exit_code: 0,
|
||||
output: "test/hide_empty_suites.out",
|
||||
});
|
||||
|
||||
itest!(finally_timeout {
|
||||
args: "test test/finally_timeout.ts",
|
||||
exit_code: 1,
|
||||
output: "test/finally_timeout.out",
|
||||
});
|
||||
|
||||
itest!(unresolved_promise {
|
||||
args: "test test/unresolved_promise.ts",
|
||||
exit_code: 1,
|
||||
output: "test/unresolved_promise.out",
|
||||
});
|
||||
|
||||
itest!(unhandled_rejection {
|
||||
args: "test test/unhandled_rejection.ts",
|
||||
exit_code: 1,
|
||||
output: "test/unhandled_rejection.out",
|
||||
});
|
||||
|
||||
itest!(filter {
|
||||
args: "test --filter=foo test/filter",
|
||||
exit_code: 0,
|
||||
output: "test/filter.out",
|
||||
});
|
||||
|
||||
itest!(shuffle {
|
||||
args: "test --shuffle test/shuffle",
|
||||
exit_code: 0,
|
||||
output_str: Some("[WILDCARD]"),
|
||||
});
|
||||
|
||||
itest!(shuffle_with_seed {
|
||||
args: "test --shuffle=42 test/shuffle",
|
||||
exit_code: 0,
|
||||
output: "test/shuffle.out",
|
||||
});
|
||||
|
||||
itest!(aggregate_error {
|
||||
args: "test --quiet test/aggregate_error.ts",
|
||||
exit_code: 1,
|
||||
output: "test/aggregate_error.out",
|
||||
});
|
||||
|
||||
itest!(steps_passing_steps {
|
||||
args: "test test/steps/passing_steps.ts",
|
||||
exit_code: 0,
|
||||
output: "test/steps/passing_steps.out",
|
||||
});
|
||||
|
||||
itest!(steps_failing_steps {
|
||||
args: "test test/steps/failing_steps.ts",
|
||||
exit_code: 1,
|
||||
output: "test/steps/failing_steps.out",
|
||||
});
|
||||
|
||||
itest!(steps_ignored_steps {
|
||||
args: "test test/steps/ignored_steps.ts",
|
||||
exit_code: 0,
|
||||
output: "test/steps/ignored_steps.out",
|
||||
});
|
||||
|
||||
itest!(steps_dot_passing_steps {
|
||||
args: "test --reporter=dot test/steps/passing_steps.ts",
|
||||
exit_code: 0,
|
||||
output: "test/steps/passing_steps.dot.out",
|
||||
});
|
||||
|
||||
itest!(steps_dot_failing_steps {
|
||||
args: "test --reporter=dot test/steps/failing_steps.ts",
|
||||
exit_code: 1,
|
||||
output: "test/steps/failing_steps.dot.out",
|
||||
});
|
||||
|
||||
itest!(steps_dot_ignored_steps {
|
||||
args: "test --reporter=dot test/steps/ignored_steps.ts",
|
||||
exit_code: 0,
|
||||
output: "test/steps/ignored_steps.dot.out",
|
||||
});
|
||||
|
||||
itest!(steps_tap_passing_steps {
|
||||
args: "test --reporter=tap test/steps/passing_steps.ts",
|
||||
exit_code: 0,
|
||||
output: "test/steps/passing_steps.tap.out",
|
||||
});
|
||||
|
||||
itest!(steps_tap_failing_steps {
|
||||
args: "test --reporter=tap test/steps/failing_steps.ts",
|
||||
exit_code: 1,
|
||||
envs: vec![("NO_COLOR".to_owned(), "1".to_owned())],
|
||||
output: "test/steps/failing_steps.tap.out",
|
||||
});
|
||||
|
||||
itest!(steps_tap_ignored_steps {
|
||||
args: "test --reporter=tap test/steps/ignored_steps.ts",
|
||||
exit_code: 0,
|
||||
output: "test/steps/ignored_steps.tap.out",
|
||||
});
|
||||
|
||||
itest!(steps_invalid_usage {
|
||||
args: "test test/steps/invalid_usage.ts",
|
||||
exit_code: 1,
|
||||
output: "test/steps/invalid_usage.out",
|
||||
});
|
||||
|
||||
itest!(steps_output_within {
|
||||
args: "test test/steps/output_within.ts",
|
||||
exit_code: 0,
|
||||
output: "test/steps/output_within.out",
|
||||
});
|
||||
|
||||
itest!(no_prompt_by_default {
|
||||
args: "test --quiet test/no_prompt_by_default.ts",
|
||||
exit_code: 1,
|
||||
output: "test/no_prompt_by_default.out",
|
||||
});
|
||||
|
||||
itest!(no_prompt_with_denied_perms {
|
||||
args: "test --quiet --allow-read test/no_prompt_with_denied_perms.ts",
|
||||
exit_code: 1,
|
||||
output: "test/no_prompt_with_denied_perms.out",
|
||||
});
|
||||
|
||||
itest!(test_with_custom_jsx {
|
||||
args: "test --quiet --allow-read test/hello_world.ts --config=test/deno_custom_jsx.json",
|
||||
exit_code: 0,
|
||||
output: "test/hello_world.out",
|
||||
});
|
||||
|
||||
itest!(before_unload_prevent_default {
|
||||
args: "test --quiet test/before_unload_prevent_default.ts",
|
||||
output: "test/before_unload_prevent_default.out",
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn captured_output() {
|
||||
let context = TestContext::default();
|
||||
let output = context
|
||||
.new_command()
|
||||
.args("test --allow-run --allow-read test/captured_output.ts")
|
||||
.env("NO_COLOR", "1")
|
||||
.run();
|
||||
|
||||
let output_start = "------- output -------";
|
||||
let output_end = "----- output end -----";
|
||||
output.assert_exit_code(0);
|
||||
let output_text = output.combined_output();
|
||||
let start = output_text.find(output_start).unwrap() + output_start.len();
|
||||
let end = output_text.find(output_end).unwrap();
|
||||
// replace zero width space that may appear in test output due
|
||||
// to test runner output flusher
|
||||
let output_text = output_text[start..end]
|
||||
.replace('\u{200B}', "")
|
||||
.trim()
|
||||
.to_string();
|
||||
let mut lines = output_text.lines().collect::<Vec<_>>();
|
||||
// the output is racy on either stdout or stderr being flushed
|
||||
// from the runtime into the rust code, so sort it... the main
|
||||
// thing here to ensure is that we're capturing the output in
|
||||
// this block on stdout
|
||||
lines.sort_unstable();
|
||||
assert_eq!(lines.join(" "), "0 1 2 3 4 5 6 7 8 9");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn recursive_permissions_pledge() {
|
||||
let context = TestContext::default();
|
||||
let output = context
|
||||
.new_command()
|
||||
.args("test test/recursive_permissions_pledge.js")
|
||||
.run();
|
||||
output.assert_exit_code(1);
|
||||
assert_contains!(
|
||||
output.combined_output(),
|
||||
"pledge test permissions called before restoring previous pledge"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn file_protocol() {
|
||||
let file_url =
|
||||
Url::from_file_path(util::testdata_path().join("test/file_protocol.ts"))
|
||||
.unwrap()
|
||||
.to_string();
|
||||
|
||||
TestContext::default()
|
||||
.new_command()
|
||||
.args_vec(["test", file_url.as_str()])
|
||||
.run()
|
||||
.assert_matches_file("test/file_protocol.out");
|
||||
}
|
||||
|
||||
itest!(uncaught_errors {
|
||||
args: "test --quiet test/uncaught_errors_1.ts test/uncaught_errors_2.ts test/uncaught_errors_3.ts",
|
||||
output: "test/uncaught_errors.out",
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(report_error {
|
||||
args: "test --quiet test/report_error.ts",
|
||||
output: "test/report_error.out",
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(check_local_by_default {
|
||||
args: "test --quiet test/check_local_by_default.ts",
|
||||
output: "test/check_local_by_default.out",
|
||||
http_server: true,
|
||||
});
|
||||
|
||||
itest!(check_local_by_default2 {
|
||||
args: "test --quiet test/check_local_by_default2.ts",
|
||||
output: "test/check_local_by_default2.out",
|
||||
http_server: true,
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(non_error_thrown {
|
||||
args: "test --quiet test/non_error_thrown.ts",
|
||||
output: "test/non_error_thrown.out",
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(parallel_output {
|
||||
args: "test --parallel --reload test/parallel_output.ts",
|
||||
output: "test/parallel_output.out",
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
#[test]
|
||||
// todo(#18480): re-enable
|
||||
#[ignore]
|
||||
|
@ -598,11 +47,6 @@ fn sigint_with_hanging_test() {
|
|||
);
|
||||
}
|
||||
|
||||
itest!(test_replace_timers {
|
||||
args: "test test/replace_timers.js",
|
||||
output: "test/replace_timers.js.out",
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn test_with_glob_config() {
|
||||
let context = TestContextBuilder::new().cwd("test").build();
|
||||
|
@ -674,32 +118,3 @@ fn conditionally_loads_type_graph() {
|
|||
.run();
|
||||
assert_not_contains!(output.combined_output(), "type_reference.d.ts");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn opt_out_top_level_exclude_via_test_unexclude() {
|
||||
let context = TestContextBuilder::new().use_temp_cwd().build();
|
||||
let temp_dir = context.temp_dir().path();
|
||||
temp_dir.join("deno.json").write_json(&json!({
|
||||
"test": {
|
||||
"exclude": [ "!excluded.test.ts" ]
|
||||
},
|
||||
"exclude": [ "excluded.test.ts", "actually_excluded.test.ts" ]
|
||||
}));
|
||||
|
||||
temp_dir
|
||||
.join("main.test.ts")
|
||||
.write("Deno.test('test1', () => {});");
|
||||
temp_dir
|
||||
.join("excluded.test.ts")
|
||||
.write("Deno.test('test2', () => {});");
|
||||
temp_dir
|
||||
.join("actually_excluded.test.ts")
|
||||
.write("Deno.test('test3', () => {});");
|
||||
|
||||
let output = context.new_command().arg("test").run();
|
||||
output.assert_exit_code(0);
|
||||
let output = output.combined_output();
|
||||
assert_contains!(output, "main.test.ts");
|
||||
assert_contains!(output, "excluded.test.ts");
|
||||
assert_not_contains!(output, "actually_excluded.test.ts");
|
||||
}
|
||||
|
|
5
tests/specs/test/aggregate_error/__test__.jsonc
Normal file
5
tests/specs/test/aggregate_error/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --quiet main.ts",
|
||||
"exitCode": 1,
|
||||
"output": "main.out"
|
||||
}
|
22
tests/specs/test/aggregate_error/main.out
Normal file
22
tests/specs/test/aggregate_error/main.out
Normal file
|
@ -0,0 +1,22 @@
|
|||
running 1 test from ./main.ts
|
||||
aggregate ... FAILED ([WILDCARD])
|
||||
|
||||
ERRORS
|
||||
|
||||
aggregate => ./main.ts:[WILDCARD]
|
||||
error: AggregateError
|
||||
Error: Error 1
|
||||
at [WILDCARD]/main.ts:2:18
|
||||
Error: Error 2
|
||||
at [WILDCARD]/main.ts:3:18
|
||||
throw new AggregateError([error1, error2]);
|
||||
^
|
||||
at [WILDCARD]/main.ts:5:9
|
||||
|
||||
FAILURES
|
||||
|
||||
aggregate => ./main.ts:[WILDCARD]
|
||||
|
||||
FAILED | 0 passed | 1 failed ([WILDCARD])
|
||||
|
||||
error: Test failed
|
5
tests/specs/test/allow_all/__test__.jsonc
Normal file
5
tests/specs/test/allow_all/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --config deno.json --allow-all main.ts",
|
||||
"exitCode": 0,
|
||||
"output": "main.out"
|
||||
}
|
4
tests/specs/test/allow_all/deno.json
Normal file
4
tests/specs/test/allow_all/deno.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"lock": false,
|
||||
"importMap": "../../../../import_map.json"
|
||||
}
|
5
tests/specs/test/allow_none/__test__.jsonc
Normal file
5
tests/specs/test/allow_none/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --config deno.json main.ts",
|
||||
"exitCode": 1,
|
||||
"output": "main.out"
|
||||
}
|
4
tests/specs/test/allow_none/deno.json
Normal file
4
tests/specs/test/allow_none/deno.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"lock": false,
|
||||
"importMap": "../../../../import_map.json"
|
||||
}
|
|
@ -9,37 +9,37 @@ ffi ... FAILED [WILDCARD]
|
|||
|
||||
ERRORS
|
||||
|
||||
read => ./test/allow_none.ts:[WILDCARD]
|
||||
read => ./main.ts:[WILDCARD]
|
||||
error: NotCapable: Can't escalate parent thread permissions
|
||||
[WILDCARD]
|
||||
|
||||
write => ./test/allow_none.ts:[WILDCARD]
|
||||
write => ./main.ts:[WILDCARD]
|
||||
error: NotCapable: Can't escalate parent thread permissions
|
||||
[WILDCARD]
|
||||
|
||||
net => ./test/allow_none.ts:[WILDCARD]
|
||||
net => ./main.ts:[WILDCARD]
|
||||
error: NotCapable: Can't escalate parent thread permissions
|
||||
[WILDCARD]
|
||||
|
||||
env => ./test/allow_none.ts:[WILDCARD]
|
||||
env => ./main.ts:[WILDCARD]
|
||||
error: NotCapable: Can't escalate parent thread permissions
|
||||
[WILDCARD]
|
||||
|
||||
run => ./test/allow_none.ts:[WILDCARD]
|
||||
run => ./main.ts:[WILDCARD]
|
||||
error: NotCapable: Can't escalate parent thread permissions
|
||||
[WILDCARD]
|
||||
|
||||
ffi => ./test/allow_none.ts:[WILDCARD]
|
||||
ffi => ./main.ts:[WILDCARD]
|
||||
error: NotCapable: Can't escalate parent thread permissions
|
||||
[WILDCARD]
|
||||
|
||||
FAILURES
|
||||
|
||||
read => ./test/allow_none.ts:[WILDCARD]
|
||||
write => ./test/allow_none.ts:[WILDCARD]
|
||||
net => ./test/allow_none.ts:[WILDCARD]
|
||||
env => ./test/allow_none.ts:[WILDCARD]
|
||||
run => ./test/allow_none.ts:[WILDCARD]
|
||||
ffi => ./test/allow_none.ts:[WILDCARD]
|
||||
read => ./main.ts:[WILDCARD]
|
||||
write => ./main.ts:[WILDCARD]
|
||||
net => ./main.ts:[WILDCARD]
|
||||
env => ./main.ts:[WILDCARD]
|
||||
run => ./main.ts:[WILDCARD]
|
||||
ffi => ./main.ts:[WILDCARD]
|
||||
|
||||
FAILED | 0 passed | 6 failed [WILDCARD]
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"args": "test --quiet main.ts",
|
||||
"output": "main.out"
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
running 1 test from [WILDCARD]/before_unload_prevent_default.ts
|
||||
running 1 test from [WILDCARD]/main.ts
|
||||
foo ... ok ([WILDCARD])
|
||||
|
||||
ok | 1 passed | 0 failed ([WILDCARD])
|
6
tests/specs/test/captured_output/__test__.jsonc
Normal file
6
tests/specs/test/captured_output/__test__.jsonc
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"args": "test --allow-run --allow-read captured_output.ts",
|
||||
"output": "main.out",
|
||||
"envs": { "NO_COLOR": "1" },
|
||||
"exitCode": 0
|
||||
}
|
|
@ -19,7 +19,7 @@ Deno.test("output", async () => {
|
|||
}).spawn();
|
||||
await c.status;
|
||||
const worker = new Worker(
|
||||
import.meta.resolve("./captured_output.worker.js"),
|
||||
import.meta.resolve("./captured_output.worker.ts"),
|
||||
{ type: "module" },
|
||||
);
|
||||
|
22
tests/specs/test/captured_output/main.out
Normal file
22
tests/specs/test/captured_output/main.out
Normal file
|
@ -0,0 +1,22 @@
|
|||
Check [WILDCARD]/captured_output.ts
|
||||
running 1 test from ./captured_output.ts
|
||||
output ...
|
||||
------- output -------
|
||||
[UNORDERED_START]
|
||||
1
|
||||
0
|
||||
3
|
||||
2
|
||||
5
|
||||
4
|
||||
7
|
||||
6
|
||||
Check [WILDLINE]/captured_output.worker.ts
|
||||
9
|
||||
8
|
||||
[UNORDERED_END]
|
||||
----- output end -----
|
||||
output ... ok ([WILDCARD])
|
||||
|
||||
ok | 1 passed | 0 failed ([WILDCARD])
|
||||
|
4
tests/specs/test/check_local_by_default/__test__.jsonc
Normal file
4
tests/specs/test/check_local_by_default/__test__.jsonc
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"args": "test --quiet main.ts",
|
||||
"output": "main.out"
|
||||
}
|
4
tests/specs/test/check_local_by_default/main.out
Normal file
4
tests/specs/test/check_local_by_default/main.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
running 0 tests from ./main.ts
|
||||
|
||||
ok | 0 passed | 0 failed ([WILDCARD])
|
||||
|
5
tests/specs/test/check_local_by_default2/__test__.jsonc
Normal file
5
tests/specs/test/check_local_by_default2/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --quiet main.ts",
|
||||
"output": "main.out",
|
||||
"exitCode": 1
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
error: TS2322 [ERROR]: Type '12' is not assignable to type '"b"'.
|
||||
const b: "b" = 12;
|
||||
^
|
||||
at [WILDCARD]test/check_local_by_default2.ts:3:7
|
||||
at [WILDCARD]/main.ts:3:7
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"args": "run -A --config ../../../config/deno.json main.js",
|
||||
"args": "run -A --config deno.json main.js",
|
||||
"exitCode": 0,
|
||||
"output": "main.out"
|
||||
}
|
||||
|
|
4
tests/specs/test/clean_flag/deno.json
Normal file
4
tests/specs/test/clean_flag/deno.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"lock": false,
|
||||
"importMap": "../../../../import_map.json"
|
||||
}
|
5
tests/specs/test/clear_timeout/__test__.jsonc
Normal file
5
tests/specs/test/clear_timeout/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test main.ts",
|
||||
"exitCode": 0,
|
||||
"output": "main.out"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
Check [WILDCARD]/test/clear_timeout.ts
|
||||
running 3 tests from ./test/clear_timeout.ts
|
||||
Check [WILDCARD]/main.ts
|
||||
running 3 tests from ./main.ts
|
||||
test 1 ... ok ([WILDCARD])
|
||||
test 2 ... ok ([WILDCARD])
|
||||
test 3 ... ok ([WILDCARD])
|
5
tests/specs/test/collect/__test__.jsonc
Normal file
5
tests/specs/test/collect/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --ignore=collect/ignore collect",
|
||||
"exitCode": 0,
|
||||
"output": "main.out"
|
||||
}
|
9
tests/specs/test/collect/main.out
Normal file
9
tests/specs/test/collect/main.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
Check [WILDCARD]/collect/include/2_test.ts
|
||||
Check [WILDCARD]/collect/include/test.ts
|
||||
Check [WILDCARD]/collect/test.ts
|
||||
running 0 tests from [WILDCARD]/collect/include/2_test.ts
|
||||
running 0 tests from [WILDCARD]/collect/include/test.ts
|
||||
running 0 tests from [WILDCARD]/collect/test.ts
|
||||
|
||||
ok | 0 passed | 0 failed ([WILDCARD])
|
||||
|
5
tests/specs/test/doc/__test__.jsonc
Normal file
5
tests/specs/test/doc/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --doc --allow-all main.ts",
|
||||
"exitCode": 1,
|
||||
"output": "main.out"
|
||||
}
|
9
tests/specs/test/doc/main.out
Normal file
9
tests/specs/test/doc/main.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
Check [WILDCARD]/main.ts$6-9.js
|
||||
Check [WILDCARD]/main.ts$10-13.jsx
|
||||
Check [WILDCARD]/main.ts$14-17.ts
|
||||
Check [WILDCARD]/main.ts$18-21.tsx
|
||||
Check [WILDCARD]/main.ts$30-35.ts
|
||||
error: TS2367 [ERROR]: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap.
|
||||
console.assert(check() == 42);
|
||||
~~~~~~~~~~~~~
|
||||
at [WILDCARD]/main.ts$30-35.ts:3:16
|
38
tests/specs/test/doc/main.ts
Normal file
38
tests/specs/test/doc/main.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* ```
|
||||
* import * as doc from "./main.ts";
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* import * as doc from "./main.ts";
|
||||
* ```
|
||||
*
|
||||
* ```jsx
|
||||
* import * as doc from "./main.ts";
|
||||
* ```
|
||||
*
|
||||
* ```ts
|
||||
* import * as doc from "./main.ts";
|
||||
* ```
|
||||
*
|
||||
* ```tsx
|
||||
* import * as doc from "./main.ts";
|
||||
* ```
|
||||
*
|
||||
* ```text
|
||||
* import * as doc from "./main.ts";
|
||||
* ```
|
||||
*
|
||||
* @module doc
|
||||
*/
|
||||
|
||||
/**
|
||||
* ```ts
|
||||
* import { check } from "./main.ts";
|
||||
*
|
||||
* console.assert(check() == 42);
|
||||
* ```
|
||||
*/
|
||||
export function check(): string {
|
||||
return "check";
|
||||
}
|
5
tests/specs/test/doc_only/__test__.jsonc
Normal file
5
tests/specs/test/doc_only/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --doc --allow-all doc_only",
|
||||
"exitCode": 0,
|
||||
"output": "main.out"
|
||||
}
|
4
tests/specs/test/doc_only/main.out
Normal file
4
tests/specs/test/doc_only/main.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
Check [WILDCARD]/doc_only/mod.ts$2-5.ts
|
||||
|
||||
ok | 0 passed | 0 failed ([WILDCARD])
|
||||
|
5
tests/specs/test/exit_sanitizer/__test__.jsonc
Normal file
5
tests/specs/test/exit_sanitizer/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test exit_sanitizer.ts",
|
||||
"output": "exit_sanitizer.out",
|
||||
"exitCode": 1
|
||||
}
|
5
tests/specs/test/fail/__test__.jsonc
Normal file
5
tests/specs/test/fail/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test main.ts",
|
||||
"exitCode": 1,
|
||||
"output": "main.out"
|
||||
}
|
91
tests/specs/test/fail/main.out
Normal file
91
tests/specs/test/fail/main.out
Normal file
|
@ -0,0 +1,91 @@
|
|||
Check [WILDCARD]/main.ts
|
||||
running 10 tests from ./main.ts
|
||||
test 0 ... FAILED ([WILDCARD])
|
||||
test 1 ... FAILED ([WILDCARD])
|
||||
test 2 ... FAILED ([WILDCARD])
|
||||
test 3 ... FAILED ([WILDCARD])
|
||||
test 4 ... FAILED ([WILDCARD])
|
||||
test 5 ... FAILED ([WILDCARD])
|
||||
test 6 ... FAILED ([WILDCARD])
|
||||
test 7 ... FAILED ([WILDCARD])
|
||||
test 8 ... FAILED ([WILDCARD])
|
||||
test 9 ... FAILED ([WILDCARD])
|
||||
|
||||
ERRORS
|
||||
|
||||
test 0 => ./main.ts:1:6
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/main.ts:2:9
|
||||
|
||||
test 1 => ./main.ts:4:6
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/main.ts:5:9
|
||||
|
||||
test 2 => ./main.ts:7:6
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/main.ts:8:9
|
||||
|
||||
test 3 => ./main.ts:10:6
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/main.ts:11:9
|
||||
|
||||
test 4 => ./main.ts:13:6
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/main.ts:14:9
|
||||
|
||||
test 5 => ./main.ts:16:6
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/main.ts:17:9
|
||||
|
||||
test 6 => ./main.ts:19:6
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/main.ts:20:9
|
||||
|
||||
test 7 => ./main.ts:22:6
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/main.ts:23:9
|
||||
|
||||
test 8 => ./main.ts:25:6
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/main.ts:26:9
|
||||
|
||||
test 9 => ./main.ts:28:6
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/main.ts:29:9
|
||||
|
||||
FAILURES
|
||||
|
||||
test 0 => ./main.ts:1:6
|
||||
test 1 => ./main.ts:4:6
|
||||
test 2 => ./main.ts:7:6
|
||||
test 3 => ./main.ts:10:6
|
||||
test 4 => ./main.ts:13:6
|
||||
test 5 => ./main.ts:16:6
|
||||
test 6 => ./main.ts:19:6
|
||||
test 7 => ./main.ts:22:6
|
||||
test 8 => ./main.ts:25:6
|
||||
test 9 => ./main.ts:28:6
|
||||
|
||||
FAILED | 0 passed | 10 failed ([WILDCARD])
|
||||
|
||||
error: Test failed
|
5
tests/specs/test/fail_fast/__test__.jsonc
Normal file
5
tests/specs/test/fail_fast/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --fail-fast fail_fast.ts fail_fast_other.ts",
|
||||
"exitCode": 1,
|
||||
"output": "fail_fast.out"
|
||||
}
|
20
tests/specs/test/fail_fast/fail_fast.out
Normal file
20
tests/specs/test/fail_fast/fail_fast.out
Normal file
|
@ -0,0 +1,20 @@
|
|||
Check [WILDCARD]/fail_fast.ts
|
||||
Check [WILDCARD]/fail_fast_other.ts
|
||||
running 10 tests from ./fail_fast.ts
|
||||
test 1 ... FAILED ([WILDCARD])
|
||||
|
||||
ERRORS
|
||||
|
||||
test 1 => ./fail_fast.ts:[WILDCARD]
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/fail_fast.ts:2:9
|
||||
|
||||
FAILURES
|
||||
|
||||
test 1 => ./fail_fast.ts:[WILDCARD]
|
||||
|
||||
FAILED | 0 passed | 1 failed ([WILDCARD])
|
||||
|
||||
error: Test failed
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test main.ts",
|
||||
"output": "main.out",
|
||||
"exitCode": 1
|
||||
}
|
19
tests/specs/test/fail_with_contain_unicode_filename/main.out
Normal file
19
tests/specs/test/fail_with_contain_unicode_filename/main.out
Normal file
|
@ -0,0 +1,19 @@
|
|||
Check [WILDCARD]/main.ts
|
||||
running 1 test from ./main.ts
|
||||
test 0 ... FAILED ([WILDCARD])
|
||||
|
||||
ERRORS
|
||||
|
||||
test 0 => ./main.ts:[WILDCARD]
|
||||
error: Error
|
||||
throw new Error();
|
||||
^
|
||||
at [WILDCARD]/main.ts:[WILDCARD]
|
||||
|
||||
FAILURES
|
||||
|
||||
test 0 => ./main.ts:[WILDCARD]
|
||||
|
||||
FAILED | 0 passed | 1 failed ([WILDCARD])
|
||||
|
||||
error: Test failed
|
|
@ -0,0 +1,3 @@
|
|||
Deno.test("test 0", () => {
|
||||
throw new Error();
|
||||
});
|
4
tests/specs/test/file_protocol/__test__.jsonc
Normal file
4
tests/specs/test/file_protocol/__test__.jsonc
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"args": "test main.ts",
|
||||
"output": "main.out"
|
||||
}
|
6
tests/specs/test/file_protocol/main.out
Normal file
6
tests/specs/test/file_protocol/main.out
Normal file
|
@ -0,0 +1,6 @@
|
|||
Check file://[WILDCARD]/main.ts
|
||||
running 1 test from ./main.ts
|
||||
test 0 ... ok ([WILDCARD])
|
||||
|
||||
ok | 1 passed | 0 failed ([WILDCARD])
|
||||
|
5
tests/specs/test/filter/__test__.jsonc
Normal file
5
tests/specs/test/filter/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --filter=foo filter",
|
||||
"exitCode": 0,
|
||||
"output": "main.out"
|
||||
}
|
12
tests/specs/test/filter/main.out
Normal file
12
tests/specs/test/filter/main.out
Normal file
|
@ -0,0 +1,12 @@
|
|||
Check [WILDCARD]/filter/a_test.ts
|
||||
Check [WILDCARD]/filter/b_test.ts
|
||||
Check [WILDCARD]/filter/c_test.ts
|
||||
running 1 test from [WILDCARD]/filter/a_test.ts
|
||||
foo ... ok ([WILDCARD])
|
||||
running 1 test from [WILDCARD]/filter/b_test.ts
|
||||
foo ... ok ([WILDCARD])
|
||||
running 1 test from [WILDCARD]/filter/c_test.ts
|
||||
foo ... ok ([WILDCARD])
|
||||
|
||||
ok | 3 passed | 0 failed | 6 filtered out ([WILDCARD])
|
||||
|
5
tests/specs/test/finally_timeout/__test__.jsonc
Normal file
5
tests/specs/test/finally_timeout/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test main.ts",
|
||||
"exitCode": 1,
|
||||
"output": "main.out"
|
||||
}
|
20
tests/specs/test/finally_timeout/main.out
Normal file
20
tests/specs/test/finally_timeout/main.out
Normal file
|
@ -0,0 +1,20 @@
|
|||
Check [WILDCARD]/main.ts
|
||||
running 2 tests from ./main.ts
|
||||
error ... FAILED ([WILDCARD])
|
||||
success ... ok ([WILDCARD])
|
||||
|
||||
ERRORS
|
||||
|
||||
error => ./main.ts:[WILDCARD]
|
||||
error: Error: fail
|
||||
throw new Error("fail");
|
||||
^
|
||||
at [WILDCARD]/main.ts:4:11
|
||||
|
||||
FAILURES
|
||||
|
||||
error => ./main.ts:[WILDCARD]
|
||||
|
||||
FAILED | 1 passed | 1 failed ([WILDCARD])
|
||||
|
||||
error: Test failed
|
5
tests/specs/test/hide_empty_suites/__test__.jsonc
Normal file
5
tests/specs/test/hide_empty_suites/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --filter none main.ts",
|
||||
"exitCode": 0,
|
||||
"output": "main.out"
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
Check [WILDCARD]/test/pass.ts
|
||||
Check [WILDCARD]/main.ts
|
||||
|
||||
ok | 0 passed | 0 failed | 16 filtered out ([WILDCARD])
|
||||
|
5
tests/specs/test/ignore/__test__.jsonc
Normal file
5
tests/specs/test/ignore/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test main.ts",
|
||||
"exitCode": 0,
|
||||
"output": "main.out"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
Check [WILDCARD]/test/ignore.ts
|
||||
running 10 tests from ./test/ignore.ts
|
||||
Check [WILDCARD]/main.ts
|
||||
running 10 tests from ./main.ts
|
||||
test 0 ... ignored ([WILDCARD])
|
||||
test 1 ... ignored ([WILDCARD])
|
||||
test 2 ... ignored ([WILDCARD])
|
5
tests/specs/test/ignore_persmissions/__test__.jsonc
Normal file
5
tests/specs/test/ignore_persmissions/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test main.ts",
|
||||
"exitCode": 0,
|
||||
"output": "main.out"
|
||||
}
|
6
tests/specs/test/ignore_persmissions/main.out
Normal file
6
tests/specs/test/ignore_persmissions/main.out
Normal file
|
@ -0,0 +1,6 @@
|
|||
Check [WILDCARD]/main.ts
|
||||
running 1 test from ./main.ts
|
||||
ignore ... ignored ([WILDCARD])
|
||||
|
||||
ok | 0 passed | 0 failed | 1 ignored ([WILDCARD])
|
||||
|
5
tests/specs/test/interval/__test__.jsonc
Normal file
5
tests/specs/test/interval/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test main.ts",
|
||||
"exitCode": 0,
|
||||
"output": "main.out"
|
||||
}
|
5
tests/specs/test/interval/main.out
Normal file
5
tests/specs/test/interval/main.out
Normal file
|
@ -0,0 +1,5 @@
|
|||
Check [WILDCARD]/main.ts
|
||||
running 0 tests from ./main.ts
|
||||
|
||||
ok | 0 passed | 0 failed ([WILDCARD])
|
||||
|
4
tests/specs/test/junit/__test__.jsonc
Normal file
4
tests/specs/test/junit/__test__.jsonc
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"args": "test --reporter junit main.ts",
|
||||
"output": "main.out"
|
||||
}
|
38
tests/specs/test/junit/main.out
Normal file
38
tests/specs/test/junit/main.out
Normal file
|
@ -0,0 +1,38 @@
|
|||
Check file:///[WILDCARD]/main.ts
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuites name="deno test" tests="16" failures="0" errors="0" time="[WILDCARD]">
|
||||
<testsuite name="./main.ts" tests="16" disabled="0" errors="0" failures="0">
|
||||
<testcase name="test 0" classname="./main.ts" time="[WILDCARD]" line="1" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 1" classname="./main.ts" time="[WILDCARD]" line="2" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 2" classname="./main.ts" time="[WILDCARD]" line="3" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 3" classname="./main.ts" time="[WILDCARD]" line="4" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 4" classname="./main.ts" time="[WILDCARD]" line="5" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 5" classname="./main.ts" time="[WILDCARD]" line="6" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 6" classname="./main.ts" time="[WILDCARD]" line="7" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 7" classname="./main.ts" time="[WILDCARD]" line="8" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 8" classname="./main.ts" time="[WILDCARD]" line="9" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 9" classname="./main.ts" time="[WILDCARD]" line="12" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\b" classname="./main.ts" time="[WILDCARD]" line="16" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\f" classname="./main.ts" time="[WILDCARD]" line="19" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\t" classname="./main.ts" time="[WILDCARD]" line="23" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\n" classname="./main.ts" time="[WILDCARD]" line="27" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\r" classname="./main.ts" time="[WILDCARD]" line="31" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\v" classname="./main.ts" time="[WILDCARD]" line="35" col="6">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
37
tests/specs/test/junit/main.ts
Normal file
37
tests/specs/test/junit/main.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
Deno.test("test 0", () => {});
|
||||
Deno.test("test 1", () => {});
|
||||
Deno.test("test 2", () => {});
|
||||
Deno.test("test 3", () => {});
|
||||
Deno.test("test 4", () => {});
|
||||
Deno.test("test 5", () => {});
|
||||
Deno.test("test 6", () => {});
|
||||
Deno.test("test 7", () => {});
|
||||
Deno.test("test 8", () => {
|
||||
console.log("console.log");
|
||||
});
|
||||
Deno.test("test 9", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
|
||||
Deno.test("test\b", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
Deno.test("test\f", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
|
||||
Deno.test("test\t", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
|
||||
Deno.test("test\n", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
|
||||
Deno.test("test\r", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
|
||||
Deno.test("test\v", () => {
|
||||
console.error("console.error");
|
||||
});
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --reporter junit pass.ts fail.ts",
|
||||
"exitCode": 1,
|
||||
"output": "main.out"
|
||||
}
|
|
@ -1,3 +1,6 @@
|
|||
Deno.test("test 0", () => {
|
||||
throw new Error();
|
||||
});
|
||||
Deno.test("test 1", () => {
|
||||
throw new Error();
|
||||
});
|
||||
|
@ -25,6 +28,3 @@ Deno.test("test 8", () => {
|
|||
Deno.test("test 9", () => {
|
||||
throw new Error();
|
||||
});
|
||||
Deno.test("test 0", () => {
|
||||
throw new Error();
|
||||
});
|
102
tests/specs/test/junit_multiple_test_files/main.out
Normal file
102
tests/specs/test/junit_multiple_test_files/main.out
Normal file
|
@ -0,0 +1,102 @@
|
|||
Check file:///[WILDCARD]/pass.ts
|
||||
Check file:///[WILDCARD]/fail.ts
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuites name="deno test" tests="26" failures="10" errors="0" time="[WILDCARD]">
|
||||
<testsuite name="./pass.ts" tests="16" disabled="0" errors="0" failures="0">
|
||||
<testcase name="test 0" classname="./pass.ts" time="[WILDCARD]" line="1" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 1" classname="./pass.ts" time="[WILDCARD]" line="2" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 2" classname="./pass.ts" time="[WILDCARD]" line="3" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 3" classname="./pass.ts" time="[WILDCARD]" line="4" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 4" classname="./pass.ts" time="[WILDCARD]" line="5" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 5" classname="./pass.ts" time="[WILDCARD]" line="6" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 6" classname="./pass.ts" time="[WILDCARD]" line="7" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 7" classname="./pass.ts" time="[WILDCARD]" line="8" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 8" classname="./pass.ts" time="[WILDCARD]" line="9" col="6">
|
||||
</testcase>
|
||||
<testcase name="test 9" classname="./pass.ts" time="[WILDCARD]" line="12" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\b" classname="./pass.ts" time="[WILDCARD]" line="16" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\f" classname="./pass.ts" time="[WILDCARD]" line="19" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\t" classname="./pass.ts" time="[WILDCARD]" line="23" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\n" classname="./pass.ts" time="[WILDCARD]" line="27" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\r" classname="./pass.ts" time="[WILDCARD]" line="31" col="6">
|
||||
</testcase>
|
||||
<testcase name="test\v" classname="./pass.ts" time="[WILDCARD]" line="35" col="6">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
<testsuite name="./fail.ts" tests="10" disabled="0" errors="0" failures="10">
|
||||
<testcase name="test 0" classname="./fail.ts" time="[WILDCARD]" line="1" col="6">
|
||||
<failure message="Uncaught Error">Error
|
||||
throw new Error();
|
||||
^
|
||||
at file:///[WILDCARD]/fail.ts:2:9</failure>
|
||||
</testcase>
|
||||
<testcase name="test 1" classname="./fail.ts" time="[WILDCARD]" line="4" col="6">
|
||||
<failure message="Uncaught Error">Error
|
||||
throw new Error();
|
||||
^
|
||||
at file:///[WILDCARD]/fail.ts:5:9</failure>
|
||||
</testcase>
|
||||
<testcase name="test 2" classname="./fail.ts" time="[WILDCARD]" line="7" col="6">
|
||||
<failure message="Uncaught Error">Error
|
||||
throw new Error();
|
||||
^
|
||||
at file:///[WILDCARD]/fail.ts:8:9</failure>
|
||||
</testcase>
|
||||
<testcase name="test 3" classname="./fail.ts" time="[WILDCARD]" line="10" col="6">
|
||||
<failure message="Uncaught Error">Error
|
||||
throw new Error();
|
||||
^
|
||||
at file:///[WILDCARD]/fail.ts:11:9</failure>
|
||||
</testcase>
|
||||
<testcase name="test 4" classname="./fail.ts" time="[WILDCARD]" line="13" col="6">
|
||||
<failure message="Uncaught Error">Error
|
||||
throw new Error();
|
||||
^
|
||||
at file:///[WILDCARD]/fail.ts:14:9</failure>
|
||||
</testcase>
|
||||
<testcase name="test 5" classname="./fail.ts" time="[WILDCARD]" line="16" col="6">
|
||||
<failure message="Uncaught Error">Error
|
||||
throw new Error();
|
||||
^
|
||||
at file:///[WILDCARD]/fail.ts:17:9</failure>
|
||||
</testcase>
|
||||
<testcase name="test 6" classname="./fail.ts" time="[WILDCARD]" line="19" col="6">
|
||||
<failure message="Uncaught Error">Error
|
||||
throw new Error();
|
||||
^
|
||||
at file:///[WILDCARD]/fail.ts:20:9</failure>
|
||||
</testcase>
|
||||
<testcase name="test 7" classname="./fail.ts" time="[WILDCARD]" line="22" col="6">
|
||||
<failure message="Uncaught Error">Error
|
||||
throw new Error();
|
||||
^
|
||||
at file:///[WILDCARD]/fail.ts:23:9</failure>
|
||||
</testcase>
|
||||
<testcase name="test 8" classname="./fail.ts" time="[WILDCARD]" line="25" col="6">
|
||||
<failure message="Uncaught Error">Error
|
||||
throw new Error();
|
||||
^
|
||||
at file:///[WILDCARD]/fail.ts:26:9</failure>
|
||||
</testcase>
|
||||
<testcase name="test 9" classname="./fail.ts" time="[WILDCARD]" line="28" col="6">
|
||||
<failure message="Uncaught Error">Error
|
||||
throw new Error();
|
||||
^
|
||||
at file:///[WILDCARD]/fail.ts:29:9</failure>
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
error: Test failed
|
37
tests/specs/test/junit_multiple_test_files/pass.ts
Normal file
37
tests/specs/test/junit_multiple_test_files/pass.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
Deno.test("test 0", () => {});
|
||||
Deno.test("test 1", () => {});
|
||||
Deno.test("test 2", () => {});
|
||||
Deno.test("test 3", () => {});
|
||||
Deno.test("test 4", () => {});
|
||||
Deno.test("test 5", () => {});
|
||||
Deno.test("test 6", () => {});
|
||||
Deno.test("test 7", () => {});
|
||||
Deno.test("test 8", () => {
|
||||
console.log("console.log");
|
||||
});
|
||||
Deno.test("test 9", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
|
||||
Deno.test("test\b", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
Deno.test("test\f", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
|
||||
Deno.test("test\t", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
|
||||
Deno.test("test\n", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
|
||||
Deno.test("test\r", () => {
|
||||
console.error("console.error");
|
||||
});
|
||||
|
||||
Deno.test("test\v", () => {
|
||||
console.error("console.error");
|
||||
});
|
5
tests/specs/test/junit_nested/__test__.jsonc
Normal file
5
tests/specs/test/junit_nested/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --reporter junit main.ts",
|
||||
"exitCode": 1,
|
||||
"output": "main.out"
|
||||
}
|
47
tests/specs/test/junit_nested/main.out
Normal file
47
tests/specs/test/junit_nested/main.out
Normal file
|
@ -0,0 +1,47 @@
|
|||
Check file:///[WILDCARD]/main.ts
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuites name="deno test" tests="11" failures="6" errors="0" time="[WILDCARD]">
|
||||
<testsuite name="./main.ts" tests="11" disabled="0" errors="0" failures="6">
|
||||
<testcase name="parent 1" classname="./main.ts" time="[WILDCARD]" line="1" col="6">
|
||||
<failure message="1 test step failed">1 test step failed.</failure>
|
||||
</testcase>
|
||||
<testcase name="parent 2" classname="./main.ts" time="[WILDCARD]" line="8" col="6">
|
||||
<failure message="2 test steps failed">2 test steps failed.</failure>
|
||||
</testcase>
|
||||
<testcase name="parent 3" classname="./main.ts" time="[WILDCARD]" line="20" col="6">
|
||||
</testcase>
|
||||
<testcase name="parent 1 > child 1" classname="./main.ts" time="[WILDCARD]" line="2" col="11">
|
||||
</testcase>
|
||||
<testcase name="parent 1 > child 2" classname="./main.ts" time="[WILDCARD]" line="3" col="11">
|
||||
<failure message="Uncaught Error: Fail.">Error: Fail.
|
||||
throw new Error("Fail.");
|
||||
^
|
||||
at file:///[WILDCARD]/main.ts:4:11
|
||||
[WILDCARD]</failure>
|
||||
</testcase>
|
||||
<testcase name="parent 2 > child 1" classname="./main.ts" time="[WILDCARD]" line="9" col="11">
|
||||
<failure message="1 test step failed">1 test step failed.</failure>
|
||||
</testcase>
|
||||
<testcase name="parent 2 > child 1 > grandchild 1" classname="[WILDCARD]/main.ts" time="[WILDCARD]" line="10" col="13">
|
||||
</testcase>
|
||||
<testcase name="parent 2 > child 1 > grandchild 2" classname="[WILDCARD]/main.ts" time="[WILDCARD]" line="11" col="13">
|
||||
<failure message="Uncaught Error: Fail.">Error: Fail.
|
||||
throw new Error("Fail.");
|
||||
^
|
||||
at file:///[WILDCARD]/main.ts:12:13
|
||||
[WILDCARD]</failure>
|
||||
</testcase>
|
||||
<testcase name="parent 2 > child 2" classname="./main.ts" time="[WILDCARD]" line="15" col="11">
|
||||
<failure message="Uncaught Error: Fail.">Error: Fail.
|
||||
throw new Error("Fail.");
|
||||
^
|
||||
at file:///[WILDCARD]/main.ts:16:11
|
||||
[WILDCARD]</failure>
|
||||
</testcase>
|
||||
<testcase name="parent 3 > child 1" classname="./main.ts" time="[WILDCARD]" line="21" col="11">
|
||||
</testcase>
|
||||
<testcase name="parent 3 > child 2" classname="./main.ts" time="[WILDCARD]" line="22" col="11">
|
||||
</testcase>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
error: Test failed
|
5
tests/specs/test/load_unload/__test__.jsonc
Normal file
5
tests/specs/test/load_unload/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test main.ts",
|
||||
"exitCode": 0,
|
||||
"output": "main.out"
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
Check [WILDCARD]/load_unload.ts
|
||||
Check [WILDCARD]/main.ts
|
||||
------- pre-test output -------
|
||||
load
|
||||
----- pre-test output end -----
|
||||
running 1 test from [WILDCARD]/load_unload.ts
|
||||
running 1 test from [WILDCARD]/main.ts
|
||||
test ...
|
||||
------- output -------
|
||||
test
|
5
tests/specs/test/markdown/__test__.jsonc
Normal file
5
tests/specs/test/markdown/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --doc --allow-all main.md",
|
||||
"exitCode": 1,
|
||||
"output": "main.out"
|
||||
}
|
7
tests/specs/test/markdown/main.out
Normal file
7
tests/specs/test/markdown/main.out
Normal file
|
@ -0,0 +1,7 @@
|
|||
Check [WILDCARD]/main.md$11-14.js
|
||||
Check [WILDCARD]/main.md$17-20.ts
|
||||
Check [WILDCARD]/main.md$29-32.ts
|
||||
error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
|
||||
const a: string = 42;
|
||||
^
|
||||
at [WILDCARD]/main.md$29-32.ts:1:7
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "test --doc --allow-all main.md",
|
||||
"exitCode": 1,
|
||||
"output": "main.out"
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue