aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bun.js/bindings/exports.zig2
-rw-r--r--test/js/third_party/mongodb/mongodb.test.ts29
-rw-r--r--test/js/third_party/mongodb/package.json6
-rw-r--r--test/package.json3
4 files changed, 38 insertions, 2 deletions
diff --git a/src/bun.js/bindings/exports.zig b/src/bun.js/bindings/exports.zig
index 18b7c8bce..66bbe798f 100644
--- a/src/bun.js/bindings/exports.zig
+++ b/src/bun.js/bindings/exports.zig
@@ -2119,7 +2119,7 @@ pub const ZigConsoleClient = struct {
this.globalThis,
this.custom_formatted_object.function,
this.custom_formatted_object.this,
- this.max_depth - this.depth,
+ this.max_depth -| this.depth,
this.max_depth,
enable_ansi_colors,
);
diff --git a/test/js/third_party/mongodb/mongodb.test.ts b/test/js/third_party/mongodb/mongodb.test.ts
new file mode 100644
index 000000000..da0a089cf
--- /dev/null
+++ b/test/js/third_party/mongodb/mongodb.test.ts
@@ -0,0 +1,29 @@
+import { test, expect, describe } from "bun:test";
+import { MongoClient } from "mongodb";
+
+const CONNECTION_STRING = process.env.TLS_MONGODB_DATABASE_URL;
+
+const it = CONNECTION_STRING ? test : test.skip;
+
+describe("mongodb", () => {
+ it("should connect and inpect", async () => {
+ const client = new MongoClient(CONNECTION_STRING as string);
+
+ const clientConnection = await client.connect();
+
+ try {
+ const db = client.db("bun");
+
+ const schema = db.collection("bun");
+
+ await schema.insertOne({ name: "bunny", version: 1.0 });
+ const result = await schema.find();
+ await schema.deleteOne({ name: "bunny" });
+ const text = Bun.inspect(result);
+
+ expect(text).toBeDefined();
+ } finally {
+ await clientConnection.close();
+ }
+ });
+});
diff --git a/test/js/third_party/mongodb/package.json b/test/js/third_party/mongodb/package.json
new file mode 100644
index 000000000..b7cdb0b5c
--- /dev/null
+++ b/test/js/third_party/mongodb/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "mongodb",
+ "dependencies": {
+ "mongodb": "6.0.0"
+ }
+}
diff --git a/test/package.json b/test/package.json
index 58e66833f..bab0e7200 100644
--- a/test/package.json
+++ b/test/package.json
@@ -35,7 +35,8 @@
"undici": "5.20.0",
"vitest": "0.32.2",
"webpack": "5.88.0",
- "webpack-cli": "4.7.2"
+ "webpack-cli": "4.7.2",
+ "mongodb": "6.0.0"
},
"private": true,
"scripts": {