aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/process.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-02-24 01:46:02 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-02-24 01:46:02 -0800
commita71c1288a6a3a90bc1f1ec76cf33e5f8f63ca84e (patch)
treea5bd1f7f51b19f26e224ebff71ec384d0d426fee /integration/bunjs-only-snippets/process.js
parent3182c5d304f1ef839815e335ef27a6aa99c030e6 (diff)
downloadbun-a71c1288a6a3a90bc1f1ec76cf33e5f8f63ca84e.tar.gz
bun-a71c1288a6a3a90bc1f1ec76cf33e5f8f63ca84e.tar.zst
bun-a71c1288a6a3a90bc1f1ec76cf33e5f8f63ca84e.zip
Ensure we run the process test
Diffstat (limited to 'integration/bunjs-only-snippets/process.js')
-rw-r--r--integration/bunjs-only-snippets/process.js48
1 files changed, 0 insertions, 48 deletions
diff --git a/integration/bunjs-only-snippets/process.js b/integration/bunjs-only-snippets/process.js
deleted file mode 100644
index 486d20f46..000000000
--- a/integration/bunjs-only-snippets/process.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// this property isn't implemented yet but it should at least return a string
-const isNode = !process.isBun;
-
-if (!isNode && process.title !== "bun")
- throw new Error("process.title is not 'bun'");
-
-if (typeof process.env.USER !== "string")
- throw new Error("process.env is not an object");
-
-if (process.env.USER.length === 0)
- throw new Error("process.env is missing a USER property");
-
-if (process.platform !== "darwin" && process.platform !== "linux")
- throw new Error("process.platform is invalid");
-
-if (isNode) throw new Error("process.isBun is invalid");
-
-// partially to test it doesn't crash due to various strange types
-process.env.BACON = "yummy";
-if (process.env.BACON !== "yummy") {
- throw new Error("process.env is not writable");
-}
-
-delete process.env.BACON;
-if (typeof process.env.BACON !== "undefined") {
- throw new Error("process.env is not deletable");
-}
-
-process.env.BACON = "yummy";
-if (process.env.BACON !== "yummy") {
- throw new Error("process.env is not re-writable");
-}
-
-if (JSON.parse(JSON.stringify(process.env)).BACON !== "yummy") {
- throw new Error("process.env is not serializable");
-}
-
-if (typeof JSON.parse(JSON.stringify(process.env)).toJSON !== "undefined") {
- throw new Error("process.env should call toJSON to hide its internal state");
-}
-
-var { env, ...proces } = process;
-console.log(JSON.stringify(proces, null, 2));
-console.log(proces);
-
-console.log("CWD", process.cwd());
-console.log("SET CWD", process.chdir("../"));
-console.log("CWD", process.cwd());