refactor(timing): Test/add test for middleware timing (#4991)