Using the isTelemetryEnabled provided by VSCode and fixing unit tests #472
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This API also respects the telemetry flag passed in through the CLI when the user starts their code session: https://code.visualstudio.com/updates/v1_55#_telemetry-enablement-api
Regarding the tests, the original tests were not working because it would fail at the line below with an error saying that the update function did not exist.
This was because we stubbed out the result returned by
getConfiguration
and the stubbed result did not have it. However, we don't really need to call update to simulate a config change since we are calling the constructor which callsareAllTelemetryConfigsEnabled
anyway.The reason why the tests did not pass was because we would reach the end of the test case before we reached the exception above. I also updated the tests to wait for all the cases before moving forward.