properly open nearest error for test/mocha runner; lot of good utility functions here