Improve checkDone in tests/runner.js to make sure $ is a function before proceeding