(t *testing.T)
| 580 | } |
| 581 | |
| 582 | func Test_executeOnRouteHooks_ErrorWithMount(t *testing.T) { |
| 583 | t.Parallel() |
| 584 | app := New() |
| 585 | app.mountFields.mountPath = testMountPath |
| 586 | |
| 587 | var received string |
| 588 | app.Hooks().OnRoute(func(r Route) error { |
| 589 | received = r.Path |
| 590 | return errors.New("hook error") |
| 591 | }) |
| 592 | |
| 593 | err := app.hooks.executeOnRouteHooks(&Route{Path: "/foo", path: "/foo"}) |
| 594 | require.Equal(t, testMountPath+"/foo", received) |
| 595 | require.EqualError(t, err, "hook error") |
| 596 | } |
| 597 | |
| 598 | func Test_executeOnNameHooks_ErrorWithMount(t *testing.T) { |
| 599 | t.Parallel() |
nothing calls this directly
no test coverage detected