ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Harvey

by rayje ST2

A Sublime Text 2 plugin to assist in developing Harvey tests

Details

Installs

  • Total 22
  • Win 14
  • Mac 3
  • Linux 5
Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

harvey-sublime plugin

A Sublime plugin to assist in creating tests with Harvey

Features

The following are the commands the plugin provides: * harvey_run_test - Runs a single test or all tests in a Harvey test file. * harvey_select_test - Runs the test selected from a quick panel. * harvey_last_test - Re-runs the last test.

Each of the commands listed above can be output either to a scratch file or to the console.

The harvey_run_test and harvey_select_test commands both take default arguments that define how to run and output the test. Each of the arguments can be overridden by adding an entry to your default keymap file.

Installation Options

  • Package Control

  • Go to your Sublime Text 2 Packages directory

    • OS X: ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
    • Windows: %APPDATA%/Sublime Text 2/Packages/
    • Linux: ~/.config/sublime-text-2/Packages/

and clone the repository:

git clone git@github.com:rayje/harvey-sublime.git Harvey

Usage

  • To run a test either highlight the Test ID or place the cursor within the Test ID text.

Keyboard mappings

The following are the default key mapping for the commands listed above. The defaults can be overridden by adding an entry to the Default keymap - User file.

Mac: - Run single harvey test (reporter=console, output=console): Command-Shift-R - Run single harvey test (reporter=json, output=scratch): Command-Shift-G - Run all tests in harvey test file (reporter=console, output=console): Command-Shift-A - Run all tests in harvey test file (reporter=json, output=scratch): Command-Shift-O - Select a test to run from quick panel (reporter=json, output=scratch): Command-Shift-I - Select a test to run from quick panel (reporter=console, output=console): Command-Shift-U - Run the last test: Command+Shift+L - Create a scratch file: Command+Shift+X - Show the panel: Alt+Shift+O

Linux/Windows: - Run single harvey test (reporter=console, output=console): Control-Shift-R - Run single harvey test (reporter=json, output=scratch): Control-Shift-G - Run all tests in harvey test file (reporter=console, output=console): Control-Shift-A - Run all tests in harvey test file (reporter=json, output=scratch): Control-Shift-O - Select a test to run from quick panel (reporter=json, output=scratch): Control-Shift-I - Select a test to run from quick panel (reporter=console, output=console): Control-Shift-U - Run the last test: Control+Shift+L - Create a scratch file: Control+Shift+X - Show the panel: Alt+Shift+O

Overriding Default Keybindings

To override the default keybindings your User Keybinding File and add the following keybindings:

To override the harvey_run_test command

[
    {
        "keys": ["ctrl+shift+r"],
        "command": "harvey_run_test",
        "args": {
            // To run all tests in a test file, set this value to true
            "all": false,
            // Reporter to be used in the Harvey command
            // Valid reporters: console, json
            "reporter": "console",
            // To output to a scratch file, set this value to true
            // false will output to console
            "scratch": false
        }
    }
]

To override the harvey_select_test command

[
    {
        "keys": ["super+shift+u"],
        "command": "harvey_select_test",
        "args": {
            // Reporter to be used in the Harvey command
            // Valid reporters: console, json
            "reporter": "console",
            // To output to a scratch file, set this value to true
            // false will output to console
            "scratch": false
        }
    }
]

Configuring

There are a few settings available to customize the harvey-sublime plugin. For the latest information on what settings are available, select the menu item Preferences->Package Settings->Harvey->Settings - Default.

Do NOT edit the default harvey-sublime settings. Your changes will be lost when the plugin is updated. ALWAYS edit the user harvey-sublime settings by selecting Preferences->Package Settings->Harvey->Settings - User. Note that individual settings you include in your user settings will completely replace the corresponding default setting, so you must provide that setting in its entirety.

Settings

The following is a description of the settings that can be overridden in the settings file:

  • node - This is the location where the node executable lives. By default it expects the executable to be on the user's PATH. To configure the plugin to use another version of node.

  • harvey-test-dir - This is the directory within the current project where the harvey tests live. (Default: test/integration)

  • harvey - The location of the Harvey executable. (Default: node_modules/harvey/bin/harvey)

  • config - The config file to be used in the command line argument. (Default: test/integration/config.json)