summaryrefslogtreecommitdiff
path: root/tests/unit/files_test.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-08-16 00:30:06 +0100
committerGitHub <noreply@github.com>2024-08-15 23:30:06 +0000
commitb6c74aab240430fa70c057be825ce766d2314e02 (patch)
tree6e2b3f690411f41de77972339f4145d2c85b31b8 /tests/unit/files_test.ts
parenta58494483a2c618636697e05f9c799b03e405056 (diff)
Revert "test: run unit tests with DENO_FUTURE=1 (#24400)" (#25060)
This reverts commit 22a834ff5b4b312b8f91be8991f2b495d49fad2f. Appears this commit might have broken tests on `main`.
Diffstat (limited to 'tests/unit/files_test.ts')
-rw-r--r--tests/unit/files_test.ts74
1 files changed, 32 insertions, 42 deletions
diff --git a/tests/unit/files_test.ts b/tests/unit/files_test.ts
index 71c5a4561..754c6fb15 100644
--- a/tests/unit/files_test.ts
+++ b/tests/unit/files_test.ts
@@ -7,7 +7,6 @@ import {
assertEquals,
assertRejects,
assertThrows,
- DENO_FUTURE,
} from "./test_util.ts";
import { copy } from "@std/io/copy";
@@ -19,37 +18,31 @@ Deno.test(function filesStdioFileDescriptors() {
assertEquals(Deno.stderr.rid, 2);
});
-Deno.test(
- { ignore: DENO_FUTURE, permissions: { read: true } },
- async function filesCopyToStdout() {
- const filename = "tests/testdata/assets/fixture.json";
- using file = await Deno.open(filename);
- assert(file instanceof Deno.File);
- assert(file instanceof Deno.FsFile);
- assert(file.rid > 2);
- const bytesWritten = await copy(file, Deno.stdout);
- const fileSize = Deno.statSync(filename).size;
- assertEquals(bytesWritten, fileSize);
- },
-);
+Deno.test({ permissions: { read: true } }, async function filesCopyToStdout() {
+ const filename = "tests/testdata/assets/fixture.json";
+ using file = await Deno.open(filename);
+ assert(file instanceof Deno.File);
+ assert(file instanceof Deno.FsFile);
+ assert(file.rid > 2);
+ const bytesWritten = await copy(file, Deno.stdout);
+ const fileSize = Deno.statSync(filename).size;
+ assertEquals(bytesWritten, fileSize);
+});
-Deno.test(
- { ignore: DENO_FUTURE, permissions: { read: true } },
- async function filesIter() {
- const filename = "tests/testdata/assets/hello.txt";
- using file = await Deno.open(filename);
+Deno.test({ permissions: { read: true } }, async function filesIter() {
+ const filename = "tests/testdata/assets/hello.txt";
+ using file = await Deno.open(filename);
- let totalSize = 0;
- for await (const buf of Deno.iter(file)) {
- totalSize += buf.byteLength;
- }
+ let totalSize = 0;
+ for await (const buf of Deno.iter(file)) {
+ totalSize += buf.byteLength;
+ }
- assertEquals(totalSize, 12);
- },
-);
+ assertEquals(totalSize, 12);
+});
Deno.test(
- { ignore: DENO_FUTURE, permissions: { read: true } },
+ { permissions: { read: true } },
async function filesIterCustomBufSize() {
const filename = "tests/testdata/assets/hello.txt";
using file = await Deno.open(filename);
@@ -66,23 +59,20 @@ Deno.test(
},
);
-Deno.test(
- { ignore: DENO_FUTURE, permissions: { read: true } },
- function filesIterSync() {
- const filename = "tests/testdata/assets/hello.txt";
- using file = Deno.openSync(filename);
+Deno.test({ permissions: { read: true } }, function filesIterSync() {
+ const filename = "tests/testdata/assets/hello.txt";
+ using file = Deno.openSync(filename);
- let totalSize = 0;
- for (const buf of Deno.iterSync(file)) {
- totalSize += buf.byteLength;
- }
+ let totalSize = 0;
+ for (const buf of Deno.iterSync(file)) {
+ totalSize += buf.byteLength;
+ }
- assertEquals(totalSize, 12);
- },
-);
+ assertEquals(totalSize, 12);
+});
Deno.test(
- { ignore: DENO_FUTURE, permissions: { read: true } },
+ { permissions: { read: true } },
function filesIterSyncCustomBufSize() {
const filename = "tests/testdata/assets/hello.txt";
using file = Deno.openSync(filename);
@@ -99,7 +89,7 @@ Deno.test(
},
);
-Deno.test({ ignore: DENO_FUTURE }, async function readerIter() {
+Deno.test(async function readerIter() {
// ref: https://github.com/denoland/deno/issues/2330
const encoder = new TextEncoder();
@@ -134,7 +124,7 @@ Deno.test({ ignore: DENO_FUTURE }, async function readerIter() {
assertEquals(totalSize, 12);
});
-Deno.test({ ignore: DENO_FUTURE }, async function readerIterSync() {
+Deno.test(async function readerIterSync() {
// ref: https://github.com/denoland/deno/issues/2330
const encoder = new TextEncoder();