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

Function TestChain_Handler

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

Source from the content-addressed store, hash-verified

636}
637
638func TestChain_Handler(t *testing.T) {
639 t.Run("success", func(t *testing.T) {
640 handler := &mockAssertionHandler{}
641
642 chain := newChainWithConfig("test", Config{
643 AssertionHandler: handler,
644 }.withDefaults())
645
646 opChain := chain.enter("test")
647 opChain.leave()
648
649 assert.NotNil(t, handler.ctx)
650 assert.Nil(t, handler.failure)
651 })
652
653 t.Run("failure", func(t *testing.T) {
654 handler := &mockAssertionHandler{}
655
656 chain := newChainWithConfig("test", Config{
657 AssertionHandler: handler,
658 }.withDefaults())
659
660 opChain := chain.enter("test")
661 opChain.fail(testFailure())
662 opChain.leave()
663
664 assert.NotNil(t, handler.ctx)
665 assert.NotNil(t, handler.failure)
666 })
667}
668
669func TestChain_Severity(t *testing.T) {
670 t.Run("default", func(t *testing.T) {

Callers

nothing calls this directly

Calls 6

newChainWithConfigFunction · 0.85
testFailureFunction · 0.85
withDefaultsMethod · 0.80
enterMethod · 0.80
leaveMethod · 0.80
failMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…