forked from oven-sh/bun
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(windows): allow open and Bun.file() with
/dev/null
(oven-sh#8499)
* DEV NULL * oops * ok
- Loading branch information
1 parent
6cd20b6
commit bd14cc7
Showing
7 changed files
with
47 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { openSync, closeSync } from "fs"; | ||
import { open } from "fs/promises"; | ||
|
||
test('Bun.file("/dev/null") works on windows', async () => { | ||
expect(await Bun.file("/dev/null").arrayBuffer()).toHaveLength(0); | ||
}); | ||
|
||
test('openSync("/dev/null") works on windows', async () => { | ||
const handle = openSync("/dev/null", "r"); | ||
closeSync(handle); | ||
}); | ||
|
||
test('open("/dev/null") works on windows', async () => { | ||
const handle = await open("/dev/null", "r"); | ||
await handle.close(); | ||
}); |