|
2 | 2 | 'Mocha-CodeRoad Function': |
3 | 3 | 'prefix': 'mochacr-f' |
4 | 4 | 'body': """ |
5 | | - var expect = require('chai').expect; |
| 5 | + const expect = require('chai').expect; |
6 | 6 |
|
7 | | - describe('${1:task number ('01')} ${2:function name}', function () { |
| 7 | + describe('${1:task number ('01')} ${2:function name}', () => { |
8 | 8 |
|
9 | | - it('should exist', function () { |
10 | | - expect(${2}).to.be.defined; |
| 9 | + it('should exist', () => { |
| 10 | + expect(${2}).to.not.be.undefined; |
11 | 11 | }); |
12 | 12 |
|
13 | | - it('should be a function', function () { |
| 13 | + it('should be a function', () => { |
14 | 14 | expect(${2}).to.be.a('function'); |
15 | 15 | }); |
16 | 16 |
|
17 | | - it('should take ${3} parameter(s)', function () { |
| 17 | + it('should take ${3} parameter(s)', () => { |
18 | 18 | expect(${2}).to.have.length(${3}); |
19 | 19 | }); |
20 | 20 |
|
21 | | - it('should have the correct output', function () { |
22 | | - var input = ${4: function input}; |
23 | | - var output = ${5: function output}; |
| 21 | + it('should have the correct output', () => { |
| 22 | + const input = ${4: function input}; |
| 23 | + const output = ${5: function output}; |
24 | 24 | expect(${2}(input)).to.deep.equal(output); |
25 | 25 | }); |
26 | 26 |
|
|
29 | 29 | 'Mocha-CodeRoad Array': |
30 | 30 | 'prefix': 'mochacr-a' |
31 | 31 | 'body': """ |
32 | | - var expect = require('chai').expect; |
| 32 | + const expect = require('chai').expect; |
33 | 33 |
|
34 | | - describe('${1:task number ('01')} ${2:variable name}', function () { |
| 34 | + describe('${1:task number ('01')} ${2:variable name}', () => { |
35 | 35 |
|
36 | | - it('should exist', function () { |
37 | | - expect(${2}).to.be.defined; |
| 36 | + it('should exist', () => { |
| 37 | + expect(${2}).to.not.be.undefined; |
38 | 38 | }); |
39 | 39 |
|
40 | | - it('should be an array', function () { |
| 40 | + it('should be an array', () => { |
41 | 41 | expect(${2}).to.be.instanceof(Array); |
42 | 42 | }); |
43 | 43 |
|
44 | | - it('should take have ${3} items', function () { |
| 44 | + it('should take have ${3} items', () => { |
45 | 45 | expect(${2}).to.have.length(${3}); |
46 | 46 | }); |
47 | 47 |
|
48 | | - it('should have the correct values', function () { |
49 | | - var result = [${4: array of values}]; |
| 48 | + it('should have the correct values', () => { |
| 49 | + const result = [${4: array of values}]; |
50 | 50 | expect(${2}.to.deep.equal(result); |
51 | 51 | }); |
52 | 52 |
|
|
55 | 55 | 'Mocha-CodeRoad Object': |
56 | 56 | 'prefix': 'mochacr-o' |
57 | 57 | 'body': """ |
58 | | - var expect = require('chai').expect; |
| 58 | + const expect = require('chai').expect; |
59 | 59 |
|
60 | | - describe('${1:task number ('01')} ${2:variable name}', function () { |
| 60 | + describe('${1:task number ('01')} ${2:variable name}', () => { |
61 | 61 |
|
62 | | - it('should exist', function () { |
63 | | - expect(${2}).to.be.defined; |
| 62 | + it('should exist', () => { |
| 63 | + expect(${2}).to.not.be.undefined; |
64 | 64 | }); |
65 | 65 |
|
66 | | - it('should be an object', function () { |
| 66 | + it('should be an object', () => { |
67 | 67 | expect(${2}).to.be.an('object'); |
68 | 68 | }); |
69 | 69 |
|
70 | | - it('should take have property ${3}', function () { |
| 70 | + it('should take have property ${3}', () => { |
71 | 71 | expect(${2}).to.have.property(${3}); |
72 | 72 | }); |
73 | 73 |
|
74 | | - it('should have the correct value', function () { |
75 | | - var result = ${4: object}; |
| 74 | + it('should have the correct value', () => { |
| 75 | + const result = ${4: object}; |
76 | 76 | expect(${2}.to.deep.equal(result); |
77 | 77 | }); |
78 | 78 |
|
|
0 commit comments