Skip to content

Live Templates for working with Jasmine BDD. Closely goes with functionality in the TextMate bundle provided by pivotal

Notifications You must be signed in to change notification settings

bbostow/jasmine-intellij-idea-live-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

Jasmine is a behavior-driven development framework for testing your JavaScript code [Jasmine].

This is an IntelliJ IDEA Live Template for the Jasmine JavaScript BDD Framework and Jasmine JQuery extention.

About

This is are IntelliJ IDEA Live Templates for working with the Jasmine Framework. It contains two files. These files work with any JavaScript file as specified in the File Types.

##Jasmine.xml This is the main template for the Jasmine Framework

##Jasmine_jquery.xml This is the additional template for working with the Jasmine jquery extention.

Commands

The commands are delemited by . Hitting goes to the next $VALn$ where n is the number of tab presses until $END$ is reached. For instance typing in typing in ec will put you at $VAL0$ in expect($VAL0$).toContain($VAL1$);$END$. Hitting again will take you to $VAL1$ hitting one last time will take you to the $END$ from here tab becomes a tab character.

Jasmine Commands

aft

After each

afterEach(function () {  
	$END$  
});

any

any

jasmine.jasmine.any($VAL0$);$END$

bef

before each

beforeEach(function () {  
    $END$      
});

des

describe jasmine

describe("$VAL0$", function () {  
    $END$  
});

ec

expect to contain

expect($VAL0$).toContain($VAL1$);$END$

ed

expect to be defined

expect($VAL0$).toBeDefined();$END$

ee

expect to equal

expect($VAL0$).toEqual($VAL1$);$END$

ef

expect to match

expect($VAL0$).toBeFalsy();$END$

en

expect to be null

expect($VAL0$).toBeNull();$END$

esc

expect was called

expect($VAL0$).wasCalled();$END$

escw

expect was called with

expect($VAL0$).wasCalledWith($VAL1$);$END$

et

expect to be truthy

expect($VAL0$).toBeTruthy();$END$

ex

expect

expect($VAL0$)$END$;

it

it

it("$VAL0$", function () {  
    $END$  
});

notc

expect not to contain

expect($VAL0$).not.toContain($VAL1$);$END$

notd

expect not to be defined

expect($VAL0$).not.toBeDefined();$END$

note

expect not to equal

expect($VAL0$).not.toEqual($VAL1$);$END$

notf

expect not to be falsy

expect($VAL0$).not.toBeFalsy();$END$

notm

expect not to match

expect($VAL0$).not.toMatch($VAL1$);$END$

notn

expect not to be null

expect($VAL0$).not.toBeNull();$END$

notsc

expect was not called

expect($VAL0$).wasNotCalled();$END$

notscw

expect was not called with

expect($VAL0$).wasNotCalledWith($VAL1$);$END$

nott

expect not to be truthy

expect($VAL0$).not.toBeTruthy();$END$

notx

expect not

expect($VAL0$).not$END$;

runs

runs

runs(function () {  
    $END$  
});

s

spy on

spyOn($VAL0$, "$VAL1$")$END$;

scf

spy on and call fake

spyOn($VAL0$, "$VAL1$").andCallFake($VAL2$);$END$

sct

spy on and call through

spyOn($VAL0$, "$VAL1$").andCallThrough();$END$

sr

spy on and return

spyOn($VAL0$, "$VAL1$").andReturn($VAL2$);$END$

st

spy on and throw

spyOn($VAL0$, "$VAL1$").andThrow($VAL2$);$END$

wa

waits

waits($VAL0$);$END$

Jasmine-Jquery

eb

expect to be

expect($VAL0$).toBe($VAL1$);$END$

ebc

expect to be checked

expect($VAL0$).toBeChecked();$END$

lf

load fixutre

loadFixtures($VAL0$);$END$

rf

read fixture

readFixture($VAL0$);$END$

sf

set fixture

setFixture($VAL0$);$END$

More

Live Template Installation

Copy the xml file(s) to the live templates directory:

  • Windows: <your home directory>\.<product name><version number>\config\templates
  • Linux: ~\.<product name><version number>\config\templates
  • MacOS: ~/Library/Preferences/<product name><version number>/templates

About

Live Templates for working with Jasmine BDD. Closely goes with functionality in the TextMate bundle provided by pivotal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published