Skip to content

Commit

Permalink
added database test
Browse files Browse the repository at this point in the history
  • Loading branch information
APandamonium1 committed May 30, 2024
1 parent 28a61c4 commit 3b0d198
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions db_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package main

import (
"testing"
)

func TestConnect(t *testing.T) {
// Create a new instance of FireDB.
db := FireDB{}

// Call the Connect function.
err := db.Connect()

// Check if there was an error during connection.
if err != nil {
t.Errorf("Failed to connect to Firebase: %v", err)
}

// Check if the Firebase Realtime Database client is initialized.
if db.Client == nil {
t.Error("Firebase Realtime Database client is not initialized")
}
}

0 comments on commit 3b0d198

Please sign in to comment.