aboutsummaryrefslogtreecommitdiff
path: root/test/js/node/process/process.test.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-03-28 18:23:50 -0700
committerGravatar GitHub <noreply@github.com> 2023-03-28 18:23:50 -0700
commitb76384351c55917692a9dc3b7f08f771a55b3fa1 (patch)
tree74a188ed15dac0f194e3e72fed4dd719ae4c601b /test/js/node/process/process.test.js
parent0a914902269ebb1f5612385bd8b65aa1de4db71e (diff)
downloadbun-b76384351c55917692a9dc3b7f08f771a55b3fa1.tar.gz
bun-b76384351c55917692a9dc3b7f08f771a55b3fa1.tar.zst
bun-b76384351c55917692a9dc3b7f08f771a55b3fa1.zip
More bug fixes (#2486)
* readline_promises test fix * fix `escapeHTML` for baseline builds * fs test fixes, use `tmpdir()` * add paths for `resolve.test.js` * isError with toString symbol and error prototype * comment about `toString` * skip async macro transform * test cleanup, skip stack format test * readline undo and redo fix * capture error from readline keypress * Update tcp-server.test.ts * use `removefileat` for recursive rmdir * use strong for `signal.reason` * initialize `m_flags` * directory with file fs test * recursive option * import expect * could be less than * move abort signal tests to another process * fix typecheck --------- Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Diffstat (limited to 'test/js/node/process/process.test.js')
-rw-r--r--test/js/node/process/process.test.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/js/node/process/process.test.js b/test/js/node/process/process.test.js
index 59f54c53f..68d72e056 100644
--- a/test/js/node/process/process.test.js
+++ b/test/js/node/process/process.test.js
@@ -1,7 +1,7 @@
import { resolveSync, which } from "bun";
import { describe, expect, it } from "bun:test";
import { existsSync, readFileSync, realpathSync } from "fs";
-import { basename } from "path";
+import { basename, resolve } from "path";
it("process", () => {
// this property isn't implemented yet but it should at least return a string
@@ -40,12 +40,14 @@ it("process", () => {
throw new Error("process.env should call toJSON to hide its internal state");
}
- var { env, ...proces } = process;
- console.log(proces);
+ // Make sure it doesn't crash
+ expect(Bun.inspect(process).length > 0).toBe(true);
- console.log("CWD", process.cwd());
- console.log("SET CWD", process.chdir("../"));
- console.log("CWD", process.cwd());
+ let cwd = process.cwd();
+ process.chdir("../");
+ expect(process.cwd()).toEqual(resolve(cwd, "../"));
+ process.chdir(cwd);
+ expect(cwd).toEqual(process.cwd());
});
it("process.hrtime()", () => {