1- import { StateBuilder , StateMatcher , ng1ViewsBuilder , extend } from " ../src/index" ;
2- import { Resolvable } from " @uirouter/core" ;
1+ import { StateBuilder , StateMatcher , ng1ViewsBuilder , extend } from ' ../src/index' ;
2+ import { Resolvable } from ' @uirouter/core' ;
33declare var inject ;
44
55describe ( 'Ng1 StateBuilder' , function ( ) {
6- var parent = { name : "" } ;
7- var builder , matcher , urlMatcherFactoryProvider : any = {
6+ const parent = { name : '' } ;
7+ let builder , matcher , urlMatcherFactoryProvider : any = {
88 compile : function ( ) { } ,
9- isMatcher : function ( ) { }
9+ isMatcher : function ( ) { } ,
1010 } ;
1111
1212 beforeEach ( function ( ) {
@@ -16,32 +16,32 @@ describe('Ng1 StateBuilder', function() {
1616 } ) ;
1717
1818 it ( 'should use the state object to build a default view, when no `views` property is found' , function ( ) {
19- var config = { url : " /foo" , templateUrl : " /foo.html" , controller : " FooController" , parent : parent } ;
20- var built = builder . builder ( 'views' ) ( config ) ;
19+ const config = { url : ' /foo' , templateUrl : ' /foo.html' , controller : ' FooController' , parent : parent } ;
20+ const built = builder . builder ( 'views' ) ( config ) ;
2121
2222 expect ( built . $default ) . not . toEqualData ( config ) ;
23- expect ( built . $default ) . toEqualData ( { templateUrl : " /foo.html" , controller : " FooController" , resolveAs : '$resolve' } ) ;
23+ expect ( built . $default ) . toEqualData ( { templateUrl : ' /foo.html' , controller : ' FooController' , resolveAs : '$resolve' } ) ;
2424 } ) ;
2525
2626 it ( 'It should use the views object to build views, when defined' , function ( ) {
27- var config = { a : { foo : " bar" , controller : " FooController" } } ;
28- let builtViews = builder . builder ( 'views' ) ( { parent : parent , views : config } ) ;
27+ const config = { a : { foo : ' bar' , controller : ' FooController' } } ;
28+ const builtViews = builder . builder ( 'views' ) ( { parent : parent , views : config } ) ;
2929 expect ( builtViews . a . foo ) . toEqualData ( config . a . foo ) ;
3030 expect ( builtViews . a . controller ) . toEqualData ( config . a . controller ) ;
3131 } ) ;
3232
33- it ( " should not allow a view config with both component and template keys" , inject ( function ( $injector ) {
34- var config = { name : " foo" , url : " /foo" , template : " <h1>hey</h1>" , controller : " FooController" , parent : parent } ;
33+ it ( ' should not allow a view config with both component and template keys' , inject ( function ( $injector ) {
34+ const config = { name : ' foo' , url : ' /foo' , template : ' <h1>hey</h1>' , controller : ' FooController' , parent : parent } ;
3535 expect ( ( ) => builder . builder ( 'views' ) ( config ) ) . not . toThrow ( ) ;
3636 expect ( ( ) => builder . builder ( 'views' ) ( extend ( { component : 'fooComponent' } , config ) ) ) . toThrow ( ) ;
3737 expect ( ( ) => builder . builder ( 'views' ) ( extend ( { componentProvider : ( ) => 'fooComponent' } , config ) ) ) . toThrow ( ) ;
38- expect ( ( ) => builder . builder ( 'views' ) ( extend ( { bindings : { } } , config ) ) ) . toThrow ( ) ;
38+ expect ( ( ) => builder . builder ( 'views' ) ( extend ( { bindings : { } } , config ) ) ) . toThrow ( ) ;
3939 } ) ) ;
4040
41- it ( " should replace a resolve: string value with a function that injects the service of the same name" , inject ( function ( $injector ) {
42- var config = { resolve : { foo : " bar" } } ;
41+ it ( ' should replace a resolve: string value with a function that injects the service of the same name' , inject ( function ( $injector ) {
42+ const config = { resolve : { foo : ' bar' } } ;
4343 expect ( builder . builder ( 'resolvables' ) ) . toBeDefined ( ) ;
44- var built : Resolvable [ ] = builder . builder ( 'resolvables' ) ( config ) ;
45- expect ( built [ 0 ] . deps ) . toEqual ( [ " bar" ] ) ;
44+ const built : Resolvable [ ] = builder . builder ( 'resolvables' ) ( config ) ;
45+ expect ( built [ 0 ] . deps ) . toEqual ( [ ' bar' ] ) ;
4646 } ) ) ;
4747} ) ;
0 commit comments