Add hook when running tests