reorder testing functions

This commit is contained in:
Asim Aslam 2018-05-25 14:39:50 +01:00
parent 909e13a24a
commit 2a2ad553a1
2 changed files with 26 additions and 20 deletions

View File

@ -50,5 +50,7 @@ func TestFunction(t *testing.T) {
}()
// run service
fn.Run()
if err := fn.Run(); err != nil {
t.Fatal(err)
}
}

View File

@ -31,8 +31,7 @@ func TestService(t *testing.T) {
// service.Init()
// run service
go service.Run()
go func() {
// wait for start
wg.Wait()
@ -56,4 +55,9 @@ func TestService(t *testing.T) {
// shutdown the service
cancel()
}()
if err := service.Run(); err != nil {
t.Fatal(err)
}
}