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
761
761
762
762
``` js
763
763
test (' logs a warning' , () => {
764
- using spy = jest .spyOn (console . warn );
764
+ using spy = jest .spyOn (console , ' warn' );
765
765
doSomeThingWarnWorthy ();
766
766
expect (spy).toHaveBeenCalled ();
767
767
});
@@ -773,7 +773,7 @@ That code is semantically equal to
773
773
test (' logs a warning' , () => {
774
774
let spy;
775
775
try {
776
- spy = jest .spyOn (console . warn );
776
+ spy = jest .spyOn (console , ' warn' );
777
777
doSomeThingWarnWorthy ();
778
778
expect (spy).toHaveBeenCalled ();
779
779
} finally {
@@ -789,7 +789,7 @@ You can even go a step further and use a code block to restrict your mock to onl
789
789
``` js
790
790
test (' testing something' , () => {
791
791
{
792
- using spy = jest .spyOn (console . warn );
792
+ using spy = jest .spyOn (console , ' warn' );
793
793
setupStepThatWillLogAWarning ();
794
794
}
795
795
// here, console.warn is already restored to the original value
You can’t perform that action at this time.
0 commit comments