Test Runner
Sublime Text plugin for running tests.
Details
Installs
- Total 3K
- Win 1K
- Mac 930
- Linux 566
Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
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 output.
Installation
The easiest way to install is via the Sublime 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, 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):
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:
<dict>
<key>name</key>
<string>Test PASS</string>
<key>scope</key>
<string>test.status.pass</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#33FF33</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Test FAIL</string>
<key>scope</key>
<string>test.status.fail</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#FF3333</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Test SKIP</string>
<key>scope</key>
<string>test.status.skip</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#999999</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Test TODO</string>
<key>scope</key>
<string>test.status.todo</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#FFFF33</string>
</dict>
</dict>
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