5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 05:50:08 +08:00
wails/v3/internal/commands/task_test.go
Lea Anthony 82287a4758
[v3] Support task flags pass through
[v3] `wails build` -> `wails task build`
2023-01-23 21:08:03 +11:00

40 lines
726 B
Go

package commands
import "testing"
func TestBuild(t *testing.T) {
type args struct {
options *RunTaskOptions
otherArgs []string
}
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, tt.args.otherArgs); (err != nil) != tt.wantErr {
t.Errorf("Run() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}