Due to the current design of the Pester tests, each of the functions is actually being executed live during the test. For example, running a test against New-HipchatUser will actually create a new user in your HipChat environment. The test will then run Remove-HipchatUser to clean up after itself.
I would like to investigate somehow mocking a properly structured API response from Invoke-WebRequest, to ensure that functions aren't actually making changes to the environment. After all, we want to test the code itself, not the API.
I can't quite figure out how to structure the response correctly.
Due to the current design of the Pester tests, each of the functions is actually being executed live during the test. For example, running a test against New-HipchatUser will actually create a new user in your HipChat environment. The test will then run Remove-HipchatUser to clean up after itself.
I would like to investigate somehow mocking a properly structured API response from Invoke-WebRequest, to ensure that functions aren't actually making changes to the environment. After all, we want to test the code itself, not the API.
I can't quite figure out how to structure the response correctly.