@@ -118,7 +118,7 @@ describe('angular', function() {
118
118
119
119
it ( 'should throw an exception when source and destination are equivalent' , function ( ) {
120
120
var src , dst ;
121
- src = dst = { key : 'value' } ;
121
+ src = dst = { key : 'value' } ;
122
122
expect ( function ( ) { copy ( src , dst ) ; } ) . toThrowMinErr ( "ng" , "cpi" , "Can't copy! Source and destination are identical." ) ;
123
123
src = dst = [ 2 , 4 ] ;
124
124
expect ( function ( ) { copy ( src , dst ) ; } ) . toThrowMinErr ( "ng" , "cpi" , "Can't copy! Source and destination are identical." ) ;
@@ -149,7 +149,6 @@ describe('angular', function() {
149
149
} ) ;
150
150
151
151
describe ( "extend" , function ( ) {
152
-
153
152
it ( 'should not copy the private $$hashKey' , function ( ) {
154
153
var src , dst ;
155
154
src = { } ;
@@ -209,7 +208,7 @@ describe('angular', function() {
209
208
210
209
it ( 'should omit properties from prototype chain' , function ( ) {
211
210
var original , clone = { } ;
212
- function Func ( ) { } ;
211
+ function Func ( ) { }
213
212
Func . prototype . hello = "world" ;
214
213
215
214
original = new Func ( ) ;
@@ -316,6 +315,7 @@ describe('angular', function() {
316
315
} ) ;
317
316
318
317
it ( 'should correctly test for keys that are present on Object.prototype' , function ( ) {
318
+ /* jshint -W001 */
319
319
// MS IE8 just doesn't work for this kind of thing, since "for ... in" doesn't return
320
320
// things like hasOwnProperty even if it is explicitly defined on the actual object!
321
321
if ( msie <= 8 ) return ;
@@ -457,7 +457,7 @@ describe('angular', function() {
457
457
expect ( toKeyValue ( { key : [ 323 , 'value' , true ] } ) ) . toEqual ( 'key=323&key=value&key' ) ;
458
458
expect ( toKeyValue ( { key : [ 323 , 'value' , true , 1234 ] } ) ) .
459
459
toEqual ( 'key=323&key=value&key&key=1234' ) ;
460
- } ) ;
460
+ } ) ;
461
461
} ) ;
462
462
463
463
@@ -472,13 +472,14 @@ describe('angular', function() {
472
472
var obj = new MyObj ( ) ,
473
473
log = [ ] ;
474
474
475
- forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) } ) ;
475
+ forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) ; } ) ;
476
476
477
477
expect ( log ) . toEqual ( [ 'bar:barVal' , 'baz:bazVal' ] ) ;
478
478
} ) ;
479
479
480
480
481
481
it ( 'should not break if obj is an array we override hasOwnProperty' , function ( ) {
482
+ /* jshint -W001 */
482
483
var obj = [ ] ;
483
484
obj [ 0 ] = 1 ;
484
485
obj [ 1 ] = 2 ;
@@ -506,7 +507,7 @@ describe('angular', function() {
506
507
log = [ ] ;
507
508
508
509
509
- forEach ( nodeList , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) } ) ;
510
+ forEach ( nodeList , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) ; } ) ;
510
511
expect ( log ) . toEqual ( [ '0:a' , '1:b' , '2:c' ] ) ;
511
512
} ) ;
512
513
@@ -521,7 +522,7 @@ describe('angular', function() {
521
522
var htmlCollection = document . getElementsByName ( 'x' ) ,
522
523
log = [ ] ;
523
524
524
- forEach ( htmlCollection , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) } ) ;
525
+ forEach ( htmlCollection , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) ; } ) ;
525
526
expect ( log ) . toEqual ( [ '0:a' , '1:c' ] ) ;
526
527
} ) ;
527
528
@@ -536,7 +537,7 @@ describe('angular', function() {
536
537
var htmlCollection = document . querySelectorAll ( '[name="x"]' ) ,
537
538
log = [ ] ;
538
539
539
- forEach ( htmlCollection , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) } ) ;
540
+ forEach ( htmlCollection , function ( value , key ) { log . push ( key + ':' + value . innerHTML ) ; } ) ;
540
541
expect ( log ) . toEqual ( [ '0:a' , '1:c' ] ) ;
541
542
} ) ;
542
543
}
@@ -545,42 +546,42 @@ describe('angular', function() {
545
546
var args ,
546
547
log = [ ] ;
547
548
548
- ( function ( ) { args = arguments } ( 'a' , 'b' , 'c' ) ) ;
549
+ ( function ( ) { args = arguments ; } ( 'a' , 'b' , 'c' ) ) ;
549
550
550
- forEach ( args , function ( value , key ) { log . push ( key + ':' + value ) } ) ;
551
+ forEach ( args , function ( value , key ) { log . push ( key + ':' + value ) ; } ) ;
551
552
expect ( log ) . toEqual ( [ '0:a' , '1:b' , '2:c' ] ) ;
552
553
} ) ;
553
554
554
555
it ( 'should handle string values like arrays' , function ( ) {
555
556
var log = [ ] ;
556
557
557
- forEach ( 'bar' , function ( value , key ) { log . push ( key + ':' + value ) } ) ;
558
+ forEach ( 'bar' , function ( value , key ) { log . push ( key + ':' + value ) ; } ) ;
558
559
expect ( log ) . toEqual ( [ '0:b' , '1:a' , '2:r' ] ) ;
559
560
} ) ;
560
561
561
562
562
563
it ( 'should handle objects with length property as objects' , function ( ) {
563
564
var obj = {
564
- 'foo' : 'bar' ,
565
- 'length' : 2
566
- } ,
567
- log = [ ] ;
565
+ 'foo' : 'bar' ,
566
+ 'length' : 2
567
+ } ,
568
+ log = [ ] ;
568
569
569
- forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) } ) ;
570
+ forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) ; } ) ;
570
571
expect ( log ) . toEqual ( [ 'foo:bar' , 'length:2' ] ) ;
571
572
} ) ;
572
573
573
574
574
575
it ( 'should handle objects of custom types with length property as objects' , function ( ) {
575
576
function CustomType ( ) {
576
577
this . length = 2 ;
577
- this . foo = 'bar'
578
+ this . foo = 'bar' ;
578
579
}
579
580
580
581
var obj = new CustomType ( ) ,
581
582
log = [ ] ;
582
583
583
- forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) } ) ;
584
+ forEach ( obj , function ( value , key ) { log . push ( key + ':' + value ) ; } ) ;
584
585
expect ( log ) . toEqual ( [ 'length:2' , 'foo:bar' ] ) ;
585
586
} ) ;
586
587
} ) ;
@@ -748,9 +749,11 @@ describe('angular', function() {
748
749
var appElement = jqLite ( '<div ng-app="doesntexist"></div>' ) [ 0 ] ;
749
750
750
751
expect ( function ( ) {
751
- angularInit ( appElement , bootstrap ) ;
752
+ angularInit ( appElement , angular . bootstrap ) ;
752
753
} ) . toThrowMatching (
753
- / \[ \$ i n j e c t o r : m o d u l e r r ] F a i l e d t o i n s t a n t i a t e m o d u l e d o e s n t e x i s t d u e t o : \n .* \[ \$ i n j e c t o r : n o m o d ] M o d u l e ' d o e s n t e x i s t ' i s n o t a v a i l a b l e ! Y o u e i t h e r m i s s p e l l e d t h e m o d u l e n a m e o r f o r g o t t o l o a d i t \. /
754
+ new RegExp ( '\\[\\$injector:modulerr] Failed to instantiate module doesntexist due to:\\n' +
755
+ '.*\\[\\$injector:nomod] Module \'doesntexist\' is not available! You either ' +
756
+ 'misspelled the module name or forgot to load it\\.' )
754
757
) ;
755
758
} ) ;
756
759
@@ -789,7 +792,7 @@ describe('angular', function() {
789
792
expect ( bootstrapSpy . mostRecentCall . args [ 2 ] . strictDi ) . toBe ( true ) ;
790
793
791
794
var injector = appElement . injector ( ) ;
792
- function testFactory ( $rootScope ) { } ;
795
+ function testFactory ( $rootScope ) { }
793
796
expect ( function ( ) {
794
797
injector . instantiate ( testFactory ) ;
795
798
} ) . toThrowMinErr ( '$injector' , 'strictdi' ) ;
@@ -956,7 +959,9 @@ describe('angular', function() {
956
959
expect ( function ( ) {
957
960
angular . bootstrap ( element , [ 'doesntexist' ] ) ;
958
961
} ) . toThrowMatching (
959
- / \[ \$ i n j e c t o r : m o d u l e r r \] F a i l e d t o i n s t a n t i a t e m o d u l e d o e s n t e x i s t d u e t o : \n .* \[ \$ i n j e c t o r : n o m o d \] M o d u l e ' d o e s n t e x i s t ' i s n o t a v a i l a b l e ! Y o u e i t h e r m i s s p e l l e d t h e m o d u l e n a m e o r f o r g o t t o l o a d i t \. / ) ;
962
+ new RegExp ( '\\[\\$injector:modulerr\\] Failed to instantiate module doesntexist due to:\\n' +
963
+ '.*\\[\\$injector:nomod\\] Module \'doesntexist\' is not available! You either ' +
964
+ 'misspelled the module name or forgot to load it\\.' ) ) ;
960
965
961
966
expect ( element . html ( ) ) . toBe ( '{{1+2}}' ) ;
962
967
dealoc ( element ) ;
0 commit comments