Sublime Test Runner =================== Runs tests on save, with status bar summary and details on output panel. It should work with any console/terminal runnable test framework which produces [TAP](http://testanything.org/) output. Installation ------------ **The easiest way to install is via the [Sublime Package Control](http://wbond.net/sublime_packages/package_control) plugin.** Bring down your Command Palette (``Command+Shift+P`` on OS X, ``Control+Shift+P`` on Linux/Windows), open "Package Control: Install Package" (in your Command Palette) and search for "Test Runner". That's it! To install it **manually without Git:** Download the latest source from [GitHub](http://github.com/accerqueira/sublime-test-runner), copy the whole directory into the Packages directory and rename it to "Test Runner". To install it **manually with Git:** Clone the repository in your Sublime Text 2 Packages directory: git clone https://github.com/accerqueira/sublime-test-runner.git "Test Runner" The "Packages" directory should be located at: * OS X: ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/ * Linux: ~/.Sublime\ Text\ 2/Packages/ or ~/.config/sublime-text-2/Packages/ * Windows: %APPDATA%/Sublime Text 2/Packages/ The plugin should be picked up automatically. If not, restart Sublime Text. Usage ----- Test Runner will, by default, run ``make test REPORTER=tap`` whenever you save a file. You can also bring down the Command Palette and look for "Test Runner" available commands. As an example, you could use the following rules for node.js Makefile (assuming you have mocha for testing and istanbul for test coverage): ```make test: @./node_modules/mocha/bin/_mocha -R $(REPORTER) test-cov: @./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- -R $(REPORTER) .PHONY: test test-cov ``` For test result coloring, you can add something like this to your color scheme file: ```xml name Test PASS scope test.status.pass settings foreground #33FF33 name Test FAIL scope test.status.fail settings foreground #FF3333 name Test SKIP scope test.status.skip settings foreground #999999 name Test TODO scope test.status.todo settings foreground #FFFF33 ``` For more customization, the following scopes are available... - ...for tests marked as passed: - ``test.result.pass`` - ``test.status.pass`` - ``test.description.pass`` - ...for tests marked as failed: - ``test.result.fail`` - ``test.status.fail`` - ``test.description.fail`` - ...for tests marked as skipped: - ``test.result.skip`` - ``test.status.skip`` - ``test.description.skip`` - ...for tests marked as todo: - ``test.result.todo`` - ``test.status.todo`` - ``test.description.todo``