diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-02-19 01:27:44 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 07:27:44 -0700 |
commit | c1fac11dfaf9d656b7361708d9faab1916eac846 (patch) | |
tree | 151c729aa2774c21924b0bb8a1c6aa6daffea854 /tests/unit/files_test.ts | |
parent | 7abd72a80f0aafe071ad7d298b48e0da741cc9f3 (diff) |
feat(fs): `Deno.FsFile.{isTerminal,setRaw}()` (#22234)
Closes #22229.
---------
Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Diffstat (limited to 'tests/unit/files_test.ts')
-rw-r--r-- | tests/unit/files_test.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/files_test.ts b/tests/unit/files_test.ts index 47fa03ddd..0034a8472 100644 --- a/tests/unit/files_test.ts +++ b/tests/unit/files_test.ts @@ -10,6 +10,8 @@ import { } from "./test_util.ts"; import { copy } from "@std/streams/copy.ts"; +// Note tests for Deno.FsFile.setRaw is in integration tests. + Deno.test(function filesStdioFileDescriptors() { assertEquals(Deno.stdin.rid, 0); assertEquals(Deno.stdout.rid, 1); @@ -899,6 +901,12 @@ Deno.test( }, ); +Deno.test({ permissions: { read: true } }, function fsFileIsTerminal() { + // CI not under TTY, so cannot test stdin/stdout/stderr. + using file = Deno.openSync("tests/testdata/assets/hello.txt"); + assert(!file.isTerminal()); +}); + Deno.test( { permissions: { read: true, run: true, hrtime: true } }, async function fsFileLockFileSync() { |