Files
HackBrowserData/cmd/hack-browser-data/helpers_test.go
T
Roger 07b66adc4d test: move compat tests into the packages they cover (#669)
The pipeline goldens now live in app, export in export, and keys.json in masterkey, each with its own
testdata; cmd keeps the flag and list goldens. Shared fixtures and golden helpers became the
internal/browser/browsertest and internal/golden packages. The binary is byte-identical.
2026-10-29 16:12:50 +08:00

22 lines
460 B
Go

package main
import (
"testing"
"github.com/spf13/cobra"
"github.com/stretchr/testify/require"
)
// setHome points the commands' home directory at a fixture: HOME, and USERPROFILE, which Windows reads instead.
func setHome(t *testing.T, home string) {
t.Helper()
t.Setenv("HOME", home)
t.Setenv("USERPROFILE", home)
}
func runCmd(t *testing.T, cmd *cobra.Command, args ...string) {
t.Helper()
cmd.SetArgs(args)
require.NoError(t, cmd.Execute())
}