My entire team prefers to use just the TextDiffReporter for day-to-day development, so we would like to do this in the code:
auto defaultReporter = ApprovalTests::Approvals::useAsFrontLoadedReporter(
std::make_shared<ApprovalTests::TextDiffReporter>());
However we would also like to use the APPROVAL_TESTS_USE_REPORTER environment variable to run with the AutoApproveIfMissingReporter when adding new tests, or AutoApproveReporter if we are making some bulk changes to our output. Or maybe in certain use cases or for certain developers they want to use a regular diff tool again. We would prefer not to have to do this via code because it ends up creating local changes that can be accidentally committed etc. And an #ifdef seems not so great if the environment variable is already provided.
But APPROVAL_TESTS_USE_REPORTER does not seem to override this default. It seems like it should to me.
My entire team prefers to use just the
TextDiffReporterfor day-to-day development, so we would like to do this in the code:However we would also like to use the
APPROVAL_TESTS_USE_REPORTERenvironment variable to run with theAutoApproveIfMissingReporterwhen adding new tests, orAutoApproveReporterif we are making some bulk changes to our output. Or maybe in certain use cases or for certain developers they want to use a regular diff tool again. We would prefer not to have to do this via code because it ends up creating local changes that can be accidentally committed etc. And an #ifdef seems not so great if the environment variable is already provided.But
APPROVAL_TESTS_USE_REPORTERdoes not seem to override this default. It seems like it should to me.