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

Function TestChain_Stacktrace

chain_test.go:720–737  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

718}
719
720func TestChain_Stacktrace(t *testing.T) {
721 handler := &mockAssertionHandler{}
722
723 chain := newChainWithConfig("test", Config{
724 AssertionHandler: handler,
725 }.withDefaults())
726
727 opChain := chain.enter("test")
728 opChain.fail(testFailure())
729 opChain.leave()
730
731 assert.True(t, opChain.failed())
732 assert.NotNil(t, handler.failure)
733
734 assert.GreaterOrEqual(t, len(handler.failure.Stacktrace), 2)
735 assert.Contains(t, handler.failure.Stacktrace[0].FuncName, "(*chain).fail")
736 assert.Contains(t, handler.failure.Stacktrace[1].FuncName, "TestChain_Stacktrace")
737}
738
739func TestChain_Reporting(t *testing.T) {
740 handler := &mockAssertionHandler{}

Callers

nothing calls this directly

Calls 9

newChainWithConfigFunction · 0.85
testFailureFunction · 0.85
withDefaultsMethod · 0.80
enterMethod · 0.80
failMethod · 0.80
leaveMethod · 0.80
TrueMethod · 0.80
failedMethod · 0.80
ContainsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…