newTestConfig points DataDir at a fresh tmp dir and BrowserURL at the given test server. Most tests want both wired up together.
(t *testing.T, browserURL string)
| 37 | // newTestConfig points DataDir at a fresh tmp dir and BrowserURL at the |
| 38 | // given test server. Most tests want both wired up together. |
| 39 | func newTestConfig(t *testing.T, browserURL string) *config.Config { |
| 40 | t.Helper() |
| 41 | cfg := config.DefaultConfig() |
| 42 | cfg.DataDir = t.TempDir() |
| 43 | // BrowserURL prefers cfg.URL when set, which sidesteps the |
| 44 | // host-rewriting branch and gives us a stable URL to assert on. |
| 45 | cfg.URL = browserURL |
| 46 | return cfg |
| 47 | } |
| 48 | |
| 49 | // writeBootstrapToken drops a token file at <dataDir>/.bootstrap-token in |
| 50 | // the same shape EnsureBootstrapToken would produce — token + trailing |
no test coverage detected