1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: tests

This commit is contained in:
Ferdinand Mütsch 2022-12-29 17:26:15 +01:00
parent 50c54685ec
commit 3aac5e9062
2 changed files with 1135 additions and 1046 deletions

File diff suppressed because it is too large Load Diff

18
models/init_test.go Normal file
View File

@ -0,0 +1,18 @@
package models
import (
"os"
"path"
"runtime"
)
func init() {
// move to project root as working directory (e.g. so data/* can be resolved when loading config)
// taken from https://intellij-support.jetbrains.com/hc/en-us/community/posts/360009685279-Go-test-working-directory-keeps-changing-to-dir-of-the-test-file-instead-of-value-in-template
_, filename, _, _ := runtime.Caller(0)
dir := path.Join(path.Dir(filename), "..")
err := os.Chdir(dir)
if err != nil {
panic(err)
}
}