MCPcopy Create free account
hub / github.com/gavv/httpexpect / newChainWithConfig

Function newChainWithConfig

chain.go:111–139  ·  view source on GitHub ↗

Construct chain using config.

(name string, config Config)

Source from the content-addressed store, hash-verified

109
110// Construct chain using config.
111func newChainWithConfig(name string, config Config) *chain {
112 config.validate()
113
114 c := &chain{
115 context: AssertionContext{},
116 handler: config.AssertionHandler,
117 severity: SeverityError,
118 }
119
120 c.context.TestName = config.TestName
121
122 if name != "" {
123 c.context.Path = []string{name}
124 c.context.AliasedPath = []string{name}
125 } else {
126 c.context.Path = []string{}
127 c.context.AliasedPath = []string{}
128 }
129
130 if config.Environment != nil {
131 c.context.Environment = config.Environment
132 } else {
133 c.context.Environment = newEnvironment(c)
134 }
135
136 c.context.TestingTB = isTestingTB(c.handler)
137
138 return c
139}
140
141// Construct chain using DefaultAssertionHandler and provided Reporter.
142func newChainWithDefaults(name string, reporter Reporter, flag ...chainFlags) *chain {

Callers 15

TestChain_ReentrancyFunction · 0.85
TestChain_EnvFunction · 0.85
TestChain_RootFunction · 0.85
TestChain_HandlerFunction · 0.85
TestChain_SeverityFunction · 0.85
TestChain_StacktraceFunction · 0.85
TestChain_ReportingFunction · 0.85
TestChain_TestingTBFunction · 0.85
WithConfigFunction · 0.85
NewEnvironmentCFunction · 0.85
NewValueCFunction · 0.85
NewNumberCFunction · 0.85

Calls 3

newEnvironmentFunction · 0.85
isTestingTBFunction · 0.85
validateMethod · 0.80

Tested by 8

TestChain_ReentrancyFunction · 0.68
TestChain_EnvFunction · 0.68
TestChain_RootFunction · 0.68
TestChain_HandlerFunction · 0.68
TestChain_SeverityFunction · 0.68
TestChain_StacktraceFunction · 0.68
TestChain_ReportingFunction · 0.68
TestChain_TestingTBFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…