diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-04-20 20:39:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-20 15:39:02 -0400 |
commit | ef6ee25e09c902e1f9d89a40cf05660432e7143c (patch) | |
tree | b43745fa471693e7d8787b4a5e9a2489f895c873 /cli/tests | |
parent | f72f045de586a7d0e428b77f6a3e381178cc6674 (diff) |
refactor(cli/fmt_errors): Improve source line formatting (#4832)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/038_checkjs.js.out | 24 | ||||
-rw-r--r-- | cli/tests/044_bad_resource.ts.out | 4 | ||||
-rw-r--r-- | cli/tests/async_error.ts.out | 7 | ||||
-rw-r--r-- | cli/tests/config.ts.out | 11 | ||||
-rw-r--r-- | cli/tests/error_001.ts.out | 7 | ||||
-rw-r--r-- | cli/tests/error_002.ts.out | 7 | ||||
-rw-r--r-- | cli/tests/error_003_typescript.ts.out | 9 | ||||
-rw-r--r-- | cli/tests/error_004_missing_module.ts.out | 1 | ||||
-rw-r--r-- | cli/tests/error_005_missing_dynamic_import.ts.out | 1 | ||||
-rw-r--r-- | cli/tests/error_006_import_ext_failure.ts.out | 1 | ||||
-rw-r--r-- | cli/tests/error_008_checkjs.js.out | 7 | ||||
-rw-r--r-- | cli/tests/error_011_bad_module_specifier.ts.out | 1 | ||||
-rw-r--r-- | cli/tests/error_012_bad_dynamic_import_specifier.ts.out | 1 | ||||
-rw-r--r-- | cli/tests/error_017_hide_long_source_ts.ts.out | 3 | ||||
-rw-r--r-- | cli/tests/error_018_hide_long_source_js.js.out | 1 | ||||
-rw-r--r-- | cli/tests/error_syntax.js.out | 8 | ||||
-rw-r--r-- | cli/tests/error_syntax_empty_trailing_line.mjs.out | 2 | ||||
-rw-r--r-- | cli/tests/error_type_definitions.ts.out | 1 |
18 files changed, 36 insertions, 60 deletions
diff --git a/cli/tests/038_checkjs.js.out b/cli/tests/038_checkjs.js.out index deaf77211..92b8e2fd0 100644 --- a/cli/tests/038_checkjs.js.out +++ b/cli/tests/038_checkjs.js.out @@ -1,15 +1,21 @@ -[WILDCARD] -error TS2552: Cannot find name 'consol'. Did you mean 'console'? +[WILDCARD]error TS2552: Cannot find name 'consol'. Did you mean 'console'? +consol.log("hello world!"); +~~~~~~ + at [WILDCARD]tests/038_checkjs.js:2:1 -[WILDCARD]tests/038_checkjs.js:2:1 + 'console' is declared here. + declare var console: Console; + ~~~~~~~ + at [WILDCARD] -2 consol.log("hello world!"); -[WILDCARD] error TS2552: Cannot find name 'Foo'. Did you mean 'foo'? +const foo = new Foo(); + ~~~ + at [WILDCARD]tests/038_checkjs.js:6:17 -[WILDCARD]tests/038_checkjs.js:6:17 + 'foo' is declared here. + const foo = new Foo(); + ~~~ + at [WILDCARD]tests/038_checkjs.js:6:7 -6 const foo = new Foo(); -[WILDCARD] Found 2 errors. -[WILDCARD]
\ No newline at end of file diff --git a/cli/tests/044_bad_resource.ts.out b/cli/tests/044_bad_resource.ts.out index a54c800f8..609851477 100644 --- a/cli/tests/044_bad_resource.ts.out +++ b/cli/tests/044_bad_resource.ts.out @@ -1,6 +1,4 @@ -[WILDCARD] -error: Uncaught BadResource: Bad resource ID -[WILDCARD]dispatch_json.ts:[WILDCARD] +[WILDCARD]error: Uncaught BadResource: Bad resource ID at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) at Object.sendAsync ([WILDCARD]dispatch_json.ts:[WILDCARD]) at async main ([WILDCARD]tests/044_bad_resource.ts:[WILDCARD]) diff --git a/cli/tests/async_error.ts.out b/cli/tests/async_error.ts.out index 6e22799c2..7e32cd3dd 100644 --- a/cli/tests/async_error.ts.out +++ b/cli/tests/async_error.ts.out @@ -2,10 +2,7 @@ before error world error: Uncaught Error: error -[WILDCARD]tests/async_error.ts:5:9 - -5 throw Error("error"); - ^ - + throw Error("error"); + ^ at foo ([WILDCARD]tests/async_error.ts:5:9) at [WILDCARD]tests/async_error.ts:8:1 diff --git a/cli/tests/config.ts.out b/cli/tests/config.ts.out index db5a8340e..b08761ac1 100644 --- a/cli/tests/config.ts.out +++ b/cli/tests/config.ts.out @@ -1,10 +1,7 @@ [WILDCARD]Unsupported compiler options in "[WILDCARD]config.tsconfig.json" The following options were ignored: module, target -[WILDCARD]error TS2532: Object is possibly 'undefined'. - -[WILDCARD]tests/config.ts:3:5 - -3 if (map.get("bar").foo) { - ~~~~~~~~~~~~~~ - +error TS2532: Object is possibly 'undefined'. +if (map.get("bar").foo) { + ~~~~~~~~~~~~~~ + at [WILDCARD]tests/config.ts:3:5 diff --git a/cli/tests/error_001.ts.out b/cli/tests/error_001.ts.out index 3c7e2828e..d4103349a 100644 --- a/cli/tests/error_001.ts.out +++ b/cli/tests/error_001.ts.out @@ -1,9 +1,6 @@ [WILDCARD]error: Uncaught Error: bad -[WILDCARD]tests/error_001.ts:2:9 - -2 throw Error("bad"); - ^ - + throw Error("bad"); + ^ at foo ([WILDCARD]tests/error_001.ts:2:9) at bar ([WILDCARD]tests/error_001.ts:6:3) at [WILDCARD]tests/error_001.ts:9:1 diff --git a/cli/tests/error_002.ts.out b/cli/tests/error_002.ts.out index 292544a33..2aae770f8 100644 --- a/cli/tests/error_002.ts.out +++ b/cli/tests/error_002.ts.out @@ -1,9 +1,6 @@ [WILDCARD]error: Uncaught Error: exception from mod1 -[WILDCARD]tests/subdir/mod1.ts:16:9 - -16 throw Error("exception from mod1"); - ^ - + throw Error("exception from mod1"); + ^ at throwsError ([WILDCARD]tests/subdir/mod1.ts:16:9) at foo ([WILDCARD]tests/error_002.ts:4:3) at [WILDCARD]tests/error_002.ts:7:1 diff --git a/cli/tests/error_003_typescript.ts.out b/cli/tests/error_003_typescript.ts.out index b5854c20f..ba113d12c 100644 --- a/cli/tests/error_003_typescript.ts.out +++ b/cli/tests/error_003_typescript.ts.out @@ -1,9 +1,6 @@ [WILDCARD]error TS2322: Type '{ a: { b: { c(): { d: number; }; }; }; }' is not assignable to type '{ a: { b: { c(): { d: string; }; }; }; }'. The types of 'a.b.c().d' are incompatible between these types. Type 'number' is not assignable to type 'string'. - -[WILDCARD]/cli/tests/error_003_typescript.ts:20:1 - -20 x = y; - ^ - +x = y; +^ + at [WILDCARD]/tests/error_003_typescript.ts:20:1 diff --git a/cli/tests/error_004_missing_module.ts.out b/cli/tests/error_004_missing_module.ts.out index e82cb00da..87db14026 100644 --- a/cli/tests/error_004_missing_module.ts.out +++ b/cli/tests/error_004_missing_module.ts.out @@ -1,5 +1,4 @@ [WILDCARD]error: Uncaught NotFound: Cannot resolve module "[WILDCARD]/bad-module.ts" from "[WILDCARD]/error_004_missing_module.ts" -[WILDCARD]dispatch_json.ts:[WILDCARD] at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) at Object.sendAsync ([WILDCARD]dispatch_json.ts:[WILDCARD]) at async processImports ([WILDCARD]compiler/imports.ts:[WILDCARD]) diff --git a/cli/tests/error_005_missing_dynamic_import.ts.out b/cli/tests/error_005_missing_dynamic_import.ts.out index a67241ec1..0ec1dcb97 100644 --- a/cli/tests/error_005_missing_dynamic_import.ts.out +++ b/cli/tests/error_005_missing_dynamic_import.ts.out @@ -1,5 +1,4 @@ [WILDCARD]error: Uncaught NotFound: Cannot resolve module "[WILDCARD]/bad-module.ts" from "[WILDCARD]/error_005_missing_dynamic_import.ts" -[WILDCARD]dispatch_json.ts:[WILDCARD] at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) at Object.sendAsync ([WILDCARD]dispatch_json.ts:[WILDCARD]) at async processImports ([WILDCARD]compiler/imports.ts:[WILDCARD]) diff --git a/cli/tests/error_006_import_ext_failure.ts.out b/cli/tests/error_006_import_ext_failure.ts.out index 57830c405..2cac6c76a 100644 --- a/cli/tests/error_006_import_ext_failure.ts.out +++ b/cli/tests/error_006_import_ext_failure.ts.out @@ -1,5 +1,4 @@ [WILDCARD]error: Uncaught NotFound: Cannot resolve module "[WILDCARD]/non-existent" from "[WILDCARD]/error_006_import_ext_failure.ts" -[WILDCARD]dispatch_json.ts:[WILDCARD] at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) at Object.sendAsync ([WILDCARD]dispatch_json.ts:[WILDCARD]) at async processImports ([WILDCARD]compiler/imports.ts:[WILDCARD]) diff --git a/cli/tests/error_008_checkjs.js.out b/cli/tests/error_008_checkjs.js.out index 5c50e8513..2d93ffd01 100644 --- a/cli/tests/error_008_checkjs.js.out +++ b/cli/tests/error_008_checkjs.js.out @@ -1,7 +1,4 @@ [WILDCARD]error: Uncaught ReferenceError: consol is not defined -[WILDCARD]tests/error_008_checkjs.js:2:1 - -2 consol.log("hello world!"); - ^ - +consol.log("hello world!"); +^ at [WILDCARD]tests/error_008_checkjs.js:2:1 diff --git a/cli/tests/error_011_bad_module_specifier.ts.out b/cli/tests/error_011_bad_module_specifier.ts.out index d85177dc1..23421b135 100644 --- a/cli/tests/error_011_bad_module_specifier.ts.out +++ b/cli/tests/error_011_bad_module_specifier.ts.out @@ -1,5 +1,4 @@ [WILDCARD]error: Uncaught URIError: relative import path "bad-module.ts" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_011_bad_module_specifier.ts" -[WILDCARD]dispatch_json.ts:[WILDCARD] at unwrapResponse ([WILDCARD]ops/dispatch_json.ts:[WILDCARD]) at Object.sendSync ([WILDCARD]ops/dispatch_json.ts:[WILDCARD]) at resolveModules ([WILDCARD]compiler/imports.ts:[WILDCARD]) diff --git a/cli/tests/error_012_bad_dynamic_import_specifier.ts.out b/cli/tests/error_012_bad_dynamic_import_specifier.ts.out index 59b968e81..57ca909ca 100644 --- a/cli/tests/error_012_bad_dynamic_import_specifier.ts.out +++ b/cli/tests/error_012_bad_dynamic_import_specifier.ts.out @@ -1,5 +1,4 @@ [WILDCARD]error: Uncaught URIError: relative import path "bad-module.ts" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_012_bad_dynamic_import_specifier.ts" -[WILDCARD]dispatch_json.ts:[WILDCARD] at unwrapResponse ([WILDCARD]ops/dispatch_json.ts:[WILDCARD]) at Object.sendSync ([WILDCARD]ops/dispatch_json.ts:[WILDCARD]) at resolveModules ([WILDCARD]compiler/imports.ts:[WILDCARD]) diff --git a/cli/tests/error_017_hide_long_source_ts.ts.out b/cli/tests/error_017_hide_long_source_ts.ts.out index 4b4016b84..6606c8523 100644 --- a/cli/tests/error_017_hide_long_source_ts.ts.out +++ b/cli/tests/error_017_hide_long_source_ts.ts.out @@ -1,3 +1,2 @@ [WILDCARD]error TS2532: Object is possibly 'undefined'. - -► file:///[WILDCARD]cli/tests/error_017_hide_long_source_ts.ts:2:1 + at [WILDCARD]tests/error_017_hide_long_source_ts.ts:2:1 diff --git a/cli/tests/error_018_hide_long_source_js.js.out b/cli/tests/error_018_hide_long_source_js.js.out index dbdd924df..37265d659 100644 --- a/cli/tests/error_018_hide_long_source_js.js.out +++ b/cli/tests/error_018_hide_long_source_js.js.out @@ -1,3 +1,2 @@ error: Uncaught TypeError: Cannot read property 'a' of undefined -► file:///[WILDCARD]cli/tests/error_018_hide_long_source_js.js:2:206 at file:///[WILDCARD]cli/tests/error_018_hide_long_source_js.js:2:206 diff --git a/cli/tests/error_syntax.js.out b/cli/tests/error_syntax.js.out index 6253f3dd5..202e04a32 100644 --- a/cli/tests/error_syntax.js.out +++ b/cli/tests/error_syntax.js.out @@ -1,6 +1,4 @@ error: Uncaught SyntaxError: Unexpected identifier -[WILDCARD]tests/error_syntax.js:3:6 - -3 (the following is a syntax error ^^ ! ) - ~~~~~~~~~ - +(the following is a syntax error ^^ ! ) + ~~~~~~~~~ + at [WILDCARD]tests/error_syntax.js:3:6 diff --git a/cli/tests/error_syntax_empty_trailing_line.mjs.out b/cli/tests/error_syntax_empty_trailing_line.mjs.out index 1f1c96cd3..6e8a268e9 100644 --- a/cli/tests/error_syntax_empty_trailing_line.mjs.out +++ b/cli/tests/error_syntax_empty_trailing_line.mjs.out @@ -1,2 +1,2 @@ error: Uncaught SyntaxError: Unexpected end of input -► file:///[WILDCARD]cli/tests/error_syntax_empty_trailing_line.mjs:[WILDCARD] + at [WILDCARD]tests/error_syntax_empty_trailing_line.mjs:[WILDCARD] diff --git a/cli/tests/error_type_definitions.ts.out b/cli/tests/error_type_definitions.ts.out index 55d0e4dad..7fcbb9592 100644 --- a/cli/tests/error_type_definitions.ts.out +++ b/cli/tests/error_type_definitions.ts.out @@ -1,5 +1,4 @@ [WILDCARD]error: Uncaught URIError: relative import path "baz" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/type_definitions/bar.d.ts" -[WILDCARD]ops/dispatch_json.ts:[WILDCARD] at unwrapResponse ([WILDCARD]ops/dispatch_json.ts:[WILDCARD]) at Object.sendSync ([WILDCARD]ops/dispatch_json.ts:[WILDCARD]) at Object.resolveModules ([WILDCARD]ops/compiler.ts:[WILDCARD]) |