5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 07:29:56 +08:00
wails/v3/internal/commands/task_test.go
2023-01-18 21:42:49 +11:00

39 lines
684 B
Go

package commands
import "testing"
func TestBuild(t *testing.T) {
type args struct {
options *RunTaskOptions
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: "should error if task name not provided",
args: args{
options: &RunTaskOptions{},
},
wantErr: true,
},
{
name: "should work if task name provided",
args: args{
options: &RunTaskOptions{
Name: "build",
},
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := RunTask(tt.args.options); (err != nil) != tt.wantErr {
t.Errorf("Run() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}