Please enable JavaScript.
Coggle requires JavaScript to display documents.
Testing (Blocks ("describe" blocks - use to wrap the class test…
Testing
Blocks
-
-
-
"before" blocks, used to run certain code (i.e. stubbing lines) before "it" blocks are executed
Stubbing and Mocking
Stubbing
-
What is it?
Stubbing allows you to fake methods to make writing tests easier. You essentially predetermine a value and "create a journey" to check if you arrive at the same value.
-
-
Mocking
What is it?
Mocking allows you to make assertions about methods being called when you run your tests. Through mocking, you are essentially saying "when this method is called on a class, expect to receive certain arguments".
-
-
We use mocking to ensure that the "right" methods are being called within the method we are currently testing.
-
-
-
-
-
-
-