Add tests (#2)

* Initial tests draft.

* Add tests for parsing jwt token

* Further code optimisations
This commit is contained in:
2023-10-10 13:54:03 +01:00
committed by GitHub
parent c213a49c32
commit bc128493b0
9 changed files with 322 additions and 94 deletions
+34
View File
@@ -0,0 +1,34 @@
package main
import (
"fmt"
"testing"
assertions "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)
type Tests struct {
suite.Suite
}
var (
assert *assertions.Assertions
)
func (suite *Tests) SetupTest() {
assert = assertions.New(suite.T())
}
func (suite *Tests) BeforeTest(suiteName, testName string) {
fmt.Println("BeforeTest")
cfg = &config{}
parseConfig()
StartMonitoringServer()
}
// func (suite *Tests) AfterTest(suiteName, testName string) {)
func TestSuite(t *testing.T) {
suite.Run(t, new(Tests))
}