From fd822bdaf9d04e522aaa5400b673f333190abe98 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 7 Oct 2011 11:27:49 -0700 Subject: chore(formating): clean code to be function() { --- test/CompilerSpec.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'test/CompilerSpec.js') diff --git a/test/CompilerSpec.js b/test/CompilerSpec.js index f0045aa8..e0dcafc0 100644 --- a/test/CompilerSpec.js +++ b/test/CompilerSpec.js @@ -1,9 +1,9 @@ 'use strict'; -describe('compiler', function(){ +describe('compiler', function() { var compiler, markup, attrMarkup, directives, widgets, compile, log, scope; - beforeEach(function(){ + beforeEach(function() { log = ""; directives = { hello: function(expression, element){ @@ -34,13 +34,13 @@ describe('compiler', function(){ }); - afterEach(function(){ + afterEach(function() { dealoc(scope); }); - it('should not allow compilation of multiple roots', function(){ - expect(function(){ + it('should not allow compilation of multiple roots', function() { + expect(function() { compiler.compile('
A
'); }).toThrow("Cannot compile multiple element roots: " + ie("
A
")); function ie(text) { @@ -49,7 +49,7 @@ describe('compiler', function(){ }); - it('should recognize a directive', function(){ + it('should recognize a directive', function() { var e = jqLite('
'); directives.directive = function(expression, element){ log += "found"; @@ -67,13 +67,13 @@ describe('compiler', function(){ }); - it('should recurse to children', function(){ + it('should recurse to children', function() { scope = compile('
'); expect(log).toEqual("hello misko"); }); - it('should observe scope', function(){ + it('should observe scope', function() { scope = compile(''); expect(log).toEqual(""); scope.$digest(); @@ -87,14 +87,14 @@ describe('compiler', function(){ }); - it('should prevent descend', function(){ - directives.stop = function(){ this.descend(false); }; + it('should prevent descend', function() { + directives.stop = function() { this.descend(false); }; scope = compile(''); expect(log).toEqual("hello misko"); }); - it('should allow creation of templates', function(){ + it('should allow creation of templates', function() { directives.duplicate = function(expr, element){ element.replaceWith(document.createComment("marker")); element.removeAttr("duplicate"); @@ -119,7 +119,7 @@ describe('compiler', function(){ }); - it('should process markup before directives', function(){ + it('should process markup before directives', function() { markup.push(function(text, textNode, parentNode) { if (text == 'middle') { expect(textNode.text()).toEqual(text); @@ -133,7 +133,7 @@ describe('compiler', function(){ }); - it('should replace widgets', function(){ + it('should replace widgets', function() { widgets['NG:BUTTON'] = function(element) { expect(element.hasClass('ng-widget')).toEqual(true); element.replaceWith('
button
'); @@ -147,7 +147,7 @@ describe('compiler', function(){ }); - it('should use the replaced element after calling widget', function(){ + it('should use the replaced element after calling widget', function() { widgets['H1'] = function(element) { // HTML elements which are augmented by acting as widgets, should not be marked as so expect(element.hasClass('ng-widget')).toEqual(false); @@ -166,7 +166,7 @@ describe('compiler', function(){ }); - it('should allow multiple markups per text element', function(){ + it('should allow multiple markups per text element', function() { markup.push(function(text, textNode, parent){ var index = text.indexOf('---'); if (index > -1) { @@ -190,7 +190,7 @@ describe('compiler', function(){ }); - it('should add class for namespace elements', function(){ + it('should add class for namespace elements', function() { scope = compile('abc'); var space = jqLite(scope.$element[0].firstChild); expect(space.hasClass('ng-space')).toEqual(true); -- cgit v1.2.3