mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +00:00
refactor: Don't destructure the Deno namespace (#6268)
This commit is contained in:
parent
26bf56afda
commit
1fff6f55c3
111 changed files with 1632 additions and 1695 deletions
|
@ -1,9 +1,8 @@
|
|||
const { test } = Deno;
|
||||
import { assert, assertEquals, fail } from "../../testing/asserts.ts";
|
||||
import Dir from "./_fs_dir.ts";
|
||||
import Dirent from "./_fs_dirent.ts";
|
||||
|
||||
test({
|
||||
Deno.test({
|
||||
name: "Closing current directory with callback is successful",
|
||||
fn() {
|
||||
let calledBack = false;
|
||||
|
@ -16,21 +15,21 @@ test({
|
|||
},
|
||||
});
|
||||
|
||||
test({
|
||||
Deno.test({
|
||||
name: "Closing current directory without callback returns void Promise",
|
||||
async fn() {
|
||||
await new Dir(".").close();
|
||||
},
|
||||
});
|
||||
|
||||
test({
|
||||
Deno.test({
|
||||
name: "Closing current directory synchronously works",
|
||||
fn() {
|
||||
new Dir(".").closeSync();
|
||||
},
|
||||
});
|
||||
|
||||
test({
|
||||
Deno.test({
|
||||
name: "Path is correctly returned",
|
||||
fn() {
|
||||
assertEquals(new Dir("std/node").path, "std/node");
|
||||
|
@ -40,7 +39,7 @@ test({
|
|||
},
|
||||
});
|
||||
|
||||
test({
|
||||
Deno.test({
|
||||
name: "read returns null for empty directory",
|
||||
async fn() {
|
||||
const testDir: string = Deno.makeTempDirSync();
|
||||
|
@ -67,7 +66,7 @@ test({
|
|||
},
|
||||
});
|
||||
|
||||
test({
|
||||
Deno.test({
|
||||
name: "Async read returns one file at a time",
|
||||
async fn() {
|
||||
const testDir: string = Deno.makeTempDirSync();
|
||||
|
@ -108,7 +107,7 @@ test({
|
|||
},
|
||||
});
|
||||
|
||||
test({
|
||||
Deno.test({
|
||||
name: "Sync read returns one file at a time",
|
||||
fn() {
|
||||
const testDir: string = Deno.makeTempDirSync();
|
||||
|
@ -139,7 +138,7 @@ test({
|
|||
},
|
||||
});
|
||||
|
||||
test({
|
||||
Deno.test({
|
||||
name: "Async iteration over existing directory",
|
||||
async fn() {
|
||||
const testDir: string = Deno.makeTempDirSync();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue