MCPcopy Index your code
hub / github.com/gavv/httpexpect / WithConfig

Function WithConfig

expect.go:518–527  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

516// Status(http.StatusOK)
517// }
518func 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.

Callers 13

NewFunction · 0.85
DefaultFunction · 0.85
TestExpect_RequestsFunction · 0.85
TestExpect_BuildersFunction · 0.85
TestExpect_MatchersFunction · 0.85
TestExpect_TraverseFunction · 0.85
TestExpect_BranchesFunction · 0.85
TestExpect_InheritanceFunction · 0.85
TestExpect_PanicsFunction · 0.85
TestExpect_AdaptersFunction · 0.85

Calls 3

newChainWithConfigFunction · 0.85
withDefaultsMethod · 0.80
validateMethod · 0.80

Tested by 11

TestExpect_RequestsFunction · 0.68
TestExpect_BuildersFunction · 0.68
TestExpect_MatchersFunction · 0.68
TestExpect_TraverseFunction · 0.68
TestExpect_BranchesFunction · 0.68
TestExpect_InheritanceFunction · 0.68
TestExpect_PanicsFunction · 0.68
TestExpect_AdaptersFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…