Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.

Commit 05798c2

Browse files
committed
chore: actually test acessing the db
1 parent 83961d9 commit 05798c2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ test("connects to FerretDB", async () => {
1111
await connection.close()
1212
})
1313

14+
test("creates a collection and record", async () => {
15+
const connection = await Mongoose.createConnection(`mongodb://localhost:${PORT}`).asPromise()
16+
17+
const collection = await connection.createCollection("TestCollection")
18+
await collection.insertOne({ name: "Test Document" })
19+
20+
await connection.close()
21+
})
22+
1423
test("fails to connect to non-existent FerretDB instance", async () => {
1524
await expect(
1625
Mongoose.connect(`mongodb://localhost:${parseInt(PORT) + 1}`, {

0 commit comments

Comments
 (0)