helper functions for testing with expect.js