-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnippets.cson
80 lines (62 loc) · 2.32 KB
/
snippets.cson
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
'.source.js':
'Mocha-CodeRoad Function':
'prefix': 'mochacr-f'
'body': """
const expect = require('chai').expect;
describe('${1:task number ('01')} ${2:function name}', () => {
it('should exist', () => {
expect(${2}).to.not.be.undefined;
});
it('should be a function', () => {
expect(${2}).to.be.a('function');
});
it('should take ${3} parameter(s)', () => {
expect(${2}).to.have.length(${3});
});
it('should have the correct output', () => {
const input = ${4: function input};
const output = ${5: function output};
expect(${2}(input)).to.deep.equal(output);
});
});
"""
'Mocha-CodeRoad Array':
'prefix': 'mochacr-a'
'body': """
const expect = require('chai').expect;
describe('${1:task number ('01')} ${2:variable name}', () => {
it('should exist', () => {
expect(${2}).to.not.be.undefined;
});
it('should be an array', () => {
expect(${2}).to.be.instanceof(Array);
});
it('should take have ${3} items', () => {
expect(${2}).to.have.length(${3});
});
it('should have the correct values', () => {
const result = [${4: array of values}];
expect(${2}.to.deep.equal(result);
});
});
"""
'Mocha-CodeRoad Object':
'prefix': 'mochacr-o'
'body': """
const expect = require('chai').expect;
describe('${1:task number ('01')} ${2:variable name}', () => {
it('should exist', () => {
expect(${2}).to.not.be.undefined;
});
it('should be an object', () => {
expect(${2}).to.be.an('object');
});
it('should take have property ${3}', () => {
expect(${2}).to.have.property(${3});
});
it('should have the correct value', () => {
const result = ${4: object};
expect(${2}.to.deep.equal(result);
});
});
"""