Skip to content

fix(console.log) fix printing long custom format #5164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bun.js/bindings/exports.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down
29 changes: 29 additions & 0 deletions test/js/third_party/mongodb/mongodb.test.ts
Original file line number Diff line number Diff line change
@@ -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();
}
});
});
6 changes: 6 additions & 0 deletions test/js/third_party/mongodb/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "mongodb",
"dependencies": {
"mongodb": "6.0.0"
}
}
3 changes: 2 additions & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,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": {
Expand Down