Rewrite the tests in bailey.js