add more mocha snippets and fix some bugs