forked from vim-scripts/Jasmine-snippets-for-snipMate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
149 lines (112 loc) · 2.93 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
This is a mirror of http://www.vim.org/scripts/script.php?script_id=3249
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}