@@ -49,7 +49,7 @@ describe('LogNgHTML', () => {
4949 } ) ;
5050
5151 it ( 'should call prettyPrintFixture incase we provide a component fixture' , ( ) => {
52- spyOn ( fixturePrettier , 'fixturePrettier' ) ;
52+ jest . spyOn ( fixturePrettier , 'fixturePrettier' ) ;
5353 logNgHTML < MockComponent > ( fixture , enableComments , theme ) ;
5454 expect ( fixturePrettier . fixturePrettier ) . toHaveBeenCalledWith (
5555 fixture ,
@@ -59,8 +59,8 @@ describe('LogNgHTML', () => {
5959 } ) ;
6060
6161 it ( 'should call prettyPrintDebugElements in case we provide an array of DebugElements' , ( ) => {
62- spyOn ( console , 'log' ) ;
63- spyOn ( debugElementPrettier , 'prettyPrintDebugElements' ) ;
62+ jest . spyOn ( console , 'log' ) ;
63+ jest . spyOn ( debugElementPrettier , 'prettyPrintDebugElements' ) ;
6464 const debugElements = fixture . debugElement . queryAll ( By . css ( 'li' ) ) ;
6565 logNgHTML ( debugElements , enableComments , theme ) ;
6666 expect ( debugElementPrettier . prettyPrintDebugElements ) . toHaveBeenCalledWith (
@@ -71,8 +71,8 @@ describe('LogNgHTML', () => {
7171 } ) ;
7272
7373 it ( 'should call prettyPrintHTMLElements in case we provide an array of HTMLelements' , ( ) => {
74- spyOn ( console , 'log' ) ;
75- spyOn ( htmlElementPrettier , 'prettyPrintHtmlElements' ) ;
74+ jest . spyOn ( console , 'log' ) ;
75+ jest . spyOn ( htmlElementPrettier , 'prettyPrintHtmlElements' ) ;
7676 const htmlElements = fixture . debugElement
7777 . queryAll ( By . css ( 'li' ) )
7878 . map ( ( debugElement : DebugElement ) => debugElement . nativeElement ) ;
@@ -85,7 +85,7 @@ describe('LogNgHTML', () => {
8585 } ) ;
8686
8787 it ( 'should call prettyPrintDebugElement in case we provide a debug element' , ( ) => {
88- spyOn ( debugElementPrettier , 'prettyPrintDebugElement' ) ;
88+ jest . spyOn ( debugElementPrettier , 'prettyPrintDebugElement' ) ;
8989 const debugElement = fixture . debugElement . queryAll ( By . css ( 'li' ) ) [ 0 ] ;
9090 logNgHTML ( debugElement , enableComments , theme ) ;
9191 expect ( debugElementPrettier . prettyPrintDebugElement ) . toHaveBeenCalledWith (
@@ -96,7 +96,7 @@ describe('LogNgHTML', () => {
9696 } ) ;
9797
9898 it ( 'should call prettyPrintHTMLElement in case we provide a HTMLelement' , ( ) => {
99- spyOn ( htmlElementPrettier , 'prettyPrintHtmlElement' ) ;
99+ jest . spyOn ( htmlElementPrettier , 'prettyPrintHtmlElement' ) ;
100100 const htmlElement = fixture . debugElement . queryAll ( By . css ( 'li' ) ) [ 0 ]
101101 . nativeElement ;
102102 logNgHTML ( htmlElement , enableComments , theme ) ;
@@ -108,8 +108,8 @@ describe('LogNgHTML', () => {
108108 } ) ;
109109
110110 it ( 'should print a warning if we pass in an unknown type' , ( ) => {
111- spyOn ( console , 'log' ) ;
112- spyOn ( prettyHTMLLog , 'highlight' ) ;
111+ jest . spyOn ( console , 'log' ) ;
112+ jest . spyOn ( prettyHTMLLog , 'highlight' ) ;
113113 const htmlString = '<h1>Foo</h1>' ;
114114 logNgHTML ( htmlString , enableComments , theme ) ;
115115 expect ( prettyHTMLLog . highlight ) . toHaveBeenCalledWith ( htmlString , theme ) ;
@@ -118,11 +118,11 @@ describe('LogNgHTML', () => {
118118 it ( 'should print a warning and remove the comments we pass in an unknown type and enableComments' , ( ) => {
119119 const htmlString = '<h1>Foo</h1><!--Some comment-->' ;
120120 const commentFreeHTMLString = '<h1>Foo</h1>' ;
121- spyOn ( console , 'log' ) ;
122- spyOn ( prettyHTMLLog , 'highlight' ) ;
123- spyOn ( prettierUtil , 'removeComments' ) . and . returnValue (
124- commentFreeHTMLString
125- ) ;
121+ jest . spyOn ( console , 'log' ) ;
122+ jest . spyOn ( prettyHTMLLog , 'highlight' ) ;
123+ jest
124+ . spyOn ( prettierUtil , 'removeComments' )
125+ . mockReturnValue ( commentFreeHTMLString ) ;
126126 logNgHTML ( htmlString , false , theme ) ;
127127 expect ( prettyHTMLLog . highlight ) . toHaveBeenCalledWith (
128128 commentFreeHTMLString ,
0 commit comments