1
0
mirror of https://github.com/go-task/task.git synced 2025-06-15 00:15:10 +02:00

Allow ignore_error at task level

This commit is contained in:
Andrey Nering
2018-08-05 12:53:42 -03:00
parent c70343a5bc
commit feaf70922d
5 changed files with 63 additions and 26 deletions

View File

@ -416,6 +416,26 @@ func TestTaskVersion(t *testing.T) {
func TestTaskIgnoreErrors(t *testing.T) {
const dir = "testdata/ignore_errors"
t.Run("task-should-pass", func(t *testing.T) {
e := task.Executor{
Dir: dir,
Stdout: ioutil.Discard,
Stderr: ioutil.Discard,
}
assert.NoError(t, e.Setup())
assert.NoError(t, e.Run(taskfile.Call{Task: "task-should-pass"}))
})
t.Run("task-should-fail", func(t *testing.T) {
e := task.Executor{
Dir: dir,
Stdout: ioutil.Discard,
Stderr: ioutil.Discard,
}
assert.NoError(t, e.Setup())
assert.Error(t, e.Run(taskfile.Call{Task: "task-should-fail"}))
})
t.Run("cmd-should-pass", func(t *testing.T) {
e := task.Executor{
Dir: dir,