testhome

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package testhome keeps a test binary out of the developer's ~/.jaira.

Production code finds per-user state through os.UserHomeDir (HOME, or USERPROFILE on Windows) and JAIRA_HOME: the default board, the lane catalogue, settings, identity, session state. A test that does not isolate all of them reads whatever the machine running it happens to have — on one machine a default-board.md without a backlog lane failed sixteen tests that pass in CI, where the runner has no ~/.jaira at all.

Isolating it per test is the wrong default: the test that forgets is silently wrong on exactly the machines nobody looks at. So every package whose tests can reach that code calls Run from its TestMain, and a test that wants a home of its own still sets one with t.Setenv.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(m *testing.M) int

Run points HOME, USERPROFILE and JAIRA_HOME at one empty temporary directory, clears the variables that override single files under ~/.jaira, runs the package's tests and removes the directory again. It returns the exit code for os.Exit.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL