' +
'
' +
'
' +
@@ -449,7 +449,7 @@ describe('Binder', function(){
assertChild(5, false);
});
- it('ItShouldDisplayErrorWhenActionIsSyntacticlyIncorrect', function(){
+ it('ItShouldDisplayErrorWhenActionIsSyntacticlyIncorrect', function() {
var scope = this.compile('
' +
' ' +
'
', null, true);
@@ -466,7 +466,7 @@ describe('Binder', function(){
toMatchError(/Syntax Error: Token ':' not a primary expression/);
});
- it('ItShouldSelectTheCorrectRadioBox', function(){
+ it('ItShouldSelectTheCorrectRadioBox', function() {
var scope = this.compile('
' +
' ' +
'
');
@@ -486,7 +486,7 @@ describe('Binder', function(){
assertEquals("male", male.val());
});
- it('ItShouldRepeatOnHashes', function(){
+ it('ItShouldRepeatOnHashes', function() {
var scope = this.compile('
');
scope.$apply();
assertEquals('
' +
@@ -497,7 +497,7 @@ describe('Binder', function(){
sortedHtml(scope.$element));
});
- it('ItShouldFireChangeListenersBeforeUpdate', function(){
+ it('ItShouldFireChangeListenersBeforeUpdate', function() {
var scope = this.compile('
');
scope.name = "";
scope.$watch("watched", "name=123");
@@ -509,7 +509,7 @@ describe('Binder', function(){
sortedHtml(scope.$element));
});
- it('ItShouldHandleMultilineBindings', function(){
+ it('ItShouldHandleMultilineBindings', function() {
var scope = this.compile('{{\n 1 \n + \n 2 \n}}
');
scope.$apply();
assertEquals("3", scope.$element.text());
diff --git a/test/BrowserSpecs.js b/test/BrowserSpecs.js
index 692bc5ae..511bb643 100644
--- a/test/BrowserSpecs.js
+++ b/test/BrowserSpecs.js
@@ -46,11 +46,11 @@ function MockWindow() {
};
}
-describe('browser', function(){
+describe('browser', function() {
var browser, fakeWindow, xhr, logs, scripts, removedScripts, sniffer;
- beforeEach(function(){
+ beforeEach(function() {
scripts = [];
removedScripts = [];
xhr = null;
@@ -60,7 +60,7 @@ describe('browser', function(){
var fakeBody = [{appendChild: function(node){scripts.push(node);},
removeChild: function(node){removedScripts.push(node);}}];
- var FakeXhr = function(){
+ var FakeXhr = function() {
xhr = this;
this.open = function(method, url, async){
xhr.method = method;
@@ -91,14 +91,14 @@ describe('browser', function(){
expect(browser.cookies).toBeDefined();
});
- describe('outstading requests', function(){
- it('should process callbacks immedietly with no outstanding requests', function(){
+ describe('outstading requests', function() {
+ it('should process callbacks immedietly with no outstanding requests', function() {
var callback = jasmine.createSpy('callback');
browser.notifyWhenNoOutstandingRequests(callback);
expect(callback).toHaveBeenCalled();
});
- it('should queue callbacks with outstanding requests', function(){
+ it('should queue callbacks with outstanding requests', function() {
var callback = jasmine.createSpy('callback');
browser.xhr('GET', '/url', null, noop);
browser.notifyWhenNoOutstandingRequests(callback);
@@ -110,8 +110,8 @@ describe('browser', function(){
});
});
- describe('xhr', function(){
- describe('JSON', function(){
+ describe('xhr', function() {
+ describe('JSON', function() {
var log;
function callback(code, data) {
@@ -478,12 +478,12 @@ describe('browser', function(){
});
- describe('poller', function(){
+ describe('poller', function() {
- it('should call functions in pollFns in regular intervals', function(){
+ it('should call functions in pollFns in regular intervals', function() {
var log = '';
- browser.addPollFn(function(){log+='a';});
- browser.addPollFn(function(){log+='b';});
+ browser.addPollFn(function() {log+='a';});
+ browser.addPollFn(function() {log+='b';});
expect(log).toEqual('');
fakeWindow.setTimeout.flush();
expect(log).toEqual('ab');
@@ -491,14 +491,14 @@ describe('browser', function(){
expect(log).toEqual('abab');
});
- it('should startPoller', function(){
+ it('should startPoller', function() {
expect(fakeWindow.timeouts.length).toEqual(0);
- browser.addPollFn(function(){});
+ browser.addPollFn(function() {});
expect(fakeWindow.timeouts.length).toEqual(1);
//should remain 1 as it is the check fn
- browser.addPollFn(function(){});
+ browser.addPollFn(function() {});
expect(fakeWindow.timeouts.length).toEqual(1);
});
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);
diff --git a/test/FiltersSpec.js b/test/FiltersSpec.js
index 672540c5..5bf9df6f 100644
--- a/test/FiltersSpec.js
+++ b/test/FiltersSpec.js
@@ -6,7 +6,7 @@ describe('filter', function() {
it('should called the filter when evaluating expression', function() {
var scope = createScope();
- filter.fakeFilter = function(){};
+ filter.fakeFilter = function() {};
spyOn(filter, 'fakeFilter');
scope.$eval('10|fakeFilter');
@@ -205,7 +205,7 @@ describe('filter', function() {
});
});
- describe('date', function(){
+ describe('date', function() {
var morning = new TzDate(+5, '2010-09-03T12:05:08.000Z'); //7am
var noon = new TzDate(+5, '2010-09-03T17:05:08.000Z'); //12pm
diff --git a/test/InjectorSpec.js b/test/InjectorSpec.js
index ab4f3437..2c6c102a 100644
--- a/test/InjectorSpec.js
+++ b/test/InjectorSpec.js
@@ -1,20 +1,20 @@
'use strict';
-describe('injector', function(){
+describe('injector', function() {
var providers;
var cache;
var injector;
var scope;
- beforeEach(function(){
+ beforeEach(function() {
providers = extensionMap({}, 'providers');
cache = {};
scope = {};
injector = createInjector(scope, providers, cache);
});
- it("should return same instance from calling provider", function(){
- providers('text', function(){ return scope.name; });
+ it("should return same instance from calling provider", function() {
+ providers('text', function() { return scope.name; });
scope.name = 'abc';
expect(injector('text')).toEqual('abc');
expect(cache.text).toEqual('abc');
@@ -22,9 +22,9 @@ describe('injector', function(){
expect(injector('text')).toEqual('abc');
});
- it("should call function", function(){
- providers('a', function(){return 1;});
- providers('b', function(){return 2;});
+ it("should call function", function() {
+ providers('a', function() {return 1;});
+ providers('b', function() {return 2;});
var args;
function fn(a, b, c, d) {
args = [this, a, b, c, d];
@@ -34,15 +34,15 @@ describe('injector', function(){
expect(args).toEqual([{name:'this'}, 1, 2, 3, 4]);
});
- it('should inject providers', function(){
- providers('a', function(){return this.mi = 'Mi';});
+ it('should inject providers', function() {
+ providers('a', function() {return this.mi = 'Mi';});
providers('b', function(mi){return this.name = mi+'sko';}, {$inject:['a']});
expect(injector('b')).toEqual('Misko');
expect(scope).toEqual({mi:'Mi', name:'Misko'});
});
- it('should resolve dependency graph and instantiate all services just once', function(){
+ it('should resolve dependency graph and instantiate all services just once', function() {
var log = [];
// s1
@@ -54,12 +54,12 @@ describe('injector', function(){
// s6
- providers('s1', function(){ log.push('s1'); }, {$inject: ['s2', 's5', 's6']});
- providers('s2', function(){ log.push('s2'); }, {$inject: ['s3', 's4', 's5']});
- providers('s3', function(){ log.push('s3'); }, {$inject: ['s6']});
- providers('s4', function(){ log.push('s4'); }, {$inject: ['s3', 's5']});
- providers('s5', function(){ log.push('s5'); });
- providers('s6', function(){ log.push('s6'); });
+ providers('s1', function() { log.push('s1'); }, {$inject: ['s2', 's5', 's6']});
+ providers('s2', function() { log.push('s2'); }, {$inject: ['s3', 's4', 's5']});
+ providers('s3', function() { log.push('s3'); }, {$inject: ['s6']});
+ providers('s4', function() { log.push('s4'); }, {$inject: ['s3', 's5']});
+ providers('s5', function() { log.push('s5'); });
+ providers('s6', function() { log.push('s6'); });
injector('s1');
@@ -67,32 +67,32 @@ describe('injector', function(){
});
- it('should provide usefull message if no provider', function(){
- expect(function(){
+ it('should provide usefull message if no provider', function() {
+ expect(function() {
injector('idontexist');
}).toThrow("Unknown provider for 'idontexist'.");
});
- it('should autostart eager services', function(){
+ it('should autostart eager services', function() {
var log = '';
- providers('eager', function(){log += 'eager;'; return 'foo';}, {$eager: true});
+ providers('eager', function() {log += 'eager;'; return 'foo';}, {$eager: true});
injector.eager();
expect(log).toEqual('eager;');
expect(injector('eager')).toBe('foo');
});
- describe('annotation', function(){
- it('should return $inject', function(){
- function fn(){}
+ describe('annotation', function() {
+ it('should return $inject', function() {
+ function fn() {}
fn.$inject = ['a'];
expect(inferInjectionArgs(fn)).toBe(fn.$inject);
- expect(inferInjectionArgs(function(){})).toEqual([]);
- expect(inferInjectionArgs(function (){})).toEqual([]);
- expect(inferInjectionArgs(function (){})).toEqual([]);
- expect(inferInjectionArgs(function /* */ (){})).toEqual([]);
+ expect(inferInjectionArgs(function() {})).toEqual([]);
+ expect(inferInjectionArgs(function () {})).toEqual([]);
+ expect(inferInjectionArgs(function () {})).toEqual([]);
+ expect(inferInjectionArgs(function /* */ () {})).toEqual([]);
});
- it('should create $inject', function(){
+ it('should create $inject', function() {
// keep the multi-line to make sure we can handle it
function $f_n0 /*
*/(
@@ -107,40 +107,40 @@ describe('injector', function(){
expect($f_n0.$inject).toEqual(['$a', 'b_', '_c', 'd']);
});
- it('should handle no arg functions', function(){
- function $f_n0(){}
+ it('should handle no arg functions', function() {
+ function $f_n0() {}
expect(inferInjectionArgs($f_n0)).toEqual([]);
expect($f_n0.$inject).toEqual([]);
});
- it('should handle args with both $ and _', function(){
+ it('should handle args with both $ and _', function() {
function $f_n0($a_){}
expect(inferInjectionArgs($f_n0)).toEqual(['$a_']);
expect($f_n0.$inject).toEqual(['$a_']);
});
- it('should throw on non function arg', function(){
- expect(function(){
+ it('should throw on non function arg', function() {
+ expect(function() {
inferInjectionArgs({});
}).toThrow();
});
- it('should infer injection on services', function(){
+ it('should infer injection on services', function() {
var scope = angular.scope({
- a: function(){ return 'a';},
+ a: function() { return 'a';},
b: function(a){ return a + 'b';}
});
expect(scope.$service('b')).toEqual('ab');
});
});
- describe('inject', function(){
- it('should inject names', function(){
+ describe('inject', function() {
+ it('should inject names', function() {
expect(annotate('a', {}).$inject).toEqual(['a']);
expect(annotate('a', 'b', {}).$inject).toEqual(['a', 'b']);
});
- it('should inject array', function(){
+ it('should inject array', function() {
expect(annotate(['a'], {}).$inject).toEqual(['a']);
expect(annotate(['a', 'b'], {}).$inject).toEqual(['a', 'b']);
});
diff --git a/test/JsonSpec.js b/test/JsonSpec.js
index 2bd7241f..d3f6de0f 100644
--- a/test/JsonSpec.js
+++ b/test/JsonSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe('json', function(){
+describe('json', function() {
it('should serialize primitives', function() {
expect(toJson(0/0)).toEqual('null');
expect(toJson(null)).toEqual('null');
@@ -11,11 +11,11 @@ describe('json', function(){
expect(toJson("a \t \n \r b \\")).toEqual('"a \\t \\n \\r b \\\\"');
});
- it('should not serialize $$properties', function(){
+ it('should not serialize $$properties', function() {
expect(toJson({$$some:'value', 'this':1, '$parent':1}, false)).toEqual('{}');
});
- it('should not serialize this or $parent', function(){
+ it('should not serialize this or $parent', function() {
expect(toJson({'this':'value', $parent:'abc'}, false)).toEqual('{}');
});
@@ -46,8 +46,8 @@ describe('json', function(){
});
it('should ignore functions', function() {
- expect(toJson([function(){},1])).toEqual('[null,1]');
- expect(toJson({a:function(){}})).toEqual('{}');
+ expect(toJson([function() {},1])).toEqual('[null,1]');
+ expect(toJson({a:function() {}})).toEqual('{}');
});
it('should parse null', function() {
@@ -127,7 +127,7 @@ describe('json', function(){
expect(fromJson("{exp:1.2e-10}")).toEqual({exp:1.2E-10});
});
- it('should ignore non-strings', function(){
+ it('should ignore non-strings', function() {
expect(fromJson([])).toEqual([]);
expect(fromJson({})).toEqual({});
expect(fromJson(null)).toEqual(null);
@@ -170,51 +170,51 @@ describe('json', function(){
}
- describe('security', function(){
- it('should not allow naked expressions', function(){
- expect(function(){fromJson('1+2');}).
+ describe('security', function() {
+ it('should not allow naked expressions', function() {
+ expect(function() {fromJson('1+2');}).
toThrow(new Error("Syntax Error: Token '+' is an unexpected token at column 2 of the expression [1+2] starting at [+2]."));
});
- it('should not allow naked expressions group', function(){
- expect(function(){fromJson('(1+2)');}).
+ it('should not allow naked expressions group', function() {
+ expect(function() {fromJson('(1+2)');}).
toThrow(new Error("Syntax Error: Token '(' is not valid json at column 1 of the expression [(1+2)] starting at [(1+2)]."));
});
- it('should not allow expressions in objects', function(){
- expect(function(){fromJson('{a:abc()}');}).
+ it('should not allow expressions in objects', function() {
+ expect(function() {fromJson('{a:abc()}');}).
toThrow(new Error("Syntax Error: Token 'abc' is not valid json at column 4 of the expression [{a:abc()}] starting at [abc()}]."));
});
- it('should not allow expressions in arrays', function(){
- expect(function(){fromJson('[1+2]');}).
+ it('should not allow expressions in arrays', function() {
+ expect(function() {fromJson('[1+2]');}).
toThrow(new Error("Syntax Error: Token '+' is not valid json at column 3 of the expression [[1+2]] starting at [+2]]."));
});
- it('should not allow vars', function(){
- expect(function(){fromJson('[1, x]');}).
+ it('should not allow vars', function() {
+ expect(function() {fromJson('[1, x]');}).
toThrow(new Error("Syntax Error: Token 'x' is not valid json at column 5 of the expression [[1, x]] starting at [x]]."));
});
- it('should not allow dereference', function(){
- expect(function(){fromJson('["".constructor]');}).
+ it('should not allow dereference', function() {
+ expect(function() {fromJson('["".constructor]');}).
toThrow(new Error("Syntax Error: Token '.' is not valid json at column 4 of the expression [[\"\".constructor]] starting at [.constructor]]."));
});
- it('should not allow expressions ofter valid json', function(){
- expect(function(){fromJson('[].constructor');}).
+ it('should not allow expressions ofter valid json', function() {
+ expect(function() {fromJson('[].constructor');}).
toThrow(new Error("Syntax Error: Token '.' is not valid json at column 3 of the expression [[].constructor] starting at [.constructor]."));
});
- it('should not allow object dereference', function(){
- expect(function(){fromJson('{a:1, b: $location, c:1}');}).toThrow();
- expect(function(){fromJson("{a:1, b:[1]['__parent__']['location'], c:1}");}).toThrow();
+ it('should not allow object dereference', function() {
+ expect(function() {fromJson('{a:1, b: $location, c:1}');}).toThrow();
+ expect(function() {fromJson("{a:1, b:[1]['__parent__']['location'], c:1}");}).toThrow();
});
- it('should not allow assignments', function(){
- expect(function(){fromJson("{a:1, b:[1]=1, c:1}");}).toThrow();
- expect(function(){fromJson("{a:1, b:=1, c:1}");}).toThrow();
- expect(function(){fromJson("{a:1, b:x=1, c:1}");}).toThrow();
+ it('should not allow assignments', function() {
+ expect(function() {fromJson("{a:1, b:[1]=1, c:1}");}).toThrow();
+ expect(function() {fromJson("{a:1, b:=1, c:1}");}).toThrow();
+ expect(function() {fromJson("{a:1, b:x=1, c:1}");}).toThrow();
});
});
diff --git a/test/ParserSpec.js b/test/ParserSpec.js
index 980a673c..975cacc4 100644
--- a/test/ParserSpec.js
+++ b/test/ParserSpec.js
@@ -191,7 +191,7 @@ describe('parser', function() {
expect(scope.$eval("'a' + 'b c'")).toEqual("ab c");
});
- it('should parse filters', function(){
+ it('should parse filters', function() {
angular.filter.substring = function(input, start, end) {
return input.substring(start, end);
};
@@ -416,8 +416,8 @@ describe('parser', function() {
});
- describe('assignable', function(){
- it('should expose assignment function', function(){
+ describe('assignable', function() {
+ it('should expose assignment function', function() {
var fn = parser('a').assignable();
expect(fn.assign).toBeTruthy();
var scope = {};
diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js
index b6c116f7..15bbbdae 100644
--- a/test/ResourceSpec.js
+++ b/test/ResourceSpec.js
@@ -16,7 +16,7 @@ describe("resource", function() {
callback = jasmine.createSpy();
});
- it("should build resource", function(){
+ it("should build resource", function() {
expect(typeof CreditCard).toBe('function');
expect(typeof CreditCard.get).toBe('function');
expect(typeof CreditCard.save).toBe('function');
@@ -25,12 +25,12 @@ describe("resource", function() {
expect(typeof CreditCard.query).toBe('function');
});
- it('should default to empty parameters', function(){
+ it('should default to empty parameters', function() {
xhr.expectGET('URL').respond({});
resource.route('URL').query();
});
- it('should ignore slashes of undefinend parameters', function(){
+ it('should ignore slashes of undefinend parameters', function() {
var R = resource.route('/Path/:a/:b/:c');
xhr.expectGET('/Path').respond({});
xhr.expectGET('/Path/1').respond({});
@@ -42,7 +42,7 @@ describe("resource", function() {
R.get({a:4, b:5, c:6});
});
- it('should correctly encode url params', function(){
+ it('should correctly encode url params', function() {
var R = resource.route('/Path/:a');
xhr.expectGET('/Path/foo%231').respond({});
xhr.expectGET('/Path/doh!@foo?bar=baz%231').respond({});
@@ -67,7 +67,7 @@ describe("resource", function() {
R.get({a: 'doh&foo', bar: 'baz&1'});
});
- it("should build resource with default param", function(){
+ it("should build resource with default param", function() {
xhr.expectGET('/Order/123/Line/456.visa?minimum=0.05').respond({id:'abc'});
var LineItem = resource.route('/Order/:orderId/Line/:id:verb', {orderId: '123', id: '@id.key', verb:'.visa', minimum:0.05});
var item = LineItem.get({id:456});
@@ -75,7 +75,7 @@ describe("resource", function() {
nakedExpect(item).toEqual({id:'abc'});
});
- it("should build resource with action default param overriding default param", function(){
+ it("should build resource with action default param overriding default param", function() {
xhr.expectGET('/Customer/123').respond({id:'abc'});
var TypeItem = resource.route('/:type/:typeId', {type: 'Order'},
{get: {method: 'GET', params: {type: 'Customer'}}});
@@ -84,7 +84,7 @@ describe("resource", function() {
nakedExpect(item).toEqual({id:'abc'});
});
- it("should create resource", function(){
+ it("should create resource", function() {
xhr.expectPOST('/CreditCard', {name:'misko'}).respond({id:123, name:'misko'});
var cc = CreditCard.save({name:'misko'}, callback);
@@ -95,7 +95,7 @@ describe("resource", function() {
expect(callback).toHaveBeenCalledWith(cc);
});
- it("should read resource", function(){
+ it("should read resource", function() {
xhr.expectGET("/CreditCard/123").respond({id:123, number:'9876'});
var cc = CreditCard.get({id:123}, callback);
expect(cc instanceof CreditCard).toBeTruthy();
@@ -106,7 +106,7 @@ describe("resource", function() {
expect(callback).toHaveBeenCalledWith(cc);
});
- it("should read partial resource", function(){
+ it("should read partial resource", function() {
xhr.expectGET("/CreditCard").respond([{id:{key:123}}]);
xhr.expectGET("/CreditCard/123").respond({id:{key:123}, number:'9876'});
var ccs = CreditCard.query();
@@ -121,7 +121,7 @@ describe("resource", function() {
expect(cc.number).toEqual('9876');
});
- it("should update resource", function(){
+ it("should update resource", function() {
xhr.expectPOST('/CreditCard/123', {id:{key:123}, name:'misko'}).respond({id:{key:123}, name:'rama'});
var cc = CreditCard.save({id:{key:123}, name:'misko'}, callback);
@@ -130,7 +130,7 @@ describe("resource", function() {
xhr.flush();
});
- it("should query resource", function(){
+ it("should query resource", function() {
xhr.expectGET("/CreditCard?key=value").respond([{id:1}, {id:2}]);
var ccs = CreditCard.query({key:'value'}, callback);
@@ -141,16 +141,16 @@ describe("resource", function() {
expect(callback).toHaveBeenCalledWith(ccs);
});
- it("should have all arguments optional", function(){
+ it("should have all arguments optional", function() {
xhr.expectGET('/CreditCard').respond([{id:1}]);
var log = '';
- var ccs = CreditCard.query(function(){ log += 'cb;'; });
+ var ccs = CreditCard.query(function() { log += 'cb;'; });
xhr.flush();
nakedExpect(ccs).toEqual([{id:1}]);
expect(log).toEqual('cb;');
});
- it('should delete resource and call callback', function(){
+ it('should delete resource and call callback', function() {
xhr.expectDELETE("/CreditCard/123").respond(200, {});
CreditCard.remove({id:123}, callback);
@@ -166,20 +166,20 @@ describe("resource", function() {
nakedExpect(callback.mostRecentCall.args).toEqual([{}]);
});
- it('should post charge verb', function(){
+ it('should post charge verb', function() {
xhr.expectPOST('/CreditCard/123!charge?amount=10', {auth:'abc'}).respond({success:'ok'});
CreditCard.charge({id:123, amount:10},{auth:'abc'}, callback);
});
- it('should post charge verb on instance', function(){
+ it('should post charge verb on instance', function() {
xhr.expectPOST('/CreditCard/123!charge?amount=10', {id:{key:123}, name:'misko'}).respond({success:'ok'});
var card = new CreditCard({id:{key:123}, name:'misko'});
card.$charge({amount:10}, callback);
});
- it('should create on save', function(){
+ it('should create on save', function() {
xhr.expectPOST('/CreditCard', {name:'misko'}).respond({id:123});
var cc = new CreditCard();
expect(cc.$get).toBeDefined();
@@ -195,7 +195,7 @@ describe("resource", function() {
expect(callback).toHaveBeenCalledWith(cc);
});
- it('should not mutate the resource object if response contains no body', function(){
+ it('should not mutate the resource object if response contains no body', function() {
var data = {id:{key:123}, number:'9876'};
xhr.expectGET("/CreditCard/123").respond(data);
var cc = CreditCard.get({id:123});
@@ -209,7 +209,7 @@ describe("resource", function() {
expect(idBefore).toEqual(cc.id);
});
- it('should bind default parameters', function(){
+ it('should bind default parameters', function() {
xhr.expectGET('/CreditCard/123.visa?minimum=0.05').respond({id:123});
var Visa = CreditCard.bind({verb:'.visa', minimum:0.05});
var visa = Visa.get({id:123});
@@ -217,7 +217,7 @@ describe("resource", function() {
nakedExpect(visa).toEqual({id:123});
});
- it('should excersize full stack', function(){
+ it('should excersize full stack', function() {
var scope = angular.compile('
')();
var $browser = scope.$service('$browser');
var $resource = scope.$service('$resource');
@@ -229,7 +229,7 @@ describe("resource", function() {
dealoc(scope);
});
- it('should return the same object when verifying the cache', function(){
+ it('should return the same object when verifying the cache', function() {
var scope = angular.compile('
')();
var $browser = scope.$service('$browser');
var $resource = scope.$service('$resource');
diff --git a/test/ScenarioSpec.js b/test/ScenarioSpec.js
index 52cfd454..5f83ab93 100644
--- a/test/ScenarioSpec.js
+++ b/test/ScenarioSpec.js
@@ -1,18 +1,18 @@
'use strict';
-describe("ScenarioSpec: Compilation", function(){
+describe("ScenarioSpec: Compilation", function() {
var scope;
- beforeEach(function(){
+ beforeEach(function() {
scope = null;
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- describe('compilation', function(){
- it("should compile dom node and return scope", function(){
+ describe('compilation', function() {
+ it("should compile dom node and return scope", function() {
var node = jqLite('{{b=a+1}}
')[0];
scope = angular.compile(node)();
scope.$digest();
@@ -20,13 +20,13 @@ describe("ScenarioSpec: Compilation", function(){
expect(scope.b).toEqual(2);
});
- it("should compile jQuery node and return scope", function(){
+ it("should compile jQuery node and return scope", function() {
scope = compile(jqLite('{{a=123}}
'))();
scope.$digest();
expect(jqLite(scope.$element).text()).toEqual('123');
});
- it("should compile text node and return scope", function(){
+ it("should compile text node and return scope", function() {
scope = angular.compile('{{a=123}}
')();
scope.$digest();
expect(jqLite(scope.$element).text()).toEqual('123');
diff --git a/test/ScopeSpec.js b/test/ScopeSpec.js
index fa41e5a9..b1942646 100644
--- a/test/ScopeSpec.js
+++ b/test/ScopeSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe('Scope', function(){
+describe('Scope', function() {
var root = null, mockHandler = null;
beforeEach(function() {
@@ -302,7 +302,7 @@ describe('Scope', function(){
});
- describe('$destroy', function(){
+ describe('$destroy', function() {
var first = null, middle = null, last = null, log = null;
beforeEach(function() {
@@ -471,7 +471,7 @@ describe('Scope', function(){
root = angular.scope(),
child = root.$new();
- function eventFn(){
+ function eventFn() {
log += 'X';
}
@@ -492,7 +492,7 @@ describe('Scope', function(){
child = root.$new(),
listenerRemove;
- function eventFn(){
+ function eventFn() {
log += 'X';
}
diff --git a/test/angular-mocksSpec.js b/test/angular-mocksSpec.js
index bf5c7816..c2cffca6 100644
--- a/test/angular-mocksSpec.js
+++ b/test/angular-mocksSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe('mocks', function(){
+describe('mocks', function() {
describe('TzDate', function() {
function minutes(min) {
@@ -172,26 +172,26 @@ describe('mocks', function(){
});
});
- describe('defer', function(){
+ describe('defer', function() {
var browser, log;
- beforeEach(function(){
+ beforeEach(function() {
browser = new MockBrowser();
log = '';
});
- function logFn(text){ return function(){
+ function logFn(text){ return function() {
log += text +';';
};
}
- it('should flush', function(){
+ it('should flush', function() {
browser.defer(logFn('A'));
expect(log).toEqual('');
browser.defer.flush();
expect(log).toEqual('A;');
});
- it('should flush delayed', function(){
+ it('should flush delayed', function() {
browser.defer(logFn('A'));
browser.defer(logFn('B'), 10);
browser.defer(logFn('C'), 20);
@@ -205,7 +205,7 @@ describe('mocks', function(){
expect(log).toEqual('A;B;C;');
});
- it('should defer and flush over time', function(){
+ it('should defer and flush over time', function() {
browser.defer(logFn('A'), 1);
browser.defer(logFn('B'), 2);
browser.defer(logFn('C'), 3);
diff --git a/test/directivesSpec.js b/test/directivesSpec.js
index 1cbb92b0..8c07cf70 100644
--- a/test/directivesSpec.js
+++ b/test/directivesSpec.js
@@ -63,8 +63,8 @@ describe("directive", function() {
expect(lowercase(element.html())).toEqual('hello ');
});
- it('should have $element set to current bind element', function(){
- angularFilter.myFilter = function(){
+ it('should have $element set to current bind element', function() {
+ angularFilter.myFilter = function() {
this.$element.addClass("filter");
return 'HELLO';
};
@@ -80,7 +80,7 @@ describe("directive", function() {
expect(scope.$element.text()).toEqual('-0false');
});
- it('should render object as JSON ignore $$', function(){
+ it('should render object as JSON ignore $$', function() {
var scope = compile('{{ {key:"value", $$key:"hide"} }}
');
scope.$digest();
expect(fromJson(scope.$element.text())).toEqual({key:'value'});
@@ -108,7 +108,7 @@ describe("directive", function() {
expect(innerText).toEqual('INNER');
});
- it('should render object as JSON ignore $$', function(){
+ it('should render object as JSON ignore $$', function() {
var scope = compile(' {{ {key:"value", $$key:"hide"} }} ');
scope.$digest();
expect(fromJson(scope.$element.text())).toEqual({key:'value'});
@@ -148,7 +148,7 @@ describe("directive", function() {
expect(input.checked).toEqual(true);
});
- describe('ng:click', function(){
+ describe('ng:click', function() {
it('should get called on a click', function() {
var scope = compile('
');
scope.$digest();
@@ -208,7 +208,7 @@ describe("directive", function() {
});
- it('should support adding multiple classes via an array', function(){
+ it('should support adding multiple classes via an array', function() {
var scope = compile('
');
scope.$digest();
expect(element.hasClass('existing')).toBeTruthy();
@@ -217,7 +217,7 @@ describe("directive", function() {
});
- it('should support adding multiple classes via a space delimited string', function(){
+ it('should support adding multiple classes via a space delimited string', function() {
var scope = compile('
');
scope.$digest();
expect(element.hasClass('existing')).toBeTruthy();
@@ -420,7 +420,7 @@ describe("directive", function() {
});
describe('ng:hide', function() {
- it('should hide an element', function(){
+ it('should hide an element', function() {
var element = jqLite('
'),
scope = compile(element);
@@ -480,7 +480,7 @@ describe("directive", function() {
expect(scope.$element.text()).toEqual('hey dude!');
});
- it('should infer injection arguments', function(){
+ it('should infer injection arguments', function() {
temp.MyController = function($xhr){
this.$root.someService = $xhr;
};
diff --git a/test/jQueryPatchSpec.js b/test/jQueryPatchSpec.js
index 0953bdac..19f4d821 100644
--- a/test/jQueryPatchSpec.js
+++ b/test/jQueryPatchSpec.js
@@ -2,14 +2,14 @@
if (window.jQuery) {
- describe('jQuery patch', function(){
+ describe('jQuery patch', function() {
var doc = null;
var divSpy = null;
var spy1 = null;
var spy2 = null;
- beforeEach(function(){
+ beforeEach(function() {
divSpy = jasmine.createSpy('div.$destroy');
spy1 = jasmine.createSpy('span1.$destroy');
spy2 = jasmine.createSpy('span2.$destroy');
@@ -18,7 +18,7 @@ if (window.jQuery) {
doc.find('span.second').bind('$destroy', spy2);
});
- afterEach(function(){
+ afterEach(function() {
expect(divSpy).not.toHaveBeenCalled();
expect(spy1).toHaveBeenCalled();
@@ -27,29 +27,29 @@ if (window.jQuery) {
expect(spy2.callCount).toEqual(1);
});
- describe('$detach event', function(){
+ describe('$detach event', function() {
- it('should fire on detach()', function(){
+ it('should fire on detach()', function() {
doc.find('span').detach();
});
- it('should fire on remove()', function(){
+ it('should fire on remove()', function() {
doc.find('span').remove();
});
- it('should fire on replaceWith()', function(){
+ it('should fire on replaceWith()', function() {
doc.find('span').replaceWith('
bla ');
});
- it('should fire on replaceAll()', function(){
+ it('should fire on replaceAll()', function() {
$('
bla ').replaceAll(doc.find('span'));
});
- it('should fire on empty()', function(){
+ it('should fire on empty()', function() {
doc.empty();
});
- it('should fire on html()', function(){
+ it('should fire on html()', function() {
doc.html('abc');
});
});
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js
index 28cc7b90..96712210 100644
--- a/test/jqLiteSpec.js
+++ b/test/jqLiteSpec.js
@@ -1,16 +1,16 @@
'use strict';
-describe('jqLite', function(){
+describe('jqLite', function() {
var scope, a, b, c;
- beforeEach(function(){
+ beforeEach(function() {
a = jqLite('
A
')[0];
b = jqLite('
B
')[0];
c = jqLite('
C
')[0];
});
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope();
this.addMatchers({
toJqEqual: function(expected) {
@@ -32,7 +32,7 @@ describe('jqLite', function(){
});
- afterEach(function(){
+ afterEach(function() {
dealoc(a);
dealoc(b);
dealoc(c);
@@ -44,8 +44,8 @@ describe('jqLite', function(){
});
- describe('construction', function(){
- it('should allow construction with text node', function(){
+ describe('construction', function() {
+ it('should allow construction with text node', function() {
var text = a.firstChild;
var selected = jqLite(text);
expect(selected.length).toEqual(1);
@@ -53,7 +53,7 @@ describe('jqLite', function(){
});
- it('should allow construction with html', function(){
+ it('should allow construction with html', function() {
var nodes = jqLite('
1
2 ');
expect(nodes.length).toEqual(2);
expect(nodes[0].innerHTML).toEqual('1');
@@ -138,8 +138,8 @@ describe('jqLite', function(){
});
- describe('data', function(){
- it('should set and get and remove data', function(){
+ describe('data', function() {
+ it('should set and get and remove data', function() {
var selected = jqLite([a, b, c]);
expect(selected.data('prop', 'value')).toEqual(selected);
@@ -160,18 +160,18 @@ describe('jqLite', function(){
expect(jqLite(c).data('prop')).toEqual(undefined);
});
- it('should call $destroy function if element removed', function(){
+ it('should call $destroy function if element removed', function() {
var log = '';
var element = jqLite(a);
- element.bind('$destroy', function(){log+= 'destroy;';});
+ element.bind('$destroy', function() {log+= 'destroy;';});
element.remove();
expect(log).toEqual('destroy;');
});
});
- describe('attr', function(){
- it('shoul read write and remove attr', function(){
+ describe('attr', function() {
+ it('shoul read write and remove attr', function() {
var selector = jqLite([a, b]);
expect(selector.attr('prop', 'value')).toEqual(selector);
@@ -191,7 +191,7 @@ describe('jqLite', function(){
expect(jqLite(b).attr('prop')).toBeFalsy();
});
- it('should read special attributes as strings', function(){
+ it('should read special attributes as strings', function() {
var select = jqLite('
');
expect(select.attr('multiple')).toBeUndefined();
expect(jqLite('').attr('multiple')).toBe('multiple');
@@ -244,16 +244,16 @@ describe('jqLite', function(){
});
- describe('class', function(){
+ describe('class', function() {
- describe('hasClass', function(){
- it('should check class', function(){
+ describe('hasClass', function() {
+ it('should check class', function() {
var selector = jqLite([a, b]);
expect(selector.hasClass('abc')).toEqual(false);
});
- it('should make sure that partial class is not checked as a subset', function(){
+ it('should make sure that partial class is not checked as a subset', function() {
var selector = jqLite([a, b]);
selector.addClass('a');
selector.addClass('b');
@@ -316,8 +316,8 @@ describe('jqLite', function(){
});
- describe('toggleClass', function(){
- it('should allow toggling of class', function(){
+ describe('toggleClass', function() {
+ it('should allow toggling of class', function() {
var selector = jqLite([a, b]);
expect(selector.toggleClass('abc')).toEqual(selector);
expect(jqLite(a).hasClass('abc')).toEqual(true);
@@ -339,8 +339,8 @@ describe('jqLite', function(){
});
- describe('removeClass', function(){
- it('should allow removal of class', function(){
+ describe('removeClass', function() {
+ it('should allow removal of class', function() {
var selector = jqLite([a, b]);
expect(selector.addClass('abc')).toEqual(selector);
expect(selector.removeClass('abc')).toEqual(selector);
@@ -372,8 +372,8 @@ describe('jqLite', function(){
});
- describe('css', function(){
- it('should set and read css', function(){
+ describe('css', function() {
+ it('should set and read css', function() {
var selector = jqLite([a, b]);
expect(selector.css('margin', '1px')).toEqual(selector);
@@ -439,14 +439,14 @@ describe('jqLite', function(){
});
- describe('text', function(){
- it('should return null on empty', function(){
+ describe('text', function() {
+ it('should return null on empty', function() {
expect(jqLite().length).toEqual(0);
expect(jqLite().text()).toEqual('');
});
- it('should read/write value', function(){
+ it('should read/write value', function() {
var element = jqLite('abc
');
expect(element.length).toEqual(1);
expect(element[0].innerHTML).toEqual('abc');
@@ -457,8 +457,8 @@ describe('jqLite', function(){
});
- describe('val', function(){
- it('should read, write value', function(){
+ describe('val', function() {
+ it('should read, write value', function() {
var input = jqLite(' ');
expect(input.val('abc')).toEqual(input);
expect(input[0].value).toEqual('abc');
@@ -467,14 +467,14 @@ describe('jqLite', function(){
});
- describe('html', function(){
- it('should return null on empty', function(){
+ describe('html', function() {
+ it('should return null on empty', function() {
expect(jqLite().length).toEqual(0);
expect(jqLite().html()).toEqual(null);
});
- it('should read/write value', function(){
+ it('should read/write value', function() {
var element = jqLite('abc
');
expect(element.length).toEqual(1);
expect(element[0].innerHTML).toEqual('abc');
@@ -485,8 +485,8 @@ describe('jqLite', function(){
});
- describe('bind', function(){
- it('should bind to window on hashchange', function(){
+ describe('bind', function() {
+ it('should bind to window on hashchange', function() {
if (jqLite.fn) return; // don't run in jQuery
var eventFn;
var window = {
@@ -507,7 +507,7 @@ describe('jqLite', function(){
detachEvent: noop
};
var log;
- var jWindow = jqLite(window).bind('hashchange', function(){
+ var jWindow = jqLite(window).bind('hashchange', function() {
log = 'works!';
});
eventFn({});
@@ -516,10 +516,10 @@ describe('jqLite', function(){
});
- it('should bind to all elements and return functions', function(){
+ it('should bind to all elements and return functions', function() {
var selected = jqLite([a, b]);
var log = '';
- expect(selected.bind('click', function(){
+ expect(selected.bind('click', function() {
log += 'click on: ' + jqLite(this).text() + ';';
})).toEqual(selected);
browserTrigger(a, 'click');
@@ -664,8 +664,8 @@ describe('jqLite', function(){
});
- describe('replaceWith', function(){
- it('should replaceWith', function(){
+ describe('replaceWith', function() {
+ it('should replaceWith', function() {
var root = jqLite('').html('before-
after');
var div = root.find('div');
expect(div.replaceWith('
span- bold- ')).toEqual(div);
@@ -673,7 +673,7 @@ describe('jqLite', function(){
});
- it('should replaceWith text', function(){
+ it('should replaceWith text', function() {
var root = jqLite('
').html('before-
after');
var div = root.find('div');
expect(div.replaceWith('text-')).toEqual(div);
@@ -682,8 +682,8 @@ describe('jqLite', function(){
});
- describe('children', function(){
- it('should select non-text children', function(){
+ describe('children', function() {
+ it('should select non-text children', function() {
var root = jqLite('
').html('before-
after-
');
var div = root.find('div');
var span = root.find('span');
@@ -692,13 +692,13 @@ describe('jqLite', function(){
});
- describe('append', function(){
- it('should append', function(){
+ describe('append', function() {
+ it('should append', function() {
var root = jqLite('
');
expect(root.append('
abc ')).toEqual(root);
expect(root.html().toLowerCase()).toEqual('
abc ');
});
- it('should append text', function(){
+ it('should append text', function() {
var root = jqLite('
');
expect(root.append('text')).toEqual(root);
expect(root.html()).toEqual('text');
@@ -710,18 +710,18 @@ describe('jqLite', function(){
});
});
- describe('prepend', function(){
- it('should prepend to empty', function(){
+ describe('prepend', function() {
+ it('should prepend to empty', function() {
var root = jqLite('
');
expect(root.prepend('
abc ')).toEqual(root);
expect(root.html().toLowerCase()).toEqual('
abc ');
});
- it('should prepend to content', function(){
+ it('should prepend to content', function() {
var root = jqLite('
text
');
expect(root.prepend('
abc ')).toEqual(root);
expect(root.html().toLowerCase()).toEqual('
abc text');
});
- it('should prepend text to content', function(){
+ it('should prepend text to content', function() {
var root = jqLite('
text
');
expect(root.prepend('abc')).toEqual(root);
expect(root.html().toLowerCase()).toEqual('abctext');
@@ -729,8 +729,8 @@ describe('jqLite', function(){
});
- describe('remove', function(){
- it('should remove', function(){
+ describe('remove', function() {
+ it('should remove', function() {
var root = jqLite('
abc
');
var span = root.find('span');
expect(span.remove()).toEqual(span);
@@ -739,8 +739,8 @@ describe('jqLite', function(){
});
- describe('after', function(){
- it('should after', function(){
+ describe('after', function() {
+ it('should after', function() {
var root = jqLite('
');
var span = root.find('span');
expect(span.after('
')).toEqual(span);
@@ -748,7 +748,7 @@ describe('jqLite', function(){
});
- it('should allow taking text', function(){
+ it('should allow taking text', function() {
var root = jqLite('
');
var span = root.find('span');
span.after('abc');
@@ -757,8 +757,8 @@ describe('jqLite', function(){
});
- describe('parent', function(){
- it('should return parent or an empty set when no parent', function(){
+ describe('parent', function() {
+ it('should return parent or an empty set when no parent', function() {
var parent = jqLite('
'),
child = parent.find('p');
@@ -790,7 +790,7 @@ describe('jqLite', function(){
describe('next', function() {
- it('should return next sibling', function(){
+ it('should return next sibling', function() {
var element = jqLite('
b i
');
var b = element.find('b');
var i = element.find('i');
@@ -800,7 +800,7 @@ describe('jqLite', function(){
describe('find', function() {
- it('should find child by name', function(){
+ it('should find child by name', function() {
var root = jqLite('
');
var innerDiv = root.find('div');
expect(innerDiv.length).toEqual(1);
diff --git a/test/jstd-scenario-adapter/AdapterSpecs.js b/test/jstd-scenario-adapter/AdapterSpecs.js
index f0d54d3c..e360ad4f 100644
--- a/test/jstd-scenario-adapter/AdapterSpecs.js
+++ b/test/jstd-scenario-adapter/AdapterSpecs.js
@@ -42,7 +42,7 @@ describe('jstd-adapter', function() {
*/
function buildTestConf(type) {
return new jstestdriver.TestRunConfiguration(
- new jstestdriver.TestCaseInfo('Fake test - ' + Math.random(), function(){}, type), null);
+ new jstestdriver.TestCaseInfo('Fake test - ' + Math.random(), function() {}, type), null);
}
/**
diff --git a/test/manual.html b/test/manual.html
index ef2fff3a..8aa64128 100644
--- a/test/manual.html
+++ b/test/manual.html
@@ -52,7 +52,7 @@
c.').toEqual('ac.');
});
- it('should remove double nested script', function(){
+ it('should remove double nested script', function() {
expectHTML('ailc.').toEqual('ac.');
});
- it('should remove unknown names', function(){
+ it('should remove unknown names', function() {
expectHTML('a
b c').toEqual('a
b c');
});
- it('should remove unsafe value', function(){
+ it('should remove unsafe value', function() {
expectHTML('
').toEqual(' ');
});
- it('should handle self closed elements', function(){
+ it('should handle self closed elements', function() {
expectHTML('a
c').toEqual('a
c');
});
- it('should handle namespace', function(){
+ it('should handle namespace', function() {
expectHTML('a
b c').toEqual('abc');
});
- it('should handle entities', function(){
+ it('should handle entities', function() {
var everything = '
' +
'!@#$%^&*()_+-={}[]:";\'<>?,./`~ ħ
';
expectHTML(everything).toEqual(everything);
});
- it('should handle improper html', function(){
+ it('should handle improper html', function() {
expectHTML('< div rel="
" alt=abc dir=\'"\' >text< /div>').
toEqual('
text
');
});
- it('should handle improper html2', function(){
+ it('should handle improper html2', function() {
expectHTML('< div rel="
" / >').
toEqual('
');
});
- it('should ignore back slash as escape', function(){
+ it('should ignore back slash as escape', function() {
expectHTML('
').
toEqual('
');
});
- it('should ignore object attributes', function(){
+ it('should ignore object attributes', function() {
expectHTML('
:) ').
toEqual('
:) ');
expectHTML('
:) ').
toEqual('');
});
- describe('htmlSanitizerWriter', function(){
+ describe('htmlSanitizerWriter', function() {
var writer, html;
- beforeEach(function(){
+ beforeEach(function() {
html = '';
writer = htmlSanitizeWriter({push:function(text){html+=text;}});
});
- it('should write basic HTML', function(){
+ it('should write basic HTML', function() {
writer.chars('before');
writer.start('div', {rel:'123'}, false);
writer.chars('in');
@@ -153,38 +153,38 @@ describe('HTML', function(){
expect(html).toEqual('before
in
after');
});
- it('should escape text nodes', function(){
+ it('should escape text nodes', function() {
writer.chars('a
&
c');
expect(html).toEqual('a<div>&</div>c');
});
- it('should escape IE script', function(){
+ it('should escape IE script', function() {
writer.chars('&<>{}');
expect(html).toEqual('&<>{}');
});
- it('should escape attributes', function(){
+ it('should escape attributes', function() {
writer.start('div', {rel:'!@#$%^&*()_+-={}[]:";\'<>?,./`~ \n\0\r\u0127'});
expect(html).toEqual('
');
});
- it('should ignore missformed elements', function(){
+ it('should ignore missformed elements', function() {
writer.start('d>i&v', {});
expect(html).toEqual('');
});
- it('should ignore unknown attributes', function(){
+ it('should ignore unknown attributes', function() {
writer.start('div', {unknown:""});
expect(html).toEqual('
');
});
- describe('explicitly dissallow', function(){
- it('should not allow attributes', function(){
+ describe('explicitly dissallow', function() {
+ it('should not allow attributes', function() {
writer.start('div', {id:'a', name:'a', style:'a'});
expect(html).toEqual('
');
});
- it('should not allow tags', function(){
+ it('should not allow tags', function() {
function tag(name) {
writer.start(name, {});
writer.end(name);
@@ -209,13 +209,13 @@ describe('HTML', function(){
});
});
- describe('isUri', function(){
+ describe('isUri', function() {
function isUri(value) {
return value.match(URI_REGEXP);
}
- it('should be URI', function(){
+ it('should be URI', function() {
expect(isUri('http://abc')).toBeTruthy();
expect(isUri('https://abc')).toBeTruthy();
expect(isUri('ftp://abc')).toBeTruthy();
@@ -223,46 +223,46 @@ describe('HTML', function(){
expect(isUri('#anchor')).toBeTruthy();
});
- it('should not be UIR', function(){
+ it('should not be UIR', function() {
expect(isUri('')).toBeFalsy();
expect(isUri('javascript:alert')).toBeFalsy();
});
});
- describe('javascript URL attribute', function(){
- beforeEach(function(){
+ describe('javascript URL attribute', function() {
+ beforeEach(function() {
this.addMatchers({
- toBeValidUrl: function(){
+ toBeValidUrl: function() {
return URI_REGEXP.exec(this.actual);
}
});
});
- it('should ignore javascript:', function(){
+ it('should ignore javascript:', function() {
expect('JavaScript:abc').not.toBeValidUrl();
expect(' \n Java\n Script:abc').not.toBeValidUrl();
expect('http://JavaScript/my.js').toBeValidUrl();
});
- it('should ignore dec encoded javascript:', function(){
+ it('should ignore dec encoded javascript:', function() {
expect('javascript:').not.toBeValidUrl();
expect('javascript:').not.toBeValidUrl();
expect('j avascript:').not.toBeValidUrl();
});
- it('should ignore decimal with leading 0 encodede javascript:', function(){
+ it('should ignore decimal with leading 0 encodede javascript:', function() {
expect('javascript:').not.toBeValidUrl();
expect('j avascript:').not.toBeValidUrl();
expect('j avascript:').not.toBeValidUrl();
});
- it('should ignore hex encoded javascript:', function(){
+ it('should ignore hex encoded javascript:', function() {
expect('javascript:').not.toBeValidUrl();
expect('javascript:').not.toBeValidUrl();
expect('j avascript:').not.toBeValidUrl();
});
- it('should ignore hex encoded whitespace javascript:', function(){
+ it('should ignore hex encoded whitespace javascript:', function() {
expect('jav ascript:alert("A");').not.toBeValidUrl();
expect('jav
ascript:alert("B");').not.toBeValidUrl();
expect('jav
ascript:alert("C");').not.toBeValidUrl();
diff --git a/test/scenario/DescribeSpec.js b/test/scenario/DescribeSpec.js
index 173b0807..6741ed6d 100644
--- a/test/scenario/DescribeSpec.js
+++ b/test/scenario/DescribeSpec.js
@@ -26,11 +26,11 @@ describe('angular.scenario.Describe', function() {
});
it('should handle basic nested case', function() {
- root.describe('A', function(){
+ root.describe('A', function() {
this.beforeEach(log.fn('{'));
this.afterEach(log.fn('}'));
this.it('1', log.fn('1'));
- this.describe('B', function(){
+ this.describe('B', function() {
this.beforeEach(log.fn('('));
this.afterEach(log.fn(')'));
this.it('2', log.fn('2'));
diff --git a/test/scenario/dslSpec.js b/test/scenario/dslSpec.js
index 3fc69c14..a6e80901 100644
--- a/test/scenario/dslSpec.js
+++ b/test/scenario/dslSpec.js
@@ -212,7 +212,7 @@ describe("angular.scenario.dsl", function() {
expect(_jQuery('[ng\\:model="test"]').val()).toEqual('A');
});
- it('should select option by name', function(){
+ it('should select option by name', function() {
doc.append(
'
' +
' one ' +
diff --git a/test/scenario/e2e/widgets-scenario.js b/test/scenario/e2e/widgets-scenario.js
index ca0f8130..fda9b3c6 100644
--- a/test/scenario/e2e/widgets-scenario.js
+++ b/test/scenario/e2e/widgets-scenario.js
@@ -1,7 +1,7 @@
'use strict';
describe('widgets', function() {
- it('should verify that basic widgets work', function(){
+ it('should verify that basic widgets work', function() {
browser().navigateTo('widgets.html');
using('#text-basic-box').input('text.basic').enter('Carlos');
diff --git a/test/service/cookieStoreSpec.js b/test/service/cookieStoreSpec.js
index fa4f3ceb..0bf7e99d 100644
--- a/test/service/cookieStoreSpec.js
+++ b/test/service/cookieStoreSpec.js
@@ -9,7 +9,7 @@ describe('$cookieStore', function() {
$browser = scope.$service('$browser');
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
diff --git a/test/service/cookiesSpec.js b/test/service/cookiesSpec.js
index 782cee72..f078c20c 100644
--- a/test/service/cookiesSpec.js
+++ b/test/service/cookiesSpec.js
@@ -10,13 +10,13 @@ describe('$cookies', function() {
scope.$cookies = scope.$service('$cookies');
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
it('should provide access to existing cookies via object properties and keep them in sync',
- function(){
+ function() {
expect(scope.$cookies).toEqual({'preexisting': 'oldCookie'});
// access internal cookie storage of the browser mock directly to simulate behavior of
@@ -55,7 +55,7 @@ describe('$cookies', function() {
scope.$cookies.nonString = [1, 2, 3];
scope.$cookies.nullVal = null;
scope.$cookies.undefVal = undefined;
- scope.$cookies.preexisting = function(){};
+ scope.$cookies.preexisting = function() {};
scope.$digest();
expect($browser.cookies()).toEqual({'preexisting': 'oldCookie'});
expect(scope.$cookies).toEqual({'preexisting': 'oldCookie'});
diff --git a/test/service/deferSpec.js b/test/service/deferSpec.js
index 4f651522..ad1459ec 100644
--- a/test/service/deferSpec.js
+++ b/test/service/deferSpec.js
@@ -3,7 +3,7 @@
describe('$defer', function() {
var scope, $browser, $defer, $exceptionHandler;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope(angular.service,
{'$exceptionHandler': jasmine.createSpy('$exceptionHandler')});
$browser = scope.$service('$browser');
@@ -11,7 +11,7 @@ describe('$defer', function() {
$exceptionHandler = scope.$service('$exceptionHandler');
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
@@ -69,7 +69,7 @@ describe('$defer', function() {
expect(applySpy).toHaveBeenCalled();
});
- it('should allow you to specify the delay time', function(){
+ it('should allow you to specify the delay time', function() {
var defer = this.spyOn($browser, 'defer');
$defer(noop, 123);
expect(defer.callCount).toEqual(1);
diff --git a/test/service/documentSpec.js b/test/service/documentSpec.js
index 79c752e4..885331e4 100644
--- a/test/service/documentSpec.js
+++ b/test/service/documentSpec.js
@@ -3,17 +3,17 @@
describe('$document', function() {
var scope;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope();
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- it("should inject $document", function(){
+ it("should inject $document", function() {
expect(scope.$service('$document')).toEqual(jqLite(document));
});
});
diff --git a/test/service/exceptionHandlerSpec.js b/test/service/exceptionHandlerSpec.js
index 74f37cb9..61e652b5 100644
--- a/test/service/exceptionHandlerSpec.js
+++ b/test/service/exceptionHandlerSpec.js
@@ -3,17 +3,17 @@
describe('$exceptionHandler', function() {
var scope;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope();
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- it('should log errors', function(){
+ it('should log errors', function() {
var scope = createScope({$exceptionHandler: $exceptionHandlerFactory},
{$log: $logMock}),
$log = scope.$service('$log'),
diff --git a/test/service/formFactorySpec.js b/test/service/formFactorySpec.js
index 5223cede..23b8ae0a 100644
--- a/test/service/formFactorySpec.js
+++ b/test/service/formFactorySpec.js
@@ -1,23 +1,23 @@
'use strict';
-describe('$formFactory', function(){
+describe('$formFactory', function() {
var rootScope;
var formFactory;
- beforeEach(function(){
+ beforeEach(function() {
rootScope = angular.scope();
formFactory = rootScope.$service('$formFactory');
});
- it('should have global form', function(){
+ it('should have global form', function() {
expect(formFactory.rootForm).toBeTruthy();
expect(formFactory.rootForm.$createWidget).toBeTruthy();
});
- describe('new form', function(){
+ describe('new form', function() {
var form;
var scope;
var log;
@@ -25,7 +25,7 @@ describe('$formFactory', function(){
function WidgetCtrl($formFactory){
this.$formFactory = $formFactory;
log += '';
- this.$render = function(){
+ this.$render = function() {
log += '$render();';
};
this.$on('$validate', function(e){
@@ -41,13 +41,13 @@ describe('$formFactory', function(){
}
};
- beforeEach(function(){
+ beforeEach(function() {
log = '';
scope = rootScope.$new();
form = formFactory(scope);
});
- describe('$createWidget', function(){
+ describe('$createWidget', function() {
var widget;
beforeEach(function() {
@@ -55,19 +55,20 @@ describe('$formFactory', function(){
scope:scope,
model:'text',
alias:'text',
- controller:WidgetCtrl});
+ controller:WidgetCtrl
+ });
});
- describe('data flow', function(){
- it('should have status properties', function(){
+ describe('data flow', function() {
+ it('should have status properties', function() {
expect(widget.$error).toEqual({});
expect(widget.$valid).toBe(true);
expect(widget.$invalid).toBe(false);
});
- it('should update view when model changes', function(){
+ it('should update view when model changes', function() {
scope.text = 'abc';
scope.$digest();
expect(log).toEqual('$validate();$render();');
@@ -80,14 +81,14 @@ describe('$formFactory', function(){
});
- it('should have controller prototype methods', function(){
+ it('should have controller prototype methods', function() {
expect(widget.getFormFactory()).toEqual(formFactory);
});
});
- describe('validation', function(){
- it('should update state on error', function(){
+ describe('validation', function() {
+ it('should update state on error', function() {
widget.$emit('$invalid', 'E');
expect(widget.$valid).toEqual(false);
expect(widget.$invalid).toEqual(true);
@@ -98,9 +99,9 @@ describe('$formFactory', function(){
});
- it('should have called the model setter before the validation', function(){
+ it('should have called the model setter before the validation', function() {
var modelValue;
- widget.$on('$validate', function(){
+ widget.$on('$validate', function() {
modelValue = scope.text;
});
widget.$emit('$viewChange', 'abc');
@@ -108,8 +109,8 @@ describe('$formFactory', function(){
});
- describe('form', function(){
- it('should invalidate form when widget is invalid', function(){
+ describe('form', function() {
+ it('should invalidate form when widget is invalid', function() {
expect(form.$error).toEqual({});
expect(form.$valid).toEqual(true);
expect(form.$invalid).toEqual(false);
@@ -147,8 +148,8 @@ describe('$formFactory', function(){
});
- describe('id assignment', function(){
- it('should default to name expression', function(){
+ describe('id assignment', function() {
+ it('should default to name expression', function() {
expect(form.text).toEqual(widget);
});
@@ -201,7 +202,7 @@ describe('$formFactory', function(){
});
- it('should remove invalid fields from errors, when child widget removed', function(){
+ it('should remove invalid fields from errors, when child widget removed', function() {
widget.$emit('$invalid', 'MyError');
expect(form.$error.MyError).toEqual([widget]);
diff --git a/test/service/locationSpec.js b/test/service/locationSpec.js
index a312c1b2..70319af7 100644
--- a/test/service/locationSpec.js
+++ b/test/service/locationSpec.js
@@ -481,7 +481,7 @@ describe('$location', function() {
});
- it('should parse file://', function(){
+ it('should parse file://', function() {
var match = URL_MATCH.exec('file:///Users/Shared/misko/work/angular.js/scenario/widgets.html');
expect(match[1]).toBe('file');
@@ -492,7 +492,7 @@ describe('$location', function() {
});
- it('should parse url with "-" in host', function(){
+ it('should parse url with "-" in host', function() {
var match = URL_MATCH.exec('http://a-b1.c-d.09/path');
expect(match[1]).toBe('http');
diff --git a/test/service/logSpec.js b/test/service/logSpec.js
index 499447ad..c4efb8c5 100644
--- a/test/service/logSpec.js
+++ b/test/service/logSpec.js
@@ -3,22 +3,22 @@
describe('$log', function() {
var scope;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope();
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- it('should use console if present', function(){
+ it('should use console if present', function() {
var logger = "";
- function log(){ logger+= 'log;'; }
- function warn(){ logger+= 'warn;'; }
- function info(){ logger+= 'info;'; }
- function error(){ logger+= 'error;'; }
+ function log() { logger+= 'log;'; }
+ function warn() { logger+= 'warn;'; }
+ function info() { logger+= 'info;'; }
+ function error() { logger+= 'error;'; }
var scope = createScope({$log: $logFactory},
{$exceptionHandler: rethrow,
$window: {console: {log: log,
@@ -35,9 +35,9 @@ describe('$log', function() {
});
- it('should use console.log() if other not present', function(){
+ it('should use console.log() if other not present', function() {
var logger = "";
- function log(){ logger+= 'log;'; }
+ function log() { logger+= 'log;'; }
var scope = createScope({$log: $logFactory},
{$window: {console:{log:log}},
$exceptionHandler: rethrow});
@@ -50,7 +50,7 @@ describe('$log', function() {
});
- it('should use noop if no console', function(){
+ it('should use noop if no console', function() {
var scope = createScope({$log: $logFactory},
{$window: {},
$exceptionHandler: rethrow}),
@@ -62,36 +62,36 @@ describe('$log', function() {
});
- describe('$log.error', function(){
+ describe('$log.error', function() {
var e, $log, errorArgs;
- beforeEach(function(){
+ beforeEach(function() {
e = new Error('');
e.message = undefined;
e.sourceURL = undefined;
e.line = undefined;
e.stack = undefined;
- $log = $logFactory({console:{error:function(){
+ $log = $logFactory({console:{error:function() {
errorArgs = arguments;
}}});
});
- it('should pass error if does not have trace', function(){
+ it('should pass error if does not have trace', function() {
$log.error('abc', e);
expect(errorArgs).toEqual(['abc', e]);
});
- it('should print stack', function(){
+ it('should print stack', function() {
e.stack = 'stack';
$log.error('abc', e);
expect(errorArgs).toEqual(['abc', 'stack']);
});
- it('should print line', function(){
+ it('should print line', function() {
e.message = 'message';
e.sourceURL = 'sourceURL';
e.line = '123';
diff --git a/test/service/routeParamsSpec.js b/test/service/routeParamsSpec.js
index 8cdf3af3..972e4314 100644
--- a/test/service/routeParamsSpec.js
+++ b/test/service/routeParamsSpec.js
@@ -1,7 +1,7 @@
'use strict';
-describe('$routeParams', function(){
- it('should publish the params into a service', function(){
+describe('$routeParams', function() {
+ it('should publish the params into a service', function() {
var scope = angular.scope(),
$location = scope.$service('$location'),
$route = scope.$service('$route'),
@@ -20,7 +20,7 @@ describe('$routeParams', function(){
});
- it('should preserve object identity during route reloads', function(){
+ it('should preserve object identity during route reloads', function() {
var scope = angular.scope(),
$location = scope.$service('$location'),
$route = scope.$service('$route'),
diff --git a/test/service/windowSpec.js b/test/service/windowSpec.js
index 3ead3df3..c539e285 100644
--- a/test/service/windowSpec.js
+++ b/test/service/windowSpec.js
@@ -3,17 +3,17 @@
describe('$window', function() {
var scope;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope();
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
- it("should inject $window", function(){
+ it("should inject $window", function() {
expect(scope.$service('$window')).toBe(window);
});
});
diff --git a/test/service/xhr.bulkSpec.js b/test/service/xhr.bulkSpec.js
index e35673c7..6b99fbba 100644
--- a/test/service/xhr.bulkSpec.js
+++ b/test/service/xhr.bulkSpec.js
@@ -3,7 +3,7 @@
describe('$xhr.bulk', function() {
var scope, $browser, $browserXhr, $log, $xhrBulk, $xhrError, log;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope(angular.service, {
'$xhr.error': $xhrError = jasmine.createSpy('$xhr.error'),
'$log': $log = {}
@@ -16,7 +16,7 @@ describe('$xhr.bulk', function() {
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
@@ -27,7 +27,7 @@ describe('$xhr.bulk', function() {
}
- it('should collect requests', function(){
+ it('should collect requests', function() {
$xhrBulk.urls["/"] = {match:/.*/};
$xhrBulk('GET', '/req1', null, callback);
$xhrBulk('POST', '/req2', {post:'data'}, callback);
@@ -39,13 +39,13 @@ describe('$xhr.bulk', function() {
{status:200, response:'first'},
{status:200, response:'second'}
]);
- $xhrBulk.flush(function(){ log += 'DONE';});
+ $xhrBulk.flush(function() { log += 'DONE';});
$browserXhr.flush();
expect(log).toEqual('"first";"second";DONE');
});
- it('should handle non 200 status code by forwarding to error handler', function(){
+ it('should handle non 200 status code by forwarding to error handler', function() {
$xhrBulk.urls['/'] = {match:/.*/};
$xhrBulk('GET', '/req1', null, callback);
$xhrBulk('POST', '/req2', {post:'data'}, callback);
@@ -57,7 +57,7 @@ describe('$xhr.bulk', function() {
{status:404, response:'NotFound'},
{status:200, response:'second'}
]);
- $xhrBulk.flush(function(){ log += 'DONE';});
+ $xhrBulk.flush(function() { log += 'DONE';});
$browserXhr.flush();
expect($xhrError).toHaveBeenCalled();
diff --git a/test/service/xhr.cacheSpec.js b/test/service/xhr.cacheSpec.js
index c6b9cfec..0c77e629 100644
--- a/test/service/xhr.cacheSpec.js
+++ b/test/service/xhr.cacheSpec.js
@@ -12,7 +12,7 @@ describe('$xhr.cache', function() {
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
@@ -23,7 +23,7 @@ describe('$xhr.cache', function() {
}
- it('should cache requests', function(){
+ it('should cache requests', function() {
$browserXhr.expectGET('/url').respond('first');
cache('GET', '/url', null, callback);
$browserXhr.flush();
@@ -39,7 +39,7 @@ describe('$xhr.cache', function() {
});
- it('should first return cache request, then return server request', function(){
+ it('should first return cache request, then return server request', function() {
$browserXhr.expectGET('/url').respond('first');
cache('GET', '/url', null, callback, true);
$browserXhr.flush();
@@ -54,7 +54,7 @@ describe('$xhr.cache', function() {
});
- it('should serve requests from cache', function(){
+ it('should serve requests from cache', function() {
cache.data.url = {value:'123'};
cache('GET', 'url', null, callback);
$browser.defer.flush();
@@ -66,7 +66,7 @@ describe('$xhr.cache', function() {
});
- it('should keep track of in flight requests and request only once', function(){
+ it('should keep track of in flight requests and request only once', function() {
scope.$service('$xhr.bulk').urls['/bulk'] = {
match:function(url){
return url == '/url';
@@ -85,7 +85,7 @@ describe('$xhr.cache', function() {
});
- it('should clear cache on non GET', function(){
+ it('should clear cache on non GET', function() {
$browserXhr.expectPOST('abc', {}).respond({});
cache.data.url = {value:123};
cache('POST', 'abc', {});
diff --git a/test/service/xhr.errorSpec.js b/test/service/xhr.errorSpec.js
index 6cc7fce0..49b63fd0 100644
--- a/test/service/xhr.errorSpec.js
+++ b/test/service/xhr.errorSpec.js
@@ -3,7 +3,7 @@
describe('$xhr.error', function() {
var scope, $browser, $browserXhr, $xhr, $xhrError, log;
- beforeEach(function(){
+ beforeEach(function() {
scope = angular.scope(angular.service, {
'$xhr.error': $xhrError = jasmine.createSpy('$xhr.error')
});
@@ -14,7 +14,7 @@ describe('$xhr.error', function() {
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
@@ -25,7 +25,7 @@ describe('$xhr.error', function() {
}
- it('should handle non 200 status codes by forwarding to error handler', function(){
+ it('should handle non 200 status codes by forwarding to error handler', function() {
$browserXhr.expectPOST('/req', 'MyData').respond(500, 'MyError');
$xhr('POST', '/req', 'MyData', callback);
$browserXhr.flush();
diff --git a/test/service/xhrSpec.js b/test/service/xhrSpec.js
index b01eb385..2a552403 100644
--- a/test/service/xhrSpec.js
+++ b/test/service/xhrSpec.js
@@ -3,7 +3,7 @@
describe('$xhr', function() {
var scope, $browser, $browserXhr, $log, $xhr, $xhrErr, log;
- beforeEach(function(){
+ beforeEach(function() {
var scope = angular.scope(angular.service, {
'$xhr.error': $xhrErr = jasmine.createSpy('xhr.error')});
$log = scope.$service('$log');
@@ -14,7 +14,7 @@ describe('$xhr', function() {
});
- afterEach(function(){
+ afterEach(function() {
dealoc(scope);
});
@@ -24,7 +24,7 @@ describe('$xhr', function() {
}
- it('should forward the request to $browser and decode JSON', function(){
+ it('should forward the request to $browser and decode JSON', function() {
$browserXhr.expectGET('/reqGET').respond('first');
$browserXhr.expectGET('/reqGETjson').respond('["second"]');
$browserXhr.expectPOST('/reqPOST', {post:'data'}).respond('third');
@@ -41,7 +41,7 @@ describe('$xhr', function() {
'{code=200; response="first"}');
});
- it('should allow all 2xx requests', function(){
+ it('should allow all 2xx requests', function() {
$browserXhr.expectGET('/req1').respond(200, '1');
$xhr('GET', '/req1', null, callback);
$browserXhr.flush();
@@ -56,9 +56,9 @@ describe('$xhr', function() {
});
- it('should handle exceptions in callback', function(){
+ it('should handle exceptions in callback', function() {
$browserXhr.expectGET('/reqGET').respond('first');
- $xhr('GET', '/reqGET', null, function(){ throw "MyException"; });
+ $xhr('GET', '/reqGET', null, function() { throw "MyException"; });
$browserXhr.flush();
expect($log.error.logs.shift()).toContain('MyException');
@@ -140,7 +140,7 @@ describe('$xhr', function() {
describe('default headers', function() {
- it('should set default headers for GET request', function(){
+ it('should set default headers for GET request', function() {
var callback = jasmine.createSpy('callback');
$browserXhr.expectGET('URL', '', {'Accept': 'application/json, text/plain, */*',
@@ -153,7 +153,7 @@ describe('$xhr', function() {
});
- it('should set default headers for POST request', function(){
+ it('should set default headers for POST request', function() {
var callback = jasmine.createSpy('callback');
$browserXhr.expectPOST('URL', 'xx', {'Accept': 'application/json, text/plain, */*',
@@ -167,7 +167,7 @@ describe('$xhr', function() {
});
- it('should set default headers for custom HTTP method', function(){
+ it('should set default headers for custom HTTP method', function() {
var callback = jasmine.createSpy('callback');
$browserXhr.expect('FOO', 'URL', '', {'Accept': 'application/json, text/plain, */*',
@@ -260,8 +260,8 @@ describe('$xhr', function() {
});
});
- describe('xsrf', function(){
- it('should copy the XSRF cookie into a XSRF Header', function(){
+ describe('xsrf', function() {
+ it('should copy the XSRF cookie into a XSRF Header', function() {
var code, response;
$browserXhr
.expectPOST('URL', 'DATA', {'X-XSRF-TOKEN': 'secret'})
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index 41a6455c..b3316c0c 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -11,7 +11,7 @@ _jQuery.event.special.change = undefined;
if (window.jstestdriver) {
window.jstd = jstestdriver;
- window.dump = function dump(){
+ window.dump = function dump() {
var args = [];
forEach(arguments, function(arg){
if (isElement(arg)) {
@@ -46,7 +46,7 @@ function dumpScope(scope, offset) {
return log.join('\n' + offset);
}
-beforeEach(function(){
+beforeEach(function() {
// This is to reset parsers global cache of expressions.
compileCache = {};
@@ -65,7 +65,7 @@ beforeEach(function(){
jqLite(document.body).html('');
function cssMatcher(presentClasses, absentClasses) {
- return function(){
+ return function() {
var element = jqLite(this.actual);
var present = true;
var absent = false;
@@ -78,7 +78,7 @@ beforeEach(function(){
absent = absent || element.hasClass(className);
});
- this.message = function(){
+ this.message = function() {
return "Expected to have " + presentClasses +
(absentClasses ? (" and not have " + absentClasses + "" ) : "") +
" but had " + element[0].className + ".";
@@ -98,7 +98,7 @@ beforeEach(function(){
},
toHaveClass: function(clazz) {
- this.message = function(){
+ this.message = function() {
return "Expected '" + sortedHtml(this.actual) + "' to have class '" + clazz + "'.";
};
return this.actual.hasClass ?
@@ -191,7 +191,7 @@ afterEach(function() {
clearJqCache();
});
-function clearJqCache(){
+function clearJqCache() {
var count = 0;
forEachSorted(jqCache, function(value, key){
count ++;
diff --git a/test/widget/formSpec.js b/test/widget/formSpec.js
index 7c575c33..7d136dd8 100644
--- a/test/widget/formSpec.js
+++ b/test/widget/formSpec.js
@@ -1,35 +1,35 @@
'use strict';
-describe('form', function(){
+describe('form', function() {
var doc;
- afterEach(function(){
+ afterEach(function() {
dealoc(doc);
});
- it('should attach form to DOM', function(){
+ it('should attach form to DOM', function() {
doc = angular.element('