mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 12:49:10 +00:00
refactor(cli/tests): remove unnecessary void return types (#11577)
This commit is contained in:
parent
299c7cfe54
commit
3f0cf9619f
121 changed files with 1095 additions and 1177 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue