Skip to content

Commit f1a0e36

Browse files
committed
asd3
1 parent 07131a8 commit f1a0e36

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
- name: Run tests
4747
run: |
4848
cd ./apps/question-service
49-
tree -a .
49+
cat .env
50+
cat cs3219-g24-firebase-adminsdk-9cm7h-b1675603ab.json
5051
go test ./...
5152
5253
test:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package tests
2+
3+
import (
4+
"fmt"
5+
"net/http"
6+
"net/http/httptest"
7+
"os"
8+
"strings"
9+
"testing"
10+
)
11+
12+
func Test2(t *testing.T) {
13+
err := os.Setenv("FIRESTORE_EMULATOR_HOST", "localhost:9000")
14+
15+
if err != nil {
16+
t.Fatalf("failed to setup env")
17+
}
18+
19+
service := createService()
20+
response := httptest.NewRecorder()
21+
22+
service.ReadQuestion(
23+
response,
24+
httptest.NewRequest(http.MethodGet, "/questions/6SdbW4Awcfm5x0UQtWmg", strings.NewReader("")),
25+
)
26+
fmt.Printf("%v", response.Result())
27+
}
28+
29+
// func TestMain
30+
// func createService()

0 commit comments

Comments
 (0)