1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

Add TestErrors

This commit is contained in:
Ryan Dahl 2018-05-26 21:55:08 -04:00
parent 8d2d66256e
commit fe6e4febdb
2 changed files with 23 additions and 0 deletions

View file

@ -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.")
}
}

9
testdata/013_async_throw.ts vendored Normal file
View file

@ -0,0 +1,9 @@
console.log("hello");
const foo = async () => {
console.log("before error");
throw Error("error");
}
foo();
console.log("world");