(t *testing.T)
| 636 | } |
| 637 | |
| 638 | func 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 | |
| 669 | func TestChain_Severity(t *testing.T) { |
| 670 | t.Run("default", func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…