SublimeText 2 Snippets and Syntax Highlighter for the testing framework mocha. Although the name implies node.js, mocha works as well in the browser.
WARNING: this is an early release of, expect bugs…
git clone git://github.com/lennart/sublime-node-mocha.git <path-to-your-packages-folder>/Mocha
Or use the Sublime Text 2 Package Manager
Given your tests lie within the test
folder relative to the root of your project, sublime-node-mocha will automatically use an enhanced javascript
syntax to highlight describe and it blocks as well as specific calls like done()
or beforeEach(...)
.
Within a test file you can use the following snippets:
-
it<tab>
=>it("should behave like", function() { ... });
-
ait<tab>
=>it("should behave like", function(done) { ...; done(); });
-
describe<tab>
=>describe("a trait", function() { ...});
more might follow…