Fix visitDirectory tests to return a Future