Skip to content

Instantly share code, notes, and snippets.

@jackysee
Created January 29, 2014 01:55
Show Gist options
  • Save jackysee/8680381 to your computer and use it in GitHub Desktop.
Save jackysee/8680381 to your computer and use it in GitHub Desktop.
AngularDirectiveTest.sublime-snippet
<snippet>
<content><![CDATA[
'use strict';
describe("${1}", function() {
beforeEach(module('${2}'));
var scope, compile, el;
beforeEach(inject(function(\$rootScope, \$compile){
scope = \$rootScope.\$new();
compile = \$compile;
}));
function createElement(tpl){
el = angular.element(tpl);
compile(el)(scope);
scope.\$digest();
}
it("should create element", function(){
createElement("${3}");
});
});]]></content>
<tabTrigger>directivetest</tabTrigger>
<scope>source.js</scope>
<description>Angular Directive test</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment