mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
fix: Print dotenv file path when there is an error reading file (#1842)
This commit is contained in:
committed by
GitHub
parent
e619bad4a9
commit
8d0f0b049c
12
task_test.go
12
task_test.go
@@ -1657,6 +1657,18 @@ func TestDotenvHasEnvVarInPath(t *testing.T) {
|
||||
tt.Run(t)
|
||||
}
|
||||
|
||||
func TestTaskDotenvParseErrorMessage(t *testing.T) {
|
||||
e := task.Executor{
|
||||
Dir: "testdata/dotenv/parse_error",
|
||||
}
|
||||
|
||||
path, _ := filepath.Abs(filepath.Join(e.Dir, ".env-with-error"))
|
||||
expected := fmt.Sprintf("error reading env file %s:", path)
|
||||
|
||||
err := e.Setup()
|
||||
require.ErrorContains(t, err, expected)
|
||||
}
|
||||
|
||||
func TestTaskDotenv(t *testing.T) {
|
||||
tt := fileContentTest{
|
||||
Dir: "testdata/dotenv_task/default",
|
||||
|
||||
Reference in New Issue
Block a user