diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/016_double_await.ts | 6 | ||||
-rw-r--r-- | tests/cat.ts | 2 | ||||
-rw-r--r-- | tests/echo_server.ts | 2 | ||||
-rw-r--r-- | tests/exit_error42.ts | 4 | ||||
-rw-r--r-- | tests/http_bench.ts | 7 | ||||
-rw-r--r-- | tests/is_tty.ts | 3 | ||||
-rw-r--r-- | tests/types.out | 7 | ||||
-rw-r--r-- | tests/unbuffered_stderr.ts | 2 | ||||
-rw-r--r-- | tests/unbuffered_stdout.ts | 2 |
9 files changed, 15 insertions, 20 deletions
diff --git a/tests/016_double_await.ts b/tests/016_double_await.ts index 367767736..12dfeeba4 100644 --- a/tests/016_double_await.ts +++ b/tests/016_double_await.ts @@ -1,10 +1,8 @@ -import * as deno from "deno"; - // This is to test if Deno would die at 2nd await // See https://github.com/denoland/deno/issues/919 (async () => { - const currDirInfo = await deno.stat("."); - const parentDirInfo = await deno.stat(".."); + const currDirInfo = await Deno.stat("."); + const parentDirInfo = await Deno.stat(".."); console.log(currDirInfo.isDirectory()); console.log(parentDirInfo.isFile()); })(); diff --git a/tests/cat.ts b/tests/cat.ts index 66df14794..deb2be2f3 100644 --- a/tests/cat.ts +++ b/tests/cat.ts @@ -1,4 +1,4 @@ -import { stdout, open, copy, args } from "deno"; +const { stdout, open, copy, args } = Deno; async function main() { for (let i = 1; i < args.length; i++) { diff --git a/tests/echo_server.ts b/tests/echo_server.ts index 7761c1ad7..15c3112ce 100644 --- a/tests/echo_server.ts +++ b/tests/echo_server.ts @@ -1,4 +1,4 @@ -import { args, listen, copy } from "deno"; +const { args, listen, copy } = Deno; const addr = args[1] || "127.0.0.1:4544"; const listener = listen("tcp", addr); console.log("listening on", addr); diff --git a/tests/exit_error42.ts b/tests/exit_error42.ts index c55cf0ece..e4db41f3a 100644 --- a/tests/exit_error42.ts +++ b/tests/exit_error42.ts @@ -1,5 +1,3 @@ -import * as deno from "deno"; - console.log("before"); -deno.exit(42); +Deno.exit(42); console.log("after"); diff --git a/tests/http_bench.ts b/tests/http_bench.ts index 0c7970691..5b61bd4cd 100644 --- a/tests/http_bench.ts +++ b/tests/http_bench.ts @@ -2,14 +2,13 @@ // TODO Replace this with a real HTTP server once // https://github.com/denoland/deno/issues/726 is completed. // Note: this is a keep-alive server. -import * as deno from "deno"; -const addr = deno.args[1] || "127.0.0.1:4500"; -const listener = deno.listen("tcp", addr); +const addr = Deno.args[1] || "127.0.0.1:4500"; +const listener = Deno.listen("tcp", addr); const response = new TextEncoder().encode( "HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\nHello World\n" ); -async function handle(conn: deno.Conn): Promise<void> { +async function handle(conn: Deno.Conn): Promise<void> { const buffer = new Uint8Array(1024); try { while (true) { diff --git a/tests/is_tty.ts b/tests/is_tty.ts index a571aee18..2e3fdb49f 100644 --- a/tests/is_tty.ts +++ b/tests/is_tty.ts @@ -1,2 +1 @@ -import { isTTY } from "deno"; -console.log(isTTY().stdin); +console.log(Deno.isTTY().stdin); diff --git a/tests/types.out b/tests/types.out index 375087051..b07e10762 100644 --- a/tests/types.out +++ b/tests/types.out @@ -2,13 +2,14 @@ /// <reference no-default-lib="true" /> /// <reference lib="esnext" /> -[WILDCARD] -declare module "deno" { + +declare namespace Deno { [WILDCARD] } - +[WILDCARD] declare interface Window { [WILDCARD] + Deno: typeof Deno; } declare const window: Window; diff --git a/tests/unbuffered_stderr.ts b/tests/unbuffered_stderr.ts index df6b0ceb5..f4bceb1fc 100644 --- a/tests/unbuffered_stderr.ts +++ b/tests/unbuffered_stderr.ts @@ -1,3 +1,3 @@ -import { stderr } from "deno"; +const { stderr } = Deno; stderr.write(new TextEncoder().encode("x")); diff --git a/tests/unbuffered_stdout.ts b/tests/unbuffered_stdout.ts index 9c2c2d725..fdb1a0e23 100644 --- a/tests/unbuffered_stdout.ts +++ b/tests/unbuffered_stdout.ts @@ -1,3 +1,3 @@ -import { stdout } from "deno"; +const { stdout } = Deno; stdout.write(new TextEncoder().encode("a")); |