Permalink
Fetching contributors…
Cannot retrieve contributors at this time
81 lines (62 sloc) 2.32 KB
'.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);
});
});
"""