Jasmine snippets (for snipMate)


Ⅰ. 插件描述

A set of snippets for the Jasmine JavaScript BDD Framework

Ⅱ. 基本信息

创建日期:  2010-09-22
使用用户:  4
Github星:  6
插件作者:  Brian Egan

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/jasmine-snippets-for-snipmate'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/jasmine-snippets-for-snipmate'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/jasmine-snippets-for-snipmate'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/Jasmine-snippets-for-snipMate

Ⅳ. 文档说明

Jasmine (http://pivotal.github.com/jasmine/) is a behavior-driven-development framework for JavaScript with some very nice features. This set of snipMate snippets aims to make developing tests with Jasmine quicker and easier.

For example, rather than typing out the full:

"description('Description Here', function() {});"

You can type "des<TAB>". This will create the full description block, with convenient tab stops. Tre magnifique!

List of Included Snippets (this is actually just the file):

After Each

snippet aft

afterEach(function() { 
    ${1} 
}

Any

snippet any

jasmine.any(${1})

Before Each

snippet bef

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

Describe

snippet des

describe("${1:description}", function() {
    ${2}
});${3}    

Expect not to be defined

snippet notd

expect(${1:target}).not.toBeDefined();${2}

Expect not to be falsy

snippet notf

expect(${1:target}).not.toBeFalsy();${2}

Expect not to be null

snippet notn

expect(${1:target}).not.toBeNull();${2}

Expect to be truthy

snippet nott

expect(${1:target}).not.toBeTruthy();${2}

Expect not to contain

snippet notc

expect(${1:target}).not.toContain(${2:value});${3}

Expect not to equal

snippet note

expect(${1:target}).not.toEqual(${2:value});${3}

Expect not to match

snippet notm

expect(${1:target}).not.toBeDefined();${2}

Expect not

snippet notx

expect(${1:target}).not;${2}

Expect to be defined

snippet ed

expect(${1:target}).toBeDefined();${2}

Expect to be falsy

snippet ef

expect(${1:target}).toBeFalsy();${2}

Expect to be null

snippet en

expect(${1:target}).toBeNull();${2}

Expect to be truthy

snippet et

expect(${1:target}).toBeTruthy();${2}

Expect to contain

snippet ec

expect(${1:target}).toContain(${2:value});${3}

Expect to equal

snippet ee

expect(${1:target}).toEqual(${2:value});${3}

Expect to match

snippet em

expect(${1:target}).toMatch(${2:pattern});${3}

Expect was called with

snippet escw

expect(${1:target}).wasCalledWith(${2:arguments});${3}

Expect was called

snippet esc

expect(${1:target}).wasCalled();${2}

Expect was not called with

snippet notscw

expect(${1:target}).wasNotCalledWith(${2:arguments});${3}

Expect was not called

snippet notsc

expect(${1:target}).wasNotCalled();${3}

Expect

snippet ex

expect(${1:target});${2}

It

snippet it

it("${1:description}", function() {
    ${2}
});${3}

Runs

snippet ru

runs(function() {
    ${1}
});${2}

Spy on and call fake

snippet scf

spyOn(${1:object}, "${2:method}").andCallFake(${3:function});${4}

Spy on and call through

snippet sct

spyOn(${1:object}, "${2:method}").andCallThrough();${3}

Spy on and return

snippet sr

spyOn(${1:object}, "${2:method}").andReturn(${3:arguments});${4}

Spy on and throw

snippet st

spyOn(${1:object}, "${2:method}").andThrow(${3:exception});${4}

Spy on

snippet s

spyOn(${1:object}, "${2:method}");${3}

Waits (wa)

snippet wa

waits(${1});${2}

添加新评论