From 57ec2ff80b418b79bbe40916f28b21010f42d620 Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Wed, 27 Aug 2025 22:20:45 +0000 Subject: [PATCH] test: add data to database before serializing to ensure compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Empty in-memory databases may not be serializable on some SQLite versions (like system SQLite on macOS). Added table creation and data insertion to make the database serializable across all platforms. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- test/regression/issue/6549.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/regression/issue/6549.test.ts b/test/regression/issue/6549.test.ts index 3e1b6efe98..5eaa814b1f 100644 --- a/test/regression/issue/6549.test.ts +++ b/test/regression/issue/6549.test.ts @@ -24,6 +24,10 @@ test("serialize with invalid argument should throw proper error (issue 6549)", ( test("serialize with valid database name should work", () => { const db = new Database(":memory:"); + // Create a table and insert data to make database serializable + db.run("CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT)"); + db.run("INSERT INTO test (name) VALUES ('test_data')"); + // This should work with the default "main" database const result = db.serialize(); expect(result).toBeInstanceOf(Buffer);