Last active
December 30, 2016 09:15
-
-
Save chrisjaure/6515906 to your computer and use it in GitHub Desktop.
Revisions
-
chrisjaure revised this gist
Dec 30, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ describe('${1:SuiteName}', function() { scope = \$rootScope.\$new(); \$compile(elm)(scope); scope.\$digest(); // isolateScope = elm.isolateScope(); }); }); -
chrisjaure created this gist
Sep 10, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ <snippet> <content><![CDATA[ describe('${1:SuiteName}', function() { var scope, \$httpBackend, initController; beforeEach(function() { module('${2:ModuleName}', function(\$provide){ }); inject(function(\$injector) { var \$rootScope, \$controller; \$rootScope = \$injector.get('\$rootScope'); \$controller = \$injector.get('\$controller'); \$httpBackend = \$injector.get('\$httpBackend'); scope = \$rootScope.\$new(); initController = function(opts) { \$controller('${3:ControllerName}', angular.extend({ \$scope: scope }, (opts || {}))); }; }); }); afterEach(function() { // \$httpBackend.verifyNoOutstandingExpectation(); // \$httpBackend.verifyNoOutstandingRequest(); scope.\$destroy(); }); it('should pass', function() { // \$httpBackend.expectGET('').respond(200); initController(); }); }); ]]></content> <tabTrigger>ng:test:c</tabTrigger> <scope>source.js</scope> </snippet> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ <snippet> <content><![CDATA[ describe('${1:SuiteName}', function() { var elm, scope, isolateScope, html = '${3:<div>Element Template</div>}'; beforeEach(function() { module('${2:ModuleName}', function(\$provide){ }); inject(function(\$injector) { var \$compile, \$templateCache, \$rootScope; \$compile = \$injector.get('\$compile'); \$rootScope = \$injector.get('\$rootScope'); // \$templateCache = \$injector.get('\$templateCache'); // \$templateCache.put('${4:templateUrl}', '<div></div>'); elm = angular.element(html); scope = \$rootScope.\$new(); \$compile(elm)(scope); scope.\$digest(); // isolateScope = elm.scope(); }); }); afterEach(function() { scope.\$destroy(); }); it('should pass', function() { }); }); ]]></content> <tabTrigger>ng:test:d</tabTrigger> <scope>source.js</scope> </snippet> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ <snippet> <content><![CDATA[ describe('${1:SuiteName}', function() { var ${3:ServiceName}, scope; beforeEach(function() { module('${2:ModuleName}', function(\$provide){ }); inject(function(\$injector) { var \$rootScope; \$rootScope = \$injector.get('\$rootScope'); ${3:ServiceName} = \$injector.get('${3:ServiceName}'); scope = \$rootScope.\$new(); }); }); afterEach(function() { scope.\$destroy(); }); it('should pass', function() { }); }); ]]></content> <tabTrigger>ng:test:s</tabTrigger> <scope>source.js</scope> </snippet>