Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit a757e70

Browse files
committed
fix: abstract path calculation from OS
1 parent 8f56238 commit a757e70

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

internal/utils/utils_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package utils
33
import (
44
"io/ioutil"
55
"os"
6+
"path"
67
"testing"
78

89
"github.com/stretchr/testify/assert"
@@ -21,19 +22,19 @@ var commitsJSON *gabs.Container
2122
var snapshotsJSON *gabs.Container
2223

2324
func init() {
24-
nextTokenParamContent, err := ioutil.ReadFile("../_testresources/gcp/nextPageParam.json")
25+
nextTokenParamContent, err := ioutil.ReadFile(path.Join("..", "_testresources", "gcp", "nextPageParam.json"))
2526
if err != nil {
2627
os.Exit(1)
2728
}
2829
nextTokenParamJSON, _ = gabs.ParseJSON([]byte(nextTokenParamContent))
2930

30-
commitsContent, err := ioutil.ReadFile("../_testresources/gcp/commits.json")
31+
commitsContent, err := ioutil.ReadFile(path.Join("..", "_testresources", "gcp", "commits.json"))
3132
if err != nil {
3233
os.Exit(1)
3334
}
3435
commitsJSON, _ = gabs.ParseJSON([]byte(commitsContent))
3536

36-
snapshotsContent, err := ioutil.ReadFile("../_testresources/gcp/snapshots.json")
37+
snapshotsContent, err := ioutil.ReadFile(path.Join("..", "_testresources", "gcp", "snapshots.json"))
3738
if err != nil {
3839
os.Exit(1)
3940
}

0 commit comments

Comments
 (0)