configtest

package
v0.270.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package configtest isolates the CLI's on-disk config so a test never reads or writes the developer's real one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Isolate

func Isolate(t *testing.T) string

Isolate points the CLI's config at a fresh file under t.TempDir() for the duration of t, and returns that path.

It sets OPENFGA_CONFIG rather than XDG_CONFIG_HOME because only the former is honored on every platform: on macOS the default config lives under ~/Library/Application Support and XDG_CONFIG_HOME is ignored entirely, so a test that relies on it silently falls through to the real config — and the TUI writes config on exit.

It also clears the agent-mode variables (see agentmode.EnvVars).

Types

This section is empty.

Jump to

Keyboard shortcuts

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