From fe6e4febdb6858695cd86c75a9377ede3ca484f9 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 26 May 2018 21:55:08 -0400 Subject: [PATCH] Add TestErrors --- integration_test.go | 14 ++++++++++++++ testdata/013_async_throw.ts | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100644 testdata/013_async_throw.ts diff --git a/integration_test.go b/integration_test.go index 0805708a86..37c87f30a4 100644 --- a/integration_test.go +++ b/integration_test.go @@ -130,3 +130,17 @@ func TestIntegrationUrlArgs(t *testing.T) { t.Fatalf("Expected 404 at '%s'", cacheFn) } } + +func TestErrors(t *testing.T) { + integrationTestSetup() + + _, _, err := deno("testdata/013_async_throw.ts") + if err == nil { + t.Fatalf("Expected error.") + } + + _, _, err = deno("testdata/007_stack_trace.ts") + if err == nil { + t.Fatalf("Expected error.") + } +} diff --git a/testdata/013_async_throw.ts b/testdata/013_async_throw.ts new file mode 100644 index 0000000000..12dee11eb0 --- /dev/null +++ b/testdata/013_async_throw.ts @@ -0,0 +1,9 @@ + +console.log("hello"); +const foo = async () => { + console.log("before error"); + throw Error("error"); +} + +foo(); +console.log("world");