This repository has been archived by the owner on Sep 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjasminematchers.js
397 lines (395 loc) · 18.4 KB
/
jasminematchers.js
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
(function(mod) {
if (typeof exports == "object" && typeof module == "object") { // CommonJS
return mod(require("tern/lib/infer"), require("tern/lib/tern"));
}
if (typeof define == "function" && define.amd) // AMD
return define([ "tern/lib/infer", "tern/lib/tern" ], mod);
mod(tern, tern);
})(function(infer, tern) {
"use strict";
/**
* Documentation: https://github.com/JamieMason/Jasmine-Matchers/blob/master/README.md
*/
tern.registerPlugin("jasminematchers", function(server, options) {
return {
defs : defs
};
});
var defs = {
"!name": "jasminematchers",
"!define": {
"!jasmine": {
"toBeArray": {
"!type": "fn()",
"!doc": "Example: expect([]).toBeArray();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobearray"
},
"toHaveArray": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: []}).toHaveArray('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavearray"
},
"toBeArrayOfBooleans": {
"!type": "fn()",
"!doc": "Example: expect([true, false, true]).toBeArrayOfBooleans();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobearrayofbooleans"
},
"toHaveArrayOfBooleans": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: [true, false, true]}).toHaveArrayOfBooleans('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavearrayofbooleans"
},
"toBeArrayOfNumbers": {
"!type": "fn()",
"!doc": "Example: expect([12, 82, 7]).toBeArrayOfNumbers();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobearrayofnumbers"
},
"toHaveArrayOfNumbers": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: [12, 82, 7]}).toHaveArrayOfNumbers('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavearrayofnumbers"
},
"toBeArrayOfObjects": {
"!type": "fn()",
"!doc": "Example: expect([{}, {}]).toBeArrayOfObjects();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobearrayofobjects"
},
"toHaveArrayOfObjects": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: [{}, {}]}).toHaveArrayOfObjects('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavearrayofobjects"
},
"toBeArrayOfSize": {
"!type": "fn()",
"!doc": "Example: expect([null, 31, 'hi']).toBeArrayOfSize(3);",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobearrayofsize"
},
"toHaveArrayOfSize": {
"!type": "fn(memberName: string, size: number)",
"!doc": "Example: expect({memberName: [null, 31, 'hi']).toBeArrayOfSi}).toHaveArrayOfSize('memberName', size);",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavearrayofsize"
},
"toBeArrayOfStrings": {
"!type": "fn()",
"!doc": "Example: expect(['foo', 'bar']).toBeArrayOfStrings();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobearrayofstrings"
},
"toHaveArrayOfStrings": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: ['foo', 'bar']}).toHaveArrayOfStrings('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavearrayofstrings"
},
"toBeEmptyArray": {
"!type": "fn()",
"!doc": "Example: expect([]).toBeEmptyArray();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobeemptyarray"
},
"toHaveEmptyArray": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: []}).toHaveEmptyArray('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohaveemptyarray"
},
"toBeNonEmptyArray": {
"!type": "fn()",
"!doc": "Example: expect([98, 'banana']).toBeNonEmptyArray();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobenonemptyarray"
},
"toHaveNonEmptyArray": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: [98, 'banana']}).toHaveNonEmptyArray('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavenonemptyarray"
},
"toBeBoolean": {
"!type": "fn()",
"!doc": "Example: expect(false).toBeBoolean();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobeboolean"
},
"toHaveBoolean": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: false}).toHaveBoolean('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohaveboolean"
},
"toBeFalse": {
"!type": "fn()",
"!doc": "Example: expect(false).toBeFalse();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobefalse"
},
"toHaveFalse": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: false}).toHaveFalse('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavefalse"
},
"toBeTrue": {
"!type": "fn()",
"!doc": "Example: expect(true).toBeTrue();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobetrue"
},
"toHaveTrue": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: true}).toHaveTrue('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavetrue"
},
"toBeAfter": {
"!type": "fn(date: +Date)",
"!doc": "Example: expect(new Date('2014-01-01')).toBeAfter(new Date('1975-01-01'));",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobeafter"
},
"toHaveDateAfter": {
"!type": "fn(memberName: string, date: +Date)",
"!doc": "Example: expect({memberName: new Date('2014-01-01')}).toHaveDateAfter('memberName', new Date('1975-01-01'));",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavedateafter"
},
"toBeBefore": {
"!type": "fn(date: +Date)",
"!doc": "Example: expect(new Date('1975-01-01')).toBeBefore(new Date('2014-01-01'));",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobebefore"
},
"toHaveDateBefore": {
"!type": "fn(memberName: string, date: +Date)",
"!doc": "Example: expect({memberName: new Date('1975-01-01')}).toHaveDateBefore('memberName', new Date('2014-01-01'));",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavedatebefore"
},
"toBeDate": {
"!type": "fn()",
"!doc": "Example: expect(new Date()).toBeDate();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobedate"
},
"toHaveDate": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: new Date()}).toHaveDate('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavedate"
},
"toBeIso8601": {
"!type": "fn()",
"!doc": "Example: expect('2013-07-08T07:29:15').toBeIso8601();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobeiso8601"
},
"toHaveIso8601": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: '2013-07-08T07:29:15'}).toHaveIso8601('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohaveiso8601"
},
"toBeFunction": {
"!type": "fn()",
"!doc": "Example: expect(function() {}).toBeFunction();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobefunction"
},
"toHaveMethod": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: function() {}}).toHaveMethod('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavemethod"
},
"toThrowAnyError": {
"!type": "fn()",
"!doc": "Example: expect(function() {return badReference.unreachable;}).toThrowAnyError();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tothrowanyerror"
},
"toThrowErrorOfType": {
"!type": "fn(errorType: fn())",
"!doc": "Example: expect(function() {return badReference.unreachable;}).toThrowErrorOfType(ReferenceError);",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tothrowerroroftype"
},
"toBeCalculable": {
"!type": "fn()",
"!doc": "Example: expect('12').toBeCalculable();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobecalculable"
},
"toHaveCalculable": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: '14'}).toHaveCalculable('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavecalculable"
},
"toBeEvenNumber": {
"!type": "fn()",
"!doc": "Example: expect(4).toBeEvenNumber();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobeevennumber"
},
"toHaveEvenNumber": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: 4}).toHaveEvenNumber('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohaveevennumber"
},
"toBeNumber": {
"!type": "fn()",
"!doc": "Example: expect(66).toBeNumber();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobenumber"
},
"toHaveNumber": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: 66}).toHaveNumber('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavenumber"
},
"toBeOddNumber": {
"!type": "fn()",
"!doc": "Example: expect(3).toBeOddNumber();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobeoddnumber"
},
"toHaveOddNumber": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: 3}).toHaveOddNumber('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohaveoddnumber"
},
"toBeWholeNumber": {
"!type": "fn()",
"!doc": "Example: expect(10).toBeWholeNumber();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobewholenumber"
},
"toHaveWholeNumber": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: 10}).toHaveWholeNumber('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavewholenumber"
},
"toBeWithinRange": {
"!type": "fn()",
"!doc": "Example: expect(6).toBeWithinRange(0, 10);",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobewithinrange"
},
"toHaveNumberWithinRange": {
"!type": "fn(memberName: string, rangeStart: number, rangeEnd: number)",
"!doc": "Example: expect({memberName: 6}).toHaveNumberWithinRange('memberName', 0, 10);",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavenumberwithinrange"
},
"toBeEmptyObject": {
"!type": "fn()",
"!doc": "Example: expect({}).toBeEmptyObject();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobeemptyobject"
},
"toHaveEmptyObject": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: {}}).toHaveEmptyObject('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohaveemptyobject"
},
"toBeNonEmptyObject": {
"!type": "fn()",
"!doc": "Example: expect({some: 'data'}).toBeNonEmptyObject();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobenonemptyobject"
},
"toHaveNonEmptyObject": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: {some: 'data'}}).toHaveNonEmptyObject('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavenonemptyobject"
},
"toBeObject": {
"!type": "fn()",
"!doc": "Example: expect({}).toBeObject();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobeobject"
},
"toHaveObject": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: {}}).toHaveObject('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohaveobject"
},
"toHaveMember": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: undefined}).toHaveMember('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavemember"
},
"toImplement": {
"!type": "fn(obj: ?)",
"!doc": "Example: expect({name: 'Clive',age: 72}).toImplement({name: String,age: Number});",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#toimplement"
},
"toBeEmptyString": {
"!type": "fn()",
"!doc": "Example: expect('').toBeEmptyString();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobeemptystring"
},
"toHaveEmptyString": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: ''}).toHaveEmptyString('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohaveemptystring"
},
"toBeHtmlString": {
"!type": "fn()",
"!doc": "Example: expect('<div></div>').toBeHtmlString();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobehtmlstring"
},
"toHaveHtmlString": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: '<div></div>'}).toHaveHtmlString('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavehtmlstring"
},
"toBeJsonString": {
"!type": "fn()",
"!doc": "Example: expect('{\"name\":\"Winston\"}').toBeJsonString();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobejsonstring"
},
"toHaveJsonString": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: '{\"name\":\"Winston\"}'}).toHaveJsonString('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavejsonstring"
},
"toBeLongerThan": {
"!type": "fn(str: string)",
"!doc": "Example: expect('Antidisestablishmentarianism').toBeLongerThan('No');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobelongerthan"
},
"toHaveStringLongerThan": {
"!type": "fn(memberName: string, str: string)",
"!doc": "Example: expect({memberName: 'Antidisestablishmentarianism'}).toHaveStringLongerThan('memberName', 'No');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavestringlongerthan"
},
"toBeNonEmptyString": {
"!type": "fn()",
"!doc": "Example: expect('filled up').toBeNonEmptyString();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobenonemptystring"
},
"toHaveNonEmptyString": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: 'filled up'}).toHaveNonEmptyString('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavenonemptystring"
},
"toBeSameLengthAs": {
"!type": "fn(str: string)",
"!doc": "Example: expect('Paul').toBeSameLengthAs('Jean');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobesamelengthas"
},
"toHaveStringSameLengthAs": {
"!type": "fn(memberName: string, str: string)",
"!doc": "Example: expect({memberName: 'Paul'}).toHaveStringSameLengthAs('memberName', 'Jean');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavestringsamelengthas"
},
"toBeShorterThan": {
"!type": "fn()",
"!doc": "Example: expect('No').toBeShorterThan('Antidisestablishmentarianism');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobeshorterthan"
},
"toHaveStringShorterThan": {
"!type": "fn(memberName: string, str: string)",
"!doc": "Example: expect({memberName: 'No'}).toHaveStringShorterThan('memberName', 'Antidisestablishmentarianism');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavestringshorterthan"
},
"toBeString": {
"!type": "fn()",
"!doc": "Example: expect('').toBeString();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobestring"
},
"toHaveString": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: ''}).toHaveString('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavestring"
},
"toBeWhitespace": {
"!type": "fn()",
"!doc": "Example: expect(' ').toBeWhitespace();",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tobewhitespace"
},
"toEndWith": {
"!type": "fn(str: string)",
"!doc": "Example: expect('grandmother').toEndWith('mother');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#toendwith"
},
"toStartWith": {
"!type": "fn(str: string)",
"!doc": "Example: expect('physiotherapy').toStartWith('physio');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tostartwith"
},
"toHaveWhitespaceString": {
"!type": "fn(memberName: string)",
"!doc": "Example: expect({memberName: ' '}).toHaveWhitespaceString('memberName');",
"!url": "https://github.com/JamieMason/Jasmine-Matchers#tohavewhitespacestring"
}
}
},
};
});