Skip to content

APPROVAL_TESTS_USE_REPORTER should override the default reporter #242

Description

@MikeWeller

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions