aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-09-14 21:26:37 -0700
committerGravatar GitHub <noreply@github.com> 2023-09-14 21:26:37 -0700
commitced69d38180e963da1206f9932db76666cec9f72 (patch)
treea4c4462ff8747adc7d092891b1c299dfbb0ecc4a /test
parentb262b0153a2d9667fcb47a970e8027d3b54f8a0a (diff)
downloadbun-ced69d38180e963da1206f9932db76666cec9f72.tar.gz
bun-ced69d38180e963da1206f9932db76666cec9f72.tar.zst
bun-ced69d38180e963da1206f9932db76666cec9f72.zip
async-ify all node:fs functions (#5360)
* async all node:fs functions * draw the rest of the owl * LLVM & Clang 16 --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r--test/js/node/fs/fs.test.ts13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/js/node/fs/fs.test.ts b/test/js/node/fs/fs.test.ts
index 8ea9522e1..41275edd5 100644
--- a/test/js/node/fs/fs.test.ts
+++ b/test/js/node/fs/fs.test.ts
@@ -1016,19 +1016,22 @@ describe("rmdir", () => {
done();
});
});
- it("does not remove a dir with a file in it", done => {
+ it("does not remove a dir with a file in it", async () => {
const path = `${tmpdir()}/${Date.now()}.rm.dir`;
try {
mkdirSync(path);
writeFileSync(`${path}/file.txt`, "File written successfully", "utf8");
} catch (e) {}
expect(existsSync(path + "/file.txt")).toBe(true);
- rmdir(path, err => {
+ try {
+ await promises.rmdir(path);
+ } catch (err) {
expect("ENOTEMPTY EPERM").toContain(err!.code);
- done();
- });
+ }
+
expect(existsSync(path + "/file.txt")).toBe(true);
- rmdir(path, { recursive: true }, () => {});
+
+ await promises.rmdir(path, { recursive: true });
expect(existsSync(path + "/file.txt")).toBe(false);
});
it("removes a dir recursively", done => {