Skip to content
Permalink
Browse files

Add GraphQL tests

  • Loading branch information...
upvalue committed Nov 16, 2018
1 parent 19536a2 commit 9136ddc68b346100535d37546a1014f785287734
Showing with 341 additions and 318 deletions.
  1. +1 βˆ’0 README.md
  2. +1 βˆ’1 backend/app.go
  3. +13 βˆ’0 backend/backend_test.go
  4. +276 βˆ’279 backend/graphql.go
  5. +1 βˆ’0 frontend-ng/package.json
  6. +19 βˆ’36 frontend-ng/public/index.html
  7. +3 βˆ’2 frontend-ng/src/App.tsx
  8. +5 βˆ’0 frontend-ng/src/index.tsx
  9. +22 βˆ’0 frontend-ng/yarn.lock
@@ -1,5 +1,6 @@
<p align="center"><img src="assets/horizontal.png" alt="meditations" height="80px"></p>

![Have a nice day badge](https://img.shields.io/badge/have%20a-nice%20day-0099dd.svg)
![CircleCI Badge](https://circleci.com/gh/upvalue/meditations.png?circle-token=:circle-token&style=shield)

meditations is an application for tracking progress towards goals that builds on habit formation and long term
@@ -176,7 +176,7 @@ func App() *macaron.Macaron {

init("/habits", habitsInit)
init("/journal", journalInit)
graphqlInit(m)
graphqlWebInit(m)

m.Get("/test", func(c *macaron.Context) {
c.HTML(200, "test")
@@ -1,6 +1,7 @@
package backend

import (
"encoding/json"
"os"
"testing"
)
@@ -32,7 +33,19 @@ func TestStatistics(t *testing.T) {
}
}

// TestGraphQL tests the most basic possible GraphQL query
func TestGraphQL(t *testing.T) {
result := executeQuery("{\n\tping\n}", schema)
bytes, _ := json.Marshal(result.Data)
json := string(bytes)

if json != "{\"ping\":\"pong\"}" {
t.Fail()
}
}

func TestMain(m *testing.M) {
graphqlInitialize()
Config.DBPath = ":memory:"
DBOpen()
DBSeed("2017-07")
Oops, something went wrong.

0 comments on commit 9136ddc

Please sign in to comment.
You can’t perform that action at this time.