diff options
author | Samrith Shankar <samrith-s@users.noreply.github.com> | 2020-03-20 14:38:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-20 09:38:34 -0400 |
commit | 798904b0f2ed0c7284b67bba2f125f406b5850de (patch) | |
tree | 5aba8d35aa8984aa778c894258bcaed56f1ce17c /cli/tests | |
parent | 35f6e2e45ddb96524a6bdf54b0a6155caa88d5e0 (diff) |
Add require-await lint rule (#4401)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/018_async_catch.ts | 2 | ||||
-rw-r--r-- | cli/tests/async_error.ts | 1 | ||||
-rw-r--r-- | cli/tests/async_error.ts.out | 8 | ||||
-rw-r--r-- | cli/tests/permission_test.ts | 3 | ||||
-rw-r--r-- | cli/tests/top_level_for_await.js | 2 | ||||
-rw-r--r-- | cli/tests/top_level_for_await.ts | 1 |
6 files changed, 10 insertions, 7 deletions
diff --git a/cli/tests/018_async_catch.ts b/cli/tests/018_async_catch.ts index 0d034d798..a16f11696 100644 --- a/cli/tests/018_async_catch.ts +++ b/cli/tests/018_async_catch.ts @@ -1,4 +1,4 @@ -async function fn(): Promise<never> { +function fn(): Promise<never> { throw new Error("message"); } async function call(): Promise<void> { diff --git a/cli/tests/async_error.ts b/cli/tests/async_error.ts index 81c983a50..b37369bac 100644 --- a/cli/tests/async_error.ts +++ b/cli/tests/async_error.ts @@ -1,4 +1,5 @@ console.log("hello"); +// eslint-disable-next-line require-await const foo = async (): Promise<never> => { console.log("before error"); throw Error("error"); diff --git a/cli/tests/async_error.ts.out b/cli/tests/async_error.ts.out index d07ba8cfe..6e22799c2 100644 --- a/cli/tests/async_error.ts.out +++ b/cli/tests/async_error.ts.out @@ -2,10 +2,10 @@ before error world error: Uncaught Error: error -[WILDCARD]tests/async_error.ts:4:9 +[WILDCARD]tests/async_error.ts:5:9 -4 throw Error("error"); +5 throw Error("error"); ^ - at foo ([WILDCARD]tests/async_error.ts:4:9) - at [WILDCARD]tests/async_error.ts:7:1 + at foo ([WILDCARD]tests/async_error.ts:5:9) + at [WILDCARD]tests/async_error.ts:8:1 diff --git a/cli/tests/permission_test.ts b/cli/tests/permission_test.ts index 763e429b6..11b95cf3a 100644 --- a/cli/tests/permission_test.ts +++ b/cli/tests/permission_test.ts @@ -3,8 +3,9 @@ const { args, listen, env, exit, makeTempDirSync, readFileSync, run } = Deno; const name = args[0]; const test: { [key: string]: Function } = { - async readRequired(): Promise<void> { + readRequired(): Promise<void> { readFileSync("README.md"); + return Promise.resolve(); }, writeRequired(): void { makeTempDirSync(); diff --git a/cli/tests/top_level_for_await.js b/cli/tests/top_level_for_await.js index fa3b496a8..54742ce52 100644 --- a/cli/tests/top_level_for_await.js +++ b/cli/tests/top_level_for_await.js @@ -1,4 +1,4 @@ -async function* asyncGenerator() { +function* asyncGenerator() { let i = 0; while (i < 3) { yield i++; diff --git a/cli/tests/top_level_for_await.ts b/cli/tests/top_level_for_await.ts index 9179322d7..92d8af30a 100644 --- a/cli/tests/top_level_for_await.ts +++ b/cli/tests/top_level_for_await.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line require-await async function* asyncGenerator(): AsyncIterableIterator<number> { let i = 0; while (i < 3) { |