diff options
| author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-04-13 15:54:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-13 10:54:16 -0400 |
| commit | 0ea6eb83a906bff543be4c3301f23444986b022b (patch) | |
| tree | 923e5b1c7608839c9a7be545f8973ae751ee7e73 /cli/tests | |
| parent | 5105c6839904f35351481137160459fdc2edadd2 (diff) | |
refactor(core/js_error): Align JSStackFrame with CallSite (#4715)
Renames and adds missing fields to JSStackFrame from CallSite. Fixes #4705.
Cleans up base changes for line and column numbers.
Diffstat (limited to 'cli/tests')
| -rw-r--r-- | cli/tests/error_024_stack_promise_all.ts | 13 | ||||
| -rw-r--r-- | cli/tests/error_024_stack_promise_all.ts.out | 8 | ||||
| -rw-r--r-- | cli/tests/integration_tests.rs | 7 |
3 files changed, 28 insertions, 0 deletions
diff --git a/cli/tests/error_024_stack_promise_all.ts b/cli/tests/error_024_stack_promise_all.ts new file mode 100644 index 000000000..5334e8d77 --- /dev/null +++ b/cli/tests/error_024_stack_promise_all.ts @@ -0,0 +1,13 @@ +const p = Promise.all([ + (async (): Promise<never> => { + await Promise.resolve(); + throw new Error("Promise.all()"); + })(), +]); + +try { + await p; +} catch (error) { + console.log(error.stack); + throw error; +} diff --git a/cli/tests/error_024_stack_promise_all.ts.out b/cli/tests/error_024_stack_promise_all.ts.out new file mode 100644 index 000000000..38cb4ac31 --- /dev/null +++ b/cli/tests/error_024_stack_promise_all.ts.out @@ -0,0 +1,8 @@ +[WILDCARD]Error: Promise.all() + at [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD] + at async Promise.all (index 0) + at async [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD] +error: Uncaught Error: Promise.all() + at [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD] + at async Promise.all (index 0) + at async [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD] diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index d043958a9..905870c29 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1406,6 +1406,13 @@ itest!(error_023_stack_async { exit_code: 1, }); +itest!(error_024_stack_promise_all { + args: "error_024_stack_promise_all.ts", + output: "error_024_stack_promise_all.ts.out", + check_stderr: true, + exit_code: 1, +}); + itest!(error_syntax { args: "run --reload error_syntax.js", check_stderr: true, |
