diff --git a/fs/empty_dir_test.ts b/fs/empty_dir_test.ts index 77e98c0ce7f5..b9145767e1b2 100644 --- a/fs/empty_dir_test.ts +++ b/fs/empty_dir_test.ts @@ -2,6 +2,7 @@ import { test } from "../testing/mod.ts"; import { assertEquals, + assertStrContains, assertThrows, assertThrowsAsync } from "../testing/asserts.ts"; @@ -227,7 +228,7 @@ test(async function emptyDirPermission(): Promise { const output = await Deno.readAll(stdout); - assertEquals(new TextDecoder().decode(output), s.output); + assertStrContains(new TextDecoder().decode(output), s.output); } } catch (err) { await Deno.remove(testfolder, { recursive: true }); diff --git a/fs/exists_test.ts b/fs/exists_test.ts index b8c968a0286f..c7c7dc54e969 100644 --- a/fs/exists_test.ts +++ b/fs/exists_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { test } from "../testing/mod.ts"; -import { assertEquals } from "../testing/asserts.ts"; +import { assertEquals, assertStrContains } from "../testing/asserts.ts"; import * as path from "../path/mod.ts"; import { exists, existsSync } from "./exists.ts"; @@ -134,7 +134,7 @@ test(async function existsPermission(): Promise { const output = await Deno.readAll(stdout); - assertEquals(new TextDecoder().decode(output), s.output); + assertStrContains(new TextDecoder().decode(output), s.output); } // done diff --git a/http/file_server_test.ts b/http/file_server_test.ts index 170979b614c0..12a5b671f861 100644 --- a/http/file_server_test.ts +++ b/http/file_server_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { test } from "../testing/mod.ts"; -import { assert, assertEquals } from "../testing/asserts.ts"; +import { assert, assertEquals, assertStrContains } from "../testing/asserts.ts"; import { BufReader } from "../io/bufio.ts"; import { TextProtoReader } from "../textproto/mod.ts"; @@ -109,8 +109,8 @@ test(async function servePermissionDenied(): Promise { try { await fetch("http://localhost:4500/"); - assertEquals( - await errReader.readLine(), + assertStrContains( + (await errReader.readLine()) as string, "run again with the --allow-read flag" ); } finally { diff --git a/manual.md b/manual.md index 2fa93718f114..f29256bd96d7 100644 --- a/manual.md +++ b/manual.md @@ -229,7 +229,7 @@ When this program is started, it throws PermissionDenied error. ```shell $ deno https://deno.land/std/examples/echo_server.ts -error: Uncaught PermissionDenied: run again with the --allow-net flag +error: Uncaught PermissionDenied: network access to "0.0.0.0:8080", run again with the --allow-net flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) ... @@ -329,7 +329,7 @@ This is an example to restrict file system access by whitelist. ```shell $ deno --allow-read=/usr https://deno.land/std/examples/cat.ts /etc/passwd -error: Uncaught PermissionDenied: run again with the --allow-read flag +error: Uncaught PermissionDenied: read access to "/etc/passwd", run again with the --allow-read flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) ...