refactor(cli/tests): remove unnecessary void return types (#11577)

This commit is contained in:
Leo K 2021-08-05 13:08:58 +02:00 committed by GitHub
parent 299c7cfe54
commit 3f0cf9619f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
121 changed files with 1095 additions and 1177 deletions

View file

@ -1,13 +1,13 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
import { assert, assertEquals, assertThrows, unitTest } from "./test_util.ts";
unitTest({ perms: { read: true } }, function dirCwdNotNull(): void {
unitTest({ perms: { read: true } }, function dirCwdNotNull() {
assert(Deno.cwd() != null);
});
unitTest(
{ perms: { read: true, write: true } },
function dirCwdChdirSuccess(): void {
function dirCwdChdirSuccess() {
const initialdir = Deno.cwd();
const path = Deno.makeTempDirSync();
Deno.chdir(path);
@ -21,7 +21,7 @@ unitTest(
},
);
unitTest({ perms: { read: true, write: true } }, function dirCwdError(): void {
unitTest({ perms: { read: true, write: true } }, function dirCwdError() {
// excluding windows since it throws resource busy, while removeSync
if (["linux", "darwin"].includes(Deno.build.os)) {
const initialdir = Deno.cwd();
@ -38,7 +38,7 @@ unitTest({ perms: { read: true, write: true } }, function dirCwdError(): void {
}
});
unitTest({ perms: { read: false } }, function dirCwdPermError(): void {
unitTest({ perms: { read: false } }, function dirCwdPermError() {
assertThrows(
() => {
Deno.cwd();
@ -50,7 +50,7 @@ unitTest({ perms: { read: false } }, function dirCwdPermError(): void {
unitTest(
{ perms: { read: true, write: true } },
function dirChdirError(): void {
function dirChdirError() {
const path = Deno.makeTempDirSync() + "test";
assertThrows(() => {
Deno.chdir(path);