All Projects → nicosantangelo → sublime-jasmine

nicosantangelo / sublime-jasmine

Licence: MIT license
Jasmine syntax, snippets and commands

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to sublime-jasmine

Notes
📔 Linux、MySQL、Nginx、PHP、Git、Shell 等笔记
Stars: ✭ 1,835 (+7545.83%)
Mutual labels:  sublime
sublime
Repository for the Tandem Sublime Plugin
Stars: ✭ 22 (-8.33%)
Mutual labels:  sublime
eslint-plugin-no-only-tests
ESLint rule for catching focused/only test blocks
Stars: ✭ 67 (+179.17%)
Mutual labels:  jasmine
Css3
The most complete CSS support for Sublime Text
Stars: ✭ 178 (+641.67%)
Mutual labels:  sublime
Fuzzysort
Fast SublimeText-like fuzzy search for JavaScript.
Stars: ✭ 2,569 (+10604.17%)
Mutual labels:  sublime
bioSyntax-archive
Syntax highlighting for computational biology
Stars: ✭ 16 (-33.33%)
Mutual labels:  sublime
Ironpython Stubs
Autocomplete stubs for common IronPython/.NET libraries
Stars: ✭ 135 (+462.5%)
Mutual labels:  sublime
dotfiles
Setup git, vim, zsh, SublimeText, tmux etc. using one command
Stars: ✭ 107 (+345.83%)
Mutual labels:  sublime
Sublimetmpl
Create File From Templates for SublimeText 2 / SublimeText 3
Stars: ✭ 222 (+825%)
Mutual labels:  sublime
jasmine-styleguide
Suggested best practices when writing Jasmine unit tests.
Stars: ✭ 65 (+170.83%)
Mutual labels:  jasmine
Jeffrey Way Theme
Jeffrey Way's theme on Laracasts. Example: https://laracasts.com/series/whats-new-in-laravel-5-1/episodes/2.
Stars: ✭ 180 (+650%)
Mutual labels:  sublime
Sublimehyperclick
Quickly and easily jump between your files. The missing part of Go to definition functionality in Sublime.
Stars: ✭ 200 (+733.33%)
Mutual labels:  sublime
Sublime-GameMaker-Studio-Language-Bundle
A sublime bundle for GameMaker Language (GML)
Stars: ✭ 32 (+33.33%)
Mutual labels:  sublime
Electronic Interchange Github Resources
List of EDI (Mostly) Github Resources
Stars: ✭ 145 (+504.17%)
Mutual labels:  sublime
GoDebug
Go debugger (Delve) integration with Sublime Text 3
Stars: ✭ 20 (-16.67%)
Mutual labels:  sublime
Tabnine Sublime
Tabnine Autocomplete AI: JavaScript, Python, TypeScript, PHP, C/C++, HTML/CSS, Go, Java, Ruby, C#, Rust, SQL, Bash, Kotlin, Julia, Lua, OCaml, Perl, Haskell, React
Stars: ✭ 144 (+500%)
Mutual labels:  sublime
sublime-simple-import
A Sublime Text Plugin that helps you to import your modules.
Stars: ✭ 15 (-37.5%)
Mutual labels:  sublime
observer-spy
This library makes RxJS Observables testing easy!
Stars: ✭ 310 (+1191.67%)
Mutual labels:  jasmine
dotfiles
My dotfiles (vim/conky/etc.)
Stars: ✭ 79 (+229.17%)
Mutual labels:  sublime
sublime-zig-language
Zig language support for Sublime Text
Stars: ✭ 62 (+158.33%)
Mutual labels:  sublime

Jasmine

Sublime Text package that includes syntax highlighting, snippets and commands for Jasmine the Javascript BDD framework.

This package is a merge between Jasmine BDD from @caiogondim and Jasmine from @gja.

Snippets

Below is a list of all snippets currently supported on this package and the triggers of each one. The means the TAB key.

Specs

  • describe: desc⇥
  • xdescribe: xdesc⇥
  • fdescribe: fdesc⇥
  • it: it⇥
  • xit: xit⇥
  • fit: fit⇥
  • afterEach: ae⇥
  • beforeEach: be⇥

