add ending hook for tests
set up test for handling conditional