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.
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.
The commands are delemited by . Hitting goes to the next expect($VAL0$).toContain($VAL1$);$END$
. Hitting again will take you to
After each
afterEach(function () {
$END$
});
any
jasmine.jasmine.any($VAL0$);$END$
before each
beforeEach(function () {
$END$
});
describe jasmine
describe("$VAL0$", function () {
$END$
});
expect to contain
expect($VAL0$).toContain($VAL1$);$END$
expect to be defined
expect($VAL0$).toBeDefined();$END$
expect to equal
expect($VAL0$).toEqual($VAL1$);$END$
expect to match
expect($VAL0$).toBeFalsy();$END$
expect to be null
expect($VAL0$).toBeNull();$END$
expect was called
expect($VAL0$).wasCalled();$END$
expect was called with
expect($VAL0$).wasCalledWith($VAL1$);$END$
expect to be truthy
expect($VAL0$).toBeTruthy();$END$
expect
expect($VAL0$)$END$;
it
it("$VAL0$", function () {
$END$
});
expect not to contain
expect($VAL0$).not.toContain($VAL1$);$END$
expect not to be defined
expect($VAL0$).not.toBeDefined();$END$
expect not to equal
expect($VAL0$).not.toEqual($VAL1$);$END$
expect not to be falsy
expect($VAL0$).not.toBeFalsy();$END$
expect not to match
expect($VAL0$).not.toMatch($VAL1$);$END$
expect not to be null
expect($VAL0$).not.toBeNull();$END$
expect was not called
expect($VAL0$).wasNotCalled();$END$
expect was not called with
expect($VAL0$).wasNotCalledWith($VAL1$);$END$
expect not to be truthy
expect($VAL0$).not.toBeTruthy();$END$
expect not
expect($VAL0$).not$END$;
runs
runs(function () {
$END$
});
spy on
spyOn($VAL0$, "$VAL1$")$END$;
spy on and call fake
spyOn($VAL0$, "$VAL1$").andCallFake($VAL2$);$END$
spy on and call through
spyOn($VAL0$, "$VAL1$").andCallThrough();$END$
spy on and return
spyOn($VAL0$, "$VAL1$").andReturn($VAL2$);$END$
spy on and throw
spyOn($VAL0$, "$VAL1$").andThrow($VAL2$);$END$
waits
waits($VAL0$);$END$
expect to be
expect($VAL0$).toBe($VAL1$);$END$
expect to be checked
expect($VAL0$).toBeChecked();$END$
load fixutre
loadFixtures($VAL0$);$END$
read fixture
readFixture($VAL0$);$END$
set fixture
setFixture($VAL0$);$END$
Copy the xml file to "~/Library/Preferences/IntelliJIdea11/templates/"