Expectations

  • expect: exp⇥
  • expect().toBe: tb⇥
  • expect().toBeCloseTo: tbct⇥
  • expect().toBeDefined: tbd⇥
  • expect().toBeFalsy: tbf⇥
  • expect().toBeGreaterThan: tbgt⇥
  • expect().toBeLessThan: tblt⇥
  • expect().toBeNull: tbn⇥
  • expect().toBeTruthy: tbt⇥
  • expect().toBeUndefined: tbu⇥
  • expect().toContain: tc⇥
  • expect().toEqual: te⇥
  • expect().toHaveBeenCalled: thbc⇥
  • expect().toHaveBeenCalledWith: thbcw⇥
  • expect().toMatch: tm⇥
  • expect().toThrow: tt⇥
  • expect().toThrowError: tte⇥
  • expect().not.toBe: nb⇥
  • expect().not.toBeCloseTo: nct⇥
  • expect().not.toBeDefined: nd⇥
  • expect().not.toBeFalsy: nf⇥
  • expect().not.toBeGreaterThan: ngt⇥
  • expect().not.toBeLessThan: nlt⇥
  • expect().not.toBeNull: nn⇥
  • expect().not.toBeTruthy: nt⇥
  • expect().not.toBeUndefined: nu⇥
  • expect().not.toContain: nc⇥
  • expect().not.toEqual: ne⇥
  • expect().not.toMatch: nm⇥
  • expect().not.toThrow: nt⇥
  • jasmine.any: any⇥
  • jasmine.objectContaining: oc⇥

Spies

  • spyOn: so⇥
  • spyOn.and.callThrough: sct⇥
  • spyOn.and.callFake: scf⇥
  • spyOn.and.returnValue: srv⇥
  • spyOn.and.stub: ss⇥
  • spyOn.and.throwError: ste⇥
  • spy.calls.all: ca⇥
  • spy.calls.allArgs: caa⇥
  • spy.calls.any: ca⇥
  • spy.calls.argsFor: caf⇥
  • spy.calls.count: cc⇥
  • spy.calls.first: cf⇥
  • spy.calls.mostRecent: cmr⇥
  • spy.calls.reset: cr⇥
  • createSpy: cs⇥
  • createSpyObj: cso⇥

Commands

Switch between code and spec

This command will open the spec or source file that has the same path of the active view file. If you're looking at a source file and the package can't find any specs, it'll display a list of possible directories to create a new one.

To run this command, you can use ctrl+./super+. or ctrl+shift+./super+shift+., this last one will open a split view. Also you can select Jasmine: Switch between code and spec from the command palette.

Create spec file

This command is exactly the same as running Jasmine: Switch between code and spec and not finding specs.

It doesn't have a key binding, but you can use jasmine_create_spec as a command name, like this:

{ "keys": ["KEYS"], "command": "jasmine_create_spec", "args": { "split_view": false } }

(legacy) Switch between code and spec

Runs the command from @gja package, found in run_jasmine.py.

If you want to setup a keybinding for it, you can use:

{ "keys": ["KEYS"], "command": "legacy_jasmine_switch" }

Toggle quotes

This command will change the snippets from the current active quotes to it's counterpart.

For example, it will transform this:

describe("Name of the group", function() {
    
});

to this

describe('Name of the group', function() {
    
});

If you want to setup a keybinding for it, you can use:

{ "keys": ["KEYS"], "command": "jasmine_toggle_quotes" }

Important!

After each toggle you may need to restart Sublime to the changes to take effect.

Command Settings

There are two possible settings:

{
    // Ignore directories when searching for files (source and specs)
    "ignored_directories": [".git", "vendor", "tmp", "node_modules"],

    // The parent folder name for the spec files
    "jasmine_path": "spec",

    // Extension used when creating a new spec file. 
    "spec_file_extension": ".spec.js"
}

Remember that this settings only apply to the new command (they won't affect (legacy) Switch between code and spec).

Syntax

With this package, the editor will recognize .spec.js files as having Jasmine syntax. It will highlight (x)describe and (x)it.

Take into account that any other packages that are using javascript as a syntax may not work with jasmine, you can always turn it back off by opening a .spec.js file and selecting "View > Syntax > Open all with current extension as... > Javascript".

Installation

PackageControl

If you have PackageControl installed, you can use it to install the package.

Just type cmd-shift-p/ctrl-shift-p to bring up the command pallete and pick Package Control: Install Package from the dropdown, search and select the package there and you're all set.

Manual

You can clone the repo in your /Packages (Preferences -> Browse Packages...) folder and start using/hacking it.

cd ~/path/to/Packages
git clone https://github.com/NicoSantangelo/sublime-jasmine.git Jasmine
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].