chore: extract mocha-globals
fix: handle no result

If karma exits with error, there is no result.