diff --git a/v3/Taskfile.yaml b/v3/Taskfile.yaml index 47dfdd63..8a9c68f1 100644 --- a/v3/Taskfile.yaml +++ b/v3/Taskfile.yaml @@ -125,4 +125,8 @@ tasks: cmds: - task: format:md + precommit: + cmds: + - go test ./... + diff --git a/v3/internal/commands/icons_test.go b/v3/internal/commands/icons_test.go index f13e0d97..f56febae 100644 --- a/v3/internal/commands/icons_test.go +++ b/v3/internal/commands/icons_test.go @@ -52,7 +52,7 @@ func TestGenerateIcon(t *testing.T) { _, thisFile, _, _ := runtime.Caller(1) localDir := filepath.Dir(thisFile) // Get the path to the example icon - exampleIcon := filepath.Join(localDir, "defaults", "appicon.png") + exampleIcon := filepath.Join(localDir, "build_assets", "appicon.png") return &IconsOptions{ Input: exampleIcon, WindowsFilename: "appicon.ico", @@ -94,7 +94,7 @@ func TestGenerateIcon(t *testing.T) { _, thisFile, _, _ := runtime.Caller(1) localDir := filepath.Dir(thisFile) // Get the path to the example icon - exampleIcon := filepath.Join(localDir, "defaults", "appicon.png") + exampleIcon := filepath.Join(localDir, "build_assets", "appicon.png") return &IconsOptions{ Input: exampleIcon, MacFilename: "appicon.icns", @@ -133,7 +133,7 @@ func TestGenerateIcon(t *testing.T) { _, thisFile, _, _ := runtime.Caller(1) localDir := filepath.Dir(thisFile) // Get the path to the example icon - exampleIcon := filepath.Join(localDir, "defaults", "appicon.png") + exampleIcon := filepath.Join(localDir, "build_assets", "appicon.png") return &IconsOptions{ Input: exampleIcon, Sizes: "16", @@ -181,7 +181,7 @@ func TestGenerateIcon(t *testing.T) { _, thisFile, _, _ := runtime.Caller(1) localDir := filepath.Dir(thisFile) // Get the path to the example icon - exampleIcon := filepath.Join(localDir, "defaults", "appicon.png") + exampleIcon := filepath.Join(localDir, "build_assets", "appicon.png") return &IconsOptions{ Input: exampleIcon, } @@ -195,7 +195,7 @@ func TestGenerateIcon(t *testing.T) { _, thisFile, _, _ := runtime.Caller(1) localDir := filepath.Dir(thisFile) // Get the path to the example icon - exampleIcon := filepath.Join(localDir, "defaults", "appicon.png") + exampleIcon := filepath.Join(localDir, "build_assets", "appicon.png") return &IconsOptions{ Input: exampleIcon, WindowsFilename: "appicon.ico", @@ -211,7 +211,7 @@ func TestGenerateIcon(t *testing.T) { _, thisFile, _, _ := runtime.Caller(1) localDir := filepath.Dir(thisFile) // Get the path to the example icon - exampleIcon := filepath.Join(localDir, "defaults", "appicon.png") + exampleIcon := filepath.Join(localDir, "build_assets", "appicon.png") return &IconsOptions{ Input: exampleIcon, WindowsFilename: "appicon.ico", diff --git a/v3/internal/commands/syso_test.go b/v3/internal/commands/syso_test.go index a1e18e3d..6726b548 100644 --- a/v3/internal/commands/syso_test.go +++ b/v3/internal/commands/syso_test.go @@ -1,8 +1,6 @@ package commands import ( - "fmt" - "os" "path/filepath" "runtime" "testing" @@ -15,50 +13,6 @@ func TestGenerateSyso(t *testing.T) { wantErr bool test func() error }{ - { - name: "should generate example info and manifest files when using the `example` flag", - setup: func() *SysoOptions { - return &SysoOptions{ - Example: true, - } - }, - wantErr: false, - test: func() error { - // the file `info.json` should be created in the current directory - // check for the existence of the file - f, err := os.Stat("info.json") - if err != nil { - return err - } - m, err := os.Stat("wails.exe.manifest") - if err != nil { - return err - } - defer func() { - err := os.Remove("info.json") - err2 := os.Remove("wails.exe.manifest") - if err != nil { - panic(err) - } - if err2 != nil { - panic(err2) - } - }() - if f.IsDir() { - return fmt.Errorf("info.json is a directory") - } - if f.Size() == 0 { - return fmt.Errorf("info.json is empty") - } - if m.IsDir() { - return fmt.Errorf("wails.exe.manifest is a directory") - } - if m.Size() == 0 { - return fmt.Errorf("wails.exe.manifest is empty") - } - return nil - }, - }, { name: "should error if manifest filename is not provided", setup: func() *SysoOptions {