diff options
Diffstat (limited to 'cli/tests')
4 files changed, 17 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index f469bb364..0aca09902 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -1916,3 +1916,9 @@ itest!(long_data_url_formatting { output: "long_data_url_formatting.ts.out", exit_code: 1, }); + +itest!(eval_context_throw_with_conflicting_source { + args: "run eval_context_throw_with_conflicting_source.ts", + output: "eval_context_throw_with_conflicting_source.ts.out", + exit_code: 1, +}); diff --git a/cli/tests/testdata/eval_context_conflicting_source.ts b/cli/tests/testdata/eval_context_conflicting_source.ts new file mode 100644 index 000000000..671740113 --- /dev/null +++ b/cli/tests/testdata/eval_context_conflicting_source.ts @@ -0,0 +1 @@ +throw new Error("foo"); diff --git a/cli/tests/testdata/eval_context_throw_with_conflicting_source.ts b/cli/tests/testdata/eval_context_throw_with_conflicting_source.ts new file mode 100644 index 000000000..c5bc21e48 --- /dev/null +++ b/cli/tests/testdata/eval_context_throw_with_conflicting_source.ts @@ -0,0 +1,6 @@ +// deno-lint-ignore no-explicit-any +const [, errorInfo] = (Deno as any).core.evalContext( + '/* aaaaaaaaaaaaaaaaa */ throw new Error("foo")', + new URL("eval_context_conflicting_source.ts", import.meta.url).href, +); +throw errorInfo.thrown; diff --git a/cli/tests/testdata/eval_context_throw_with_conflicting_source.ts.out b/cli/tests/testdata/eval_context_throw_with_conflicting_source.ts.out new file mode 100644 index 000000000..37219ba86 --- /dev/null +++ b/cli/tests/testdata/eval_context_throw_with_conflicting_source.ts.out @@ -0,0 +1,4 @@ +[WILDCARD]error: Uncaught Error: foo +Warning Couldn't format source line: Column 31 is out of bounds (source may have changed at runtime) + at file:///[WILDCARD]/eval_context_conflicting_source.ts:1:31 + at file:///[WILDCARD]/eval_context_throw_with_conflicting_source.ts:[WILDCARD] |