File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -761,7 +761,7 @@ If your codebase is set up to transpile the ["explicit resource management"](htt
761761
762762``` js
763763test (' logs a warning' , () => {
764- using spy = jest .spyOn (console . warn );
764+ using spy = jest .spyOn (console , ' warn' );
765765 doSomeThingWarnWorthy ();
766766 expect (spy).toHaveBeenCalled ();
767767});
@@ -773,7 +773,7 @@ That code is semantically equal to
773773test (' logs a warning' , () => {
774774 let spy;
775775 try {
776- spy = jest .spyOn (console . warn );
776+ spy = jest .spyOn (console , ' warn' );
777777 doSomeThingWarnWorthy ();
778778 expect (spy).toHaveBeenCalled ();
779779 } finally {
@@ -789,7 +789,7 @@ You can even go a step further and use a code block to restrict your mock to onl
789789``` js
790790test (' testing something' , () => {
791791 {
792- using spy = jest .spyOn (console . warn );
792+ using spy = jest .spyOn (console , ' warn' );
793793 setupStepThatWillLogAWarning ();
794794 }
795795 // here, console.warn is already restored to the original value
You can’t perform that action at this time.
0 commit comments