From 2242c6c7921fcb681d3be7683fba862b4954b04a Mon Sep 17 00:00:00 2001 From: Parsa Ghadimi Date: Wed, 30 May 2018 17:03:55 +0430 Subject: Use wildcard to check stack trace outputs (#3) --- testdata/006_url_imports.ts.out | 1 + testdata/007_stack_trace.ts | 9 --------- testdata/013_async_throw.ts | 9 --------- testdata/async_error.ts | 9 +++++++++ testdata/async_error.ts.out | 10 ++++++++++ testdata/error.ts | 9 +++++++++ testdata/error.ts.out | 10 ++++++++++ 7 files changed, 39 insertions(+), 18 deletions(-) delete mode 100644 testdata/007_stack_trace.ts delete mode 100644 testdata/013_async_throw.ts create mode 100644 testdata/async_error.ts create mode 100644 testdata/async_error.ts.out create mode 100644 testdata/error.ts create mode 100644 testdata/error.ts.out (limited to 'testdata') diff --git a/testdata/006_url_imports.ts.out b/testdata/006_url_imports.ts.out index 989ce33e9..f745fe3cf 100644 --- a/testdata/006_url_imports.ts.out +++ b/testdata/006_url_imports.ts.out @@ -1,2 +1,3 @@ +Downloading http://localhost:4545/testdata/subdir/print_hello.ts Hello success diff --git a/testdata/007_stack_trace.ts b/testdata/007_stack_trace.ts deleted file mode 100644 index 624bc55da..000000000 --- a/testdata/007_stack_trace.ts +++ /dev/null @@ -1,9 +0,0 @@ -function foo() { - throw Error("bad"); -} - -function bar() { - foo() -} - -bar() diff --git a/testdata/013_async_throw.ts b/testdata/013_async_throw.ts deleted file mode 100644 index 12dee11eb..000000000 --- a/testdata/013_async_throw.ts +++ /dev/null @@ -1,9 +0,0 @@ - -console.log("hello"); -const foo = async () => { - console.log("before error"); - throw Error("error"); -} - -foo(); -console.log("world"); diff --git a/testdata/async_error.ts b/testdata/async_error.ts new file mode 100644 index 000000000..12dee11eb --- /dev/null +++ b/testdata/async_error.ts @@ -0,0 +1,9 @@ + +console.log("hello"); +const foo = async () => { + console.log("before error"); + throw Error("error"); +} + +foo(); +console.log("world"); diff --git a/testdata/async_error.ts.out b/testdata/async_error.ts.out new file mode 100644 index 000000000..7b7dc9d19 --- /dev/null +++ b/testdata/async_error.ts.out @@ -0,0 +1,10 @@ +hello +before error +error Error: error + at foo ([WILDCARD]testdata/async_error.ts:4:11) + at eval ([WILDCARD]testdata/async_error.ts:6:1) + at Object.eval [as globalEval] () + at execute (/main.js:[WILDCARD]) + at FileModule.compileAndRun (/main.js:[WILDCARD]) + at /main.js:[WILDCARD] + at /main.js:[WILDCARD] diff --git a/testdata/error.ts b/testdata/error.ts new file mode 100644 index 000000000..624bc55da --- /dev/null +++ b/testdata/error.ts @@ -0,0 +1,9 @@ +function foo() { + throw Error("bad"); +} + +function bar() { + foo() +} + +bar() diff --git a/testdata/error.ts.out b/testdata/error.ts.out new file mode 100644 index 000000000..952758df9 --- /dev/null +++ b/testdata/error.ts.out @@ -0,0 +1,10 @@ +/main.js:[WILDCARD] + throw _iteratorError; + ^ +Error: bad + at foo ([WILDCARD]testdata/error.ts:2:9) + at bar ([WILDCARD]testdata/error.ts:6:3) + at eval ([WILDCARD]testdata/error.ts:9:1) + at Object.eval [as globalEval] () + at execute (../runtime.ts:[WILDCARD]) + at FileModule.compileAndRun (../runtime.ts:[WILDCARD] -- cgit v1.2.3