WithConfig returns a new Expect instance with custom config. Either Reporter or AssertionHandler should not be nil, otherwise the function panics. Example: func TestSomething(t *testing.T) { e := httpexpect.WithConfig(httpexpect.Config{ TestName: t.Name(), BaseURL: "http://example.com/"
(config Config)
| 516 | // Status(http.StatusOK) |
| 517 | // } |
| 518 | func WithConfig(config Config) *Expect { |
| 519 | config = config.withDefaults() |
| 520 | |
| 521 | config.validate() |
| 522 | |
| 523 | return &Expect{ |
| 524 | chain: newChainWithConfig("", config), |
| 525 | config: config, |
| 526 | } |
| 527 | } |
| 528 | |
| 529 | // Env returns Environment associated with Expect instance. |
| 530 | // Tests can use it to store arbitrary data. |
searching dependent graphs…