Skip to content

Instantly share code, notes, and snippets.

@tsimons
Last active August 29, 2015 14:16
Show Gist options
  • Save tsimons/6d922074a397739e85ef to your computer and use it in GitHub Desktop.
Save tsimons/6d922074a397739e85ef to your computer and use it in GitHub Desktop.
Sublime Snippets
<snippet>
<content><![CDATA[
afterEach(function () {
$0
});
]]></content>
<tabTrigger>aftereach</tabTrigger>
<description>Jasmine afterEach block</description>
</snippet>
<snippet>
<content><![CDATA[
define(function (require, exports, module) {
var $1 = require('$2')
, expect = require('chai').expect
, sinon = require('sinon')
, Backbone = require('backbone')
;
describe('$1 View', function () {
var sandbox, $3;
beforeEach(function () {
sandbox = sinon.sandbox.create();
sandbox.stub($1.prototype, 'initialize');
sandbox.stub(Backbone, 'trigger');
$3 = new $1();
});
afterEach(function () {
sandbox.restore();
});
describe('initialize method', function () {
it('$0', function () {
});
});
});
});
]]></content>
<tabTrigger>amdtest</tabTrigger>
<description>Setup test for Mocha/AMD/Backbone</description>
</snippet>
<snippet>
<content><![CDATA[
beforeEach(function () {
$0
});
]]></content>
<tabTrigger>beforeeach</tabTrigger>
<description>Jasmine beforeEach block</description>
</snippet>
<snippet>
<content><![CDATA[
define(function (require, exports, module) {
var $1 = require('$2');
exports = module.exports = $0
});
]]></content>
<tabTrigger>define</tabTrigger>
</snippet>
<snippet>
<content><![CDATA[
describe('$1', function () {
$0
});
]]></content>
<tabTrigger>describe</tabTrigger>
<description>Jasmine describe block</description>
</snippet>
<snippet>
<content><![CDATA[
expect($1).${2:to.be}($0);
]]></content>
<tabTrigger>expect</tabTrigger>
<description>Jasmine expect statement</description>
</snippet>
<snippet>
<content><![CDATA[
function ${1:name }($2) {
$0
}${3:;}
]]></content>
<tabTrigger>func</tabTrigger>
</snippet>
<snippet>
<content><![CDATA[
it('$1', function () {
$0
});
]]></content>
<tabTrigger>it</tabTrigger>
<description>Jasmine it block</description>
</snippet>
<snippet>
<content><![CDATA[
console.log($1);
]]></content>
<tabTrigger>log</tabTrigger>
<description>console.log snippet</description>
</snippet>
<snippet>
<content><![CDATA[
require('$0')${1:;}
]]></content>
<tabTrigger>req</tabTrigger>
<description>require() snippet for commonjs modules</description>
</snippet>
<snippet>
<content><![CDATA[
/**
* ${1:Enter description}
*
* @${0:param}
*/
]]></content>
<tabTrigger>yui</tabTrigger>
<description>starter for yui syntax documentation</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment