MCPcopy Index your code
hub / github.com/dnote/dnote / setupTestEnv

Function setupTestEnv

pkg/cli/main_test.go:37–47  ·  view source on GitHub ↗

setupTestEnv creates a unique test directory for parallel test execution

(t *testing.T)

Source from the content-addressed store, hash-verified

35
36// setupTestEnv creates a unique test directory for parallel test execution
37func setupTestEnv(t *testing.T) (string, testutils.RunDnoteCmdOptions) {
38 testDir := t.TempDir()
39 opts := testutils.RunDnoteCmdOptions{
40 Env: []string{
41 fmt.Sprintf("XDG_CONFIG_HOME=%s", testDir),
42 fmt.Sprintf("XDG_DATA_HOME=%s", testDir),
43 fmt.Sprintf("XDG_CACHE_HOME=%s", testDir),
44 },
45 }
46 return testDir, opts
47}
48
49func TestMain(m *testing.M) {
50 if err := exec.Command("go", "build", "--tags", "fts5", "-o", binaryName).Run(); err != nil {

Callers 8

TestInitFunction · 0.70
TestAddNoteFunction · 0.70
TestEditNoteFunction · 0.70
TestEditBookFunction · 0.70
TestRemoveNoteFunction · 0.70
TestRemoveBookFunction · 0.70
TestDBPathFlagFunction · 0.70
TestViewFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected