summaryrefslogtreecommitdiff
path: root/cli/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit')
-rw-r--r--cli/tests/unit/http_test.ts20
-rw-r--r--cli/tests/unit/net_test.ts2
-rw-r--r--cli/tests/unit/timers_test.ts21
-rw-r--r--cli/tests/unit/tty_color_test.ts21
4 files changed, 33 insertions, 31 deletions
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts
index e8976c06d..83fa6116c 100644
--- a/cli/tests/unit/http_test.ts
+++ b/cli/tests/unit/http_test.ts
@@ -1180,7 +1180,7 @@ const decoder = new TextDecoder();
Deno.test({
name: "http server compresses body",
- permissions: { net: true },
+ permissions: { net: true, run: true },
async fn() {
const hostname = "localhost";
const port = 4501;
@@ -1231,7 +1231,7 @@ Deno.test({
Deno.test({
name: "http server doesn't compress small body",
- permissions: { net: true },
+ permissions: { net: true, run: true },
async fn() {
const hostname = "localhost";
const port = 4501;
@@ -1282,7 +1282,7 @@ Deno.test({
Deno.test({
name: "http server respects accept-encoding weights",
- permissions: { net: true },
+ permissions: { net: true, run: true },
async fn() {
const hostname = "localhost";
const port = 4501;
@@ -1336,7 +1336,7 @@ Deno.test({
Deno.test({
name: "http server augments vary header",
- permissions: { net: true },
+ permissions: { net: true, run: true },
async fn() {
const hostname = "localhost";
const port = 4501;
@@ -1387,7 +1387,7 @@ Deno.test({
Deno.test({
name: "http server weakens etag header",
- permissions: { net: true },
+ permissions: { net: true, run: true },
async fn() {
const hostname = "localhost";
const port = 4501;
@@ -1444,7 +1444,7 @@ Deno.test({
Deno.test({
name: "http server passes through weak etag header",
- permissions: { net: true },
+ permissions: { net: true, run: true },
async fn() {
const hostname = "localhost";
const port = 4501;
@@ -1501,7 +1501,7 @@ Deno.test({
Deno.test({
name: "http server doesn't compress body when no-transform is set",
- permissions: { net: true },
+ permissions: { net: true, run: true },
async fn() {
const hostname = "localhost";
const port = 4501;
@@ -1555,7 +1555,7 @@ Deno.test({
Deno.test({
name: "http server doesn't compress body when content-range is set",
- permissions: { net: true },
+ permissions: { net: true, run: true },
async fn() {
const hostname = "localhost";
const port = 4501;
@@ -1609,7 +1609,7 @@ Deno.test({
Deno.test({
name: "http server doesn't compress streamed bodies",
- permissions: { net: true },
+ permissions: { net: true, run: true },
async fn() {
const hostname = "localhost";
const port = 4501;
@@ -1675,7 +1675,7 @@ Deno.test({
Deno.test({
name: "http server updates content-length header if compression is applied",
- permissions: { net: true },
+ permissions: { net: true, run: true },
async fn() {
const hostname = "localhost";
const port = 4501;
diff --git a/cli/tests/unit/net_test.ts b/cli/tests/unit/net_test.ts
index 29e823b10..6769f6301 100644
--- a/cli/tests/unit/net_test.ts
+++ b/cli/tests/unit/net_test.ts
@@ -380,7 +380,7 @@ Deno.test(
);
Deno.test(
- { permissions: { net: true } },
+ { permissions: { net: true }, ignore: true },
async function netUdpSendReceiveBroadcast() {
// Must bind sender to an address that can send to the broadcast address on MacOS.
// Macos will give us error 49 when sending the broadcast packet if we omit hostname here.
diff --git a/cli/tests/unit/timers_test.ts b/cli/tests/unit/timers_test.ts
index 5b9e1fa48..ef7dc9eef 100644
--- a/cli/tests/unit/timers_test.ts
+++ b/cli/tests/unit/timers_test.ts
@@ -579,7 +579,7 @@ Deno.test(
Deno.test({
name: "unrefTimer",
- permissions: { run: true },
+ permissions: { run: true, read: true },
fn: async () => {
const [statusCode, output] = await execCode(`
const timer = setTimeout(() => console.log("1"));
@@ -592,7 +592,7 @@ Deno.test({
Deno.test({
name: "unrefTimer - mix ref and unref 1",
- permissions: { run: true },
+ permissions: { run: true, read: true },
fn: async () => {
const [statusCode, output] = await execCode(`
const timer1 = setTimeout(() => console.log("1"), 200);
@@ -607,7 +607,7 @@ Deno.test({
Deno.test({
name: "unrefTimer - mix ref and unref 2",
- permissions: { run: true },
+ permissions: { run: true, read: true },
fn: async () => {
const [statusCode, output] = await execCode(`
const timer1 = setTimeout(() => console.log("1"), 200);
@@ -623,7 +623,7 @@ Deno.test({
Deno.test({
name: "unrefTimer - unref interval",
- permissions: { run: true },
+ permissions: { run: true, read: true },
fn: async () => {
const [statusCode, output] = await execCode(`
let i = 0;
@@ -642,7 +642,7 @@ Deno.test({
Deno.test({
name: "unrefTimer - unref then ref 1",
- permissions: { run: true },
+ permissions: { run: true, read: true },
fn: async () => {
const [statusCode, output] = await execCode(`
const timer1 = setTimeout(() => console.log("1"), 10);
@@ -656,7 +656,7 @@ Deno.test({
Deno.test({
name: "unrefTimer - unref then ref",
- permissions: { run: true },
+ permissions: { run: true, read: true },
fn: async () => {
const [statusCode, output] = await execCode(`
const timer1 = setTimeout(() => {
@@ -673,7 +673,6 @@ Deno.test({
Deno.test({
name: "unrefTimer - invalid calls do nothing",
- permissions: { run: true },
fn: () => {
Deno.unrefTimer(NaN);
Deno.refTimer(NaN);
@@ -682,7 +681,7 @@ Deno.test({
Deno.test({
name: "AbortSignal.timeout() with no listeners",
- permissions: { run: true },
+ permissions: { run: true, read: true },
fn: async () => {
const [statusCode, output] = await execCode(`
const signal = AbortSignal.timeout(2000);
@@ -699,7 +698,7 @@ Deno.test({
Deno.test({
name: "AbortSignal.timeout() with listeners",
- permissions: { run: true },
+ permissions: { run: true, read: true },
fn: async () => {
const [statusCode, output] = await execCode(`
const signal = AbortSignal.timeout(1000);
@@ -712,7 +711,7 @@ Deno.test({
Deno.test({
name: "AbortSignal.timeout() with removed listeners",
- permissions: { run: true },
+ permissions: { run: true, read: true },
fn: async () => {
const [statusCode, output] = await execCode(`
const signal = AbortSignal.timeout(2000);
@@ -736,7 +735,7 @@ Deno.test({
Deno.test({
name: "AbortSignal.timeout() with listener for a non-abort event",
- permissions: { run: true },
+ permissions: { run: true, read: true },
fn: async () => {
const [statusCode, output] = await execCode(`
const signal = AbortSignal.timeout(2000);
diff --git a/cli/tests/unit/tty_color_test.ts b/cli/tests/unit/tty_color_test.ts
index d64c278bf..c10c9ff1e 100644
--- a/cli/tests/unit/tty_color_test.ts
+++ b/cli/tests/unit/tty_color_test.ts
@@ -3,12 +3,15 @@ import { assertEquals } from "./test_util.ts";
// Note tests for Deno.setRaw is in integration tests.
-Deno.test({ permissions: { run: true } }, async function noColorIfNotTty() {
- const p = Deno.run({
- cmd: [Deno.execPath(), "eval", "console.log(1)"],
- stdout: "piped",
- });
- const output = new TextDecoder().decode(await p.output());
- assertEquals(output, "1\n");
- p.close();
-});
+Deno.test(
+ { permissions: { run: true, read: true } },
+ async function noColorIfNotTty() {
+ const p = Deno.run({
+ cmd: [Deno.execPath(), "eval", "console.log(1)"],
+ stdout: "piped",
+ });
+ const output = new TextDecoder().decode(await p.output());
+ assertEquals(output, "1\n");
+ p.close();
+ },
+);