make tests pass on phantimjs