diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2018-10-25 06:26:21 +1100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-24 15:29:30 -0700 |
commit | 2cfa60832496902089b9d73d3954318aa8a1fe2a (patch) | |
tree | a5aa3682034f4d3e33d8e115874b576bcc0ffa13 /tests | |
parent | 0501330607b000e0913994e633b76410e1fd162c (diff) |
Support CheckJS
Diffstat (limited to 'tests')
-rw-r--r-- | tests/error_008_checkjs.js | 6 | ||||
-rw-r--r-- | tests/error_008_checkjs.js.out | 10 | ||||
-rw-r--r-- | tests/subdir/mt_application_ecmascript.j2.js | 4 | ||||
-rw-r--r-- | tests/subdir/mt_application_x_javascript.j4.js | 4 | ||||
-rw-r--r-- | tests/subdir/mt_javascript.js | 4 | ||||
-rw-r--r-- | tests/subdir/mt_text_ecmascript.j3.js | 4 | ||||
-rw-r--r-- | tests/subdir/mt_text_javascript.j1.js | 4 |
7 files changed, 21 insertions, 15 deletions
diff --git a/tests/error_008_checkjs.js b/tests/error_008_checkjs.js new file mode 100644 index 000000000..08d4873c7 --- /dev/null +++ b/tests/error_008_checkjs.js @@ -0,0 +1,6 @@ +// console.log intentionally misspelled to trigger a type error +consol.log("hello world!"); + +// the following error should be ignored and not output to the console +// @ts-ignore +const foo = new Foo(); diff --git a/tests/error_008_checkjs.js.out b/tests/error_008_checkjs.js.out new file mode 100644 index 000000000..9220efaf1 --- /dev/null +++ b/tests/error_008_checkjs.js.out @@ -0,0 +1,10 @@ +[96m[WILDCARD]/tests/error_008_checkjs.js[WILDCARD] - [91merror[0m[90m TS2552: [0mCannot find name 'consol'. Did you mean 'console'? + +[WILDCARD] consol.log("hello world!"); +[WILDCARD]~~~~~~[0m + + [96m$asset$/lib.deno_runtime.d.ts[WILDCARD] +[WILDCARD]declare const console: console_.Console; +[WILDCARD]~~~~~~~[0m +[WILDCARD]'console' is declared here. + diff --git a/tests/subdir/mt_application_ecmascript.j2.js b/tests/subdir/mt_application_ecmascript.j2.js index ec30e0595..e67d2a017 100644 --- a/tests/subdir/mt_application_ecmascript.j2.js +++ b/tests/subdir/mt_application_ecmascript.j2.js @@ -1,3 +1 @@ -define(["exports"], function(exports) { - exports.loaded = true; -}); +export const loaded = true; diff --git a/tests/subdir/mt_application_x_javascript.j4.js b/tests/subdir/mt_application_x_javascript.j4.js index ec30e0595..e67d2a017 100644 --- a/tests/subdir/mt_application_x_javascript.j4.js +++ b/tests/subdir/mt_application_x_javascript.j4.js @@ -1,3 +1 @@ -define(["exports"], function(exports) { - exports.loaded = true; -}); +export const loaded = true; diff --git a/tests/subdir/mt_javascript.js b/tests/subdir/mt_javascript.js index ec30e0595..e67d2a017 100644 --- a/tests/subdir/mt_javascript.js +++ b/tests/subdir/mt_javascript.js @@ -1,3 +1 @@ -define(["exports"], function(exports) { - exports.loaded = true; -}); +export const loaded = true; diff --git a/tests/subdir/mt_text_ecmascript.j3.js b/tests/subdir/mt_text_ecmascript.j3.js index ec30e0595..e67d2a017 100644 --- a/tests/subdir/mt_text_ecmascript.j3.js +++ b/tests/subdir/mt_text_ecmascript.j3.js @@ -1,3 +1 @@ -define(["exports"], function(exports) { - exports.loaded = true; -}); +export const loaded = true; diff --git a/tests/subdir/mt_text_javascript.j1.js b/tests/subdir/mt_text_javascript.j1.js index ec30e0595..e67d2a017 100644 --- a/tests/subdir/mt_text_javascript.j1.js +++ b/tests/subdir/mt_text_javascript.j1.js @@ -1,3 +1 @@ -define(["exports"], function(exports) { - exports.loaded = true; -}); +export const loaded = true; |