Make js tests robust to latency in require()