SLIDE 1
Dummy Dummy fetchDiscounts is a side effect, a dummy can replace it - - PowerPoint PPT Presentation
Dummy Dummy fetchDiscounts is a side effect, a dummy can replace it - - PowerPoint PPT Presentation
Dummy Dummy fetchDiscounts is a side effect, a dummy can replace it for testing Dummy - Unit Test Dummy - Unit Test The object has nothing to do with the assertion of this test Stub Stub The service is not a core piece of our function, just
SLIDE 2
SLIDE 3
Dummy - Unit Test
SLIDE 4
Dummy - Unit Test
The object has nothing to do with the assertion of this test
SLIDE 5
Stub
SLIDE 6
Stub
The service is not a core piece of our function, just a side effect
SLIDE 7
Stub - Unit Test
SLIDE 8
Stub - unit test
The service is stubbed out to focus on the functionality of the method
SLIDE 9
Fake
SLIDE 10
Fake
Similar to a stub, but replaces functionality
SLIDE 11
Fake - Jest Setup File
SLIDE 12
Fake - Jest Setup File
SLIDE 13
Fake - Unit Test
Call the function as normal, and utilize the local storage fake implementation
SLIDE 14
Mock
Call the function as normal and utilize a mock to verify myService.placeOrder was called
SLIDE 15
Mock
Call the function as normal and utilize a mock to verify myService.placeOrder was called
SLIDE 16
Mock - Unit Test
SLIDE 17
Mock - Unit Test
Make sure that place order has been called, even verify the parameters
SLIDE 18
Unit Testing Decision Tree
SLIDE 19
Unit Testing Decision Tree
SLIDE 20
Unit Testing Decision Tree
SLIDE 21
Unit Testing Decision Tree
SLIDE 22
Unit Testing Decision Tree
SLIDE 23
Unit Testing Decision Tree
SLIDE 24