From 80e22111416751ce34dbc5cb32ffa9f293517370 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 30 Apr 2020 17:23:40 +0200 Subject: Unstable methods should not appear in runtime or d.ts (#4957) Co-authored-by: Kitson Kelly --- std/examples/chat/server_test.ts | 9 ++++++++- std/fs/empty_dir_test.ts | 3 ++- std/fs/exists_test.ts | 3 ++- std/fs/expand_glob_test.ts | 2 +- std/http/file_server_test.ts | 19 +++++++++++++++++-- std/http/racing_server_test.ts | 3 ++- 6 files changed, 32 insertions(+), 7 deletions(-) (limited to 'std') diff --git a/std/examples/chat/server_test.ts b/std/examples/chat/server_test.ts index 1aba4208a..76b1f1bf5 100644 --- a/std/examples/chat/server_test.ts +++ b/std/examples/chat/server_test.ts @@ -9,7 +9,14 @@ const { test } = Deno; async function startServer(): Promise { const server = Deno.run({ - cmd: [Deno.execPath(), "--allow-net", "--allow-read", "server.ts"], + // TODO(lucacasonato): remove unstable once possible + cmd: [ + Deno.execPath(), + "--allow-net", + "--allow-read", + "--unstable", + "server.ts", + ], cwd: "examples/chat", stdout: "piped", }); diff --git a/std/fs/empty_dir_test.ts b/std/fs/empty_dir_test.ts index b3be1f617..254cf590f 100644 --- a/std/fs/empty_dir_test.ts +++ b/std/fs/empty_dir_test.ts @@ -203,7 +203,8 @@ for (const s of scenes) { ); try { - const args = [Deno.execPath(), "run"]; + // TODO(lucacasonato): remove unstable when stabilized + const args = [Deno.execPath(), "run", "--unstable"]; if (s.read) { args.push("--allow-read"); diff --git a/std/fs/exists_test.ts b/std/fs/exists_test.ts index 04c58d8d6..191289d88 100644 --- a/std/fs/exists_test.ts +++ b/std/fs/exists_test.ts @@ -112,7 +112,8 @@ for (const s of scenes) { let title = `test ${s.async ? "exists" : "existsSync"}("testdata/${s.file}")`; title += ` ${s.read ? "with" : "without"} --allow-read`; Deno.test(`[fs] existsPermission ${title}`, async function (): Promise { - const args = [Deno.execPath(), "run"]; + // TODO(lucacasonato): remove unstable when stabilized + const args = [Deno.execPath(), "run", "--unstable"]; if (s.read) { args.push("--allow-read"); diff --git a/std/fs/expand_glob_test.ts b/std/fs/expand_glob_test.ts index 4a1adc308..697c8bf98 100644 --- a/std/fs/expand_glob_test.ts +++ b/std/fs/expand_glob_test.ts @@ -115,7 +115,7 @@ Deno.test("expandGlobIncludeDirs", async function (): Promise { Deno.test("expandGlobPermError", async function (): Promise { const exampleUrl = new URL("testdata/expand_wildcard.js", import.meta.url); const p = run({ - cmd: [execPath(), exampleUrl.toString()], + cmd: [execPath(), "--unstable", exampleUrl.toString()], stdin: "null", stdout: "piped", stderr: "piped", diff --git a/std/http/file_server_test.ts b/std/http/file_server_test.ts index 8be35621c..d471c1519 100644 --- a/std/http/file_server_test.ts +++ b/std/http/file_server_test.ts @@ -12,6 +12,7 @@ async function startFileServer(): Promise { cmd: [ Deno.execPath(), "run", + "--unstable", "--allow-read", "--allow-net", "http/file_server.ts", @@ -105,7 +106,14 @@ test("serveWithUnorthodoxFilename", async function (): Promise { test("servePermissionDenied", async function (): Promise { const deniedServer = Deno.run({ - cmd: [Deno.execPath(), "run", "--allow-net", "http/file_server.ts"], + // TODO(lucacasonato): remove unstable when stabilized + cmd: [ + Deno.execPath(), + "run", + "--unstable", + "--allow-net", + "http/file_server.ts", + ], stdout: "piped", stderr: "piped", }); @@ -132,7 +140,14 @@ test("servePermissionDenied", async function (): Promise { test("printHelp", async function (): Promise { const helpProcess = Deno.run({ - cmd: [Deno.execPath(), "run", "http/file_server.ts", "--help"], + // TODO(lucacasonato): remove unstable when stabilized + cmd: [ + Deno.execPath(), + "run", + "--unstable", + "http/file_server.ts", + "--help", + ], stdout: "piped", }); assert(helpProcess.stdout != null); diff --git a/std/http/racing_server_test.ts b/std/http/racing_server_test.ts index 90961f7f8..845e5a490 100644 --- a/std/http/racing_server_test.ts +++ b/std/http/racing_server_test.ts @@ -6,7 +6,8 @@ const { connect, run, test } = Deno; let server: Deno.Process; async function startServer(): Promise { server = run({ - cmd: [Deno.execPath(), "run", "-A", "http/racing_server.ts"], + // TODO(lucacasonato): remove unstable when stabilized + cmd: [Deno.execPath(), "run", "--unstable", "-A", "http/racing_server.ts"], stdout: "piped", }); // Once racing server is ready it will write to its stdout. -- cgit v1.2.3