diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/012_async.ts | 4 | ||||
-rw-r--r-- | tests/017_import_redirect.ts | 1 | ||||
-rw-r--r-- | tests/018_async_catch.ts | 4 | ||||
-rw-r--r-- | tests/019_media_types.ts | 1 | ||||
-rw-r--r-- | tests/async_error.ts | 2 | ||||
-rw-r--r-- | tests/cat.ts | 2 | ||||
-rw-r--r-- | tests/error_001.ts | 4 | ||||
-rw-r--r-- | tests/error_002.ts | 2 | ||||
-rw-r--r-- | tests/error_004_missing_module.ts | 1 | ||||
-rw-r--r-- | tests/error_005_missing_dynamic_import.ts | 1 | ||||
-rw-r--r-- | tests/error_008_checkjs.js | 2 | ||||
-rw-r--r-- | tests/fetch_deps.ts | 2 | ||||
-rw-r--r-- | tests/https_import.ts | 1 |
13 files changed, 13 insertions, 14 deletions
diff --git a/tests/012_async.ts b/tests/012_async.ts index 57ae355c2..12df73b3e 100644 --- a/tests/012_async.ts +++ b/tests/012_async.ts @@ -1,6 +1,6 @@ // Check that we can use the async keyword. -async function main() { - await new Promise((resolve, reject) => { +async function main(): Promise<void> { + await new Promise(resolve => { console.log("2"); setTimeout(resolve, 100); }); diff --git a/tests/017_import_redirect.ts b/tests/017_import_redirect.ts index 22003e9dc..1265dd4ed 100644 --- a/tests/017_import_redirect.ts +++ b/tests/017_import_redirect.ts @@ -1,5 +1,4 @@ // http -> https redirect would happen: -// tslint:disable-next-line:max-line-length import { printHello } from "http://gist.githubusercontent.com/ry/f12b2aa3409e6b52645bc346a9e22929/raw/79318f239f51d764384a8bded8d7c6a833610dde/print_hello.ts"; printHello(); diff --git a/tests/018_async_catch.ts b/tests/018_async_catch.ts index b073654d9..f59c22ee2 100644 --- a/tests/018_async_catch.ts +++ b/tests/018_async_catch.ts @@ -1,7 +1,7 @@ -async function fn() { +async function fn(): Promise<never> { throw new Error("message"); } -async function call() { +async function call(): Promise<void> { try { console.log("before await fn()"); await fn(); diff --git a/tests/019_media_types.ts b/tests/019_media_types.ts index 90eca80bf..5f1f862a0 100644 --- a/tests/019_media_types.ts +++ b/tests/019_media_types.ts @@ -2,7 +2,6 @@ // based on the URL containing `.t#.` strings, which exercises the different // mapping of media types end to end. -// tslint:disable:max-line-length import { loaded as loadedTs1 } from "http://localhost:4545/tests/subdir/mt_text_typescript.t1.ts"; import { loaded as loadedTs2 } from "http://localhost:4545/tests/subdir/mt_video_vdn.t2.ts"; import { loaded as loadedTs3 } from "http://localhost:4545/tests/subdir/mt_video_mp2t.t3.ts"; diff --git a/tests/async_error.ts b/tests/async_error.ts index 7ce25d0cb..81c983a50 100644 --- a/tests/async_error.ts +++ b/tests/async_error.ts @@ -1,5 +1,5 @@ console.log("hello"); -const foo = async () => { +const foo = async (): Promise<never> => { console.log("before error"); throw Error("error"); }; diff --git a/tests/cat.ts b/tests/cat.ts index deb2be2f3..756238be6 100644 --- a/tests/cat.ts +++ b/tests/cat.ts @@ -1,6 +1,6 @@ const { stdout, open, copy, args } = Deno; -async function main() { +async function main(): Promise<void> { for (let i = 1; i < args.length; i++) { const filename = args[i]; const file = await open(filename); diff --git a/tests/error_001.ts b/tests/error_001.ts index ab6e17a52..f06f80cb4 100644 --- a/tests/error_001.ts +++ b/tests/error_001.ts @@ -1,8 +1,8 @@ -function foo() { +function foo(): never { throw Error("bad"); } -function bar() { +function bar(): void { foo(); } diff --git a/tests/error_002.ts b/tests/error_002.ts index 6aa0fcc3b..eb66764b7 100644 --- a/tests/error_002.ts +++ b/tests/error_002.ts @@ -1,6 +1,6 @@ import { throwsError } from "./subdir/mod1.ts"; -function foo() { +function foo(): void { throwsError(); } diff --git a/tests/error_004_missing_module.ts b/tests/error_004_missing_module.ts index 48623320b..e74d6b821 100644 --- a/tests/error_004_missing_module.ts +++ b/tests/error_004_missing_module.ts @@ -1 +1,2 @@ +// eslint-disable-next-line import * as badModule from "bad-module.ts"; diff --git a/tests/error_005_missing_dynamic_import.ts b/tests/error_005_missing_dynamic_import.ts index 3cb081a27..437473b63 100644 --- a/tests/error_005_missing_dynamic_import.ts +++ b/tests/error_005_missing_dynamic_import.ts @@ -1,3 +1,4 @@ (async () => { + // eslint-disable-next-line const badModule = await import("bad-module.ts"); })(); diff --git a/tests/error_008_checkjs.js b/tests/error_008_checkjs.js index 08d4873c7..628d3e376 100644 --- a/tests/error_008_checkjs.js +++ b/tests/error_008_checkjs.js @@ -2,5 +2,5 @@ consol.log("hello world!"); // the following error should be ignored and not output to the console -// @ts-ignore +// eslint-disable-next-line const foo = new Foo(); diff --git a/tests/fetch_deps.ts b/tests/fetch_deps.ts index 08743e36b..530a56283 100644 --- a/tests/fetch_deps.ts +++ b/tests/fetch_deps.ts @@ -2,7 +2,7 @@ import { assert } from "../js/deps/https/deno.land/std/testing/asserts.ts"; // TODO Top level await https://github.com/denoland/deno/issues/471 -async function main() { +async function main(): Promise<void> { const response = await fetch("http://localhost:4545/package.json"); const json = await response.json(); const deps = Object.keys(json.devDependencies); diff --git a/tests/https_import.ts b/tests/https_import.ts index 0a5cea3d1..faaf2175f 100644 --- a/tests/https_import.ts +++ b/tests/https_import.ts @@ -1,6 +1,5 @@ // TODO Use https://localhost:4555/ but we need more infrastructure to // support verifying self-signed certificates. -// tslint:disable-next-line:max-line-length import { printHello } from "https://gist.githubusercontent.com/ry/f12b2aa3409e6b52645bc346a9e22929/raw/79318f239f51d764384a8bded8d7c6a833610dde/print_hello.ts"; printHello(); |