mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-07 17:19:57 +00:00
22 lines
413 B
Go
22 lines
413 B
Go
package unifiedresources
|
|
|
|
import (
|
|
"sync"
|
|
"testing"
|
|
|
|
"github.com/rcourtman/pulse-go-rewrite/internal/mockruntime"
|
|
)
|
|
|
|
var mockModeTestMu sync.Mutex
|
|
|
|
func enableMockMode(t *testing.T) {
|
|
t.Helper()
|
|
mockModeTestMu.Lock()
|
|
previous := mockruntime.IsEnabled()
|
|
t.Setenv("PULSE_MOCK_MODE", "true")
|
|
mockruntime.SetEnabled(true)
|
|
t.Cleanup(func() {
|
|
mockruntime.SetEnabled(previous)
|
|
mockModeTestMu.Unlock()
|
|
})
|
|
}
|