NewTester will create a new testing client with an attached cookie jar
(t testing.TB)
| 66 | |
| 67 | // NewTester will create a new testing client with an attached cookie jar |
| 68 | func NewTester(t testing.TB) *Tester { |
| 69 | jar, err := cookiejar.New(nil) |
| 70 | if err != nil { |
| 71 | t.Fatalf("failed to create cookiejar: %s", err) |
| 72 | } |
| 73 | |
| 74 | return &Tester{ |
| 75 | Client: &http.Client{ |
| 76 | Transport: CreateTestingTransport(), |
| 77 | Jar: jar, |
| 78 | Timeout: Default.TestRequestTimeout, |
| 79 | }, |
| 80 | configLoaded: false, |
| 81 | t: t, |
| 82 | config: Default, |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | // WithDefaultOverrides this will override the default test configuration with the provided values. |
| 87 | func (tc *Tester) WithDefaultOverrides(overrides Config) *Tester { |