func (Test) Frontend() error {
	return sh.Run("yarn", "--cwd", "web", "test:unit")
}
Run all frontend tests
package main
import (
	"fmt"
	"os"
	"github.com/magefile/mage/mg"
	"github.com/magefile/mage/sh"
)
type Build mg.Namespace
type Lint mg.Namespace
type Test mg.Namespace
type Run mg.Namespace
type Clean mg.Namespace
func (b Build) All() {
	mg.Deps(b.Backend, b.Frontend)
}
func (Build) Backend() error {
	cleanBackend()
	var version string
	var err error
	version = os.Getenv("VERSION")
	if version == "" {
		version, err = generateBackendVersion()
		if err != nil {
			return err
		}
	}
	flags := fmt.Sprintf(`-X go-webapp-example/internal/app.version=%s -s -w`, version)
	binary := "go-webapp-example"
	env := map[string]string{
		"CGO_ENABLED": "0",
		"GOOS":        "linux",
		"GOARCH":      "amd64",
	}
	if err := sh.RunWith(env, "go", "build", "-ldflags", flags, "-o", "output/"+binary); err != nil {
		return err
	}
	return nil
}
func (Build) Frontend() error {
	if true {
		return nil
	}
	env := map[string]string{"NODE_ENV": "production"}
	if err := sh.RunWith(env, "yarn", "--cwd", "web", "build", "--production"); err != nil {
		return err
	}
	return nil
}
func (l Lint) All() {
	mg.Deps(l.Backend, l.Frontend)
}
func (Lint) Backend() error {
	return sh.Run("golangci-lint", "run", "--fix")
}
func (Lint) Frontend() error {
	return sh.Run("yarn", "--cwd", "web", "lint")
}
func (t Test) All() {
	mg.Deps(t.Backend, t.Frontend)
}
func (Test) Backend() error {
	return sh.Run("go", "test", "./...", "-test.short")
}
func (Test) Race() error {
	return sh.Run("go", "test", "-race", "./...", "-test.short")
}
func (Test) Integration() error {
	return sh.Run("go", "test", "./...")
}
func (Test) System() error {
	return sh.Run("go", "test", "./...")
}