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
Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7
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)