more work on mocha test mode