Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: reduce the usage of defaultConfig #20619

Closed
RahulGautamSingh opened this issue Feb 24, 2023 · 0 comments · Fixed by #22769
Closed

test: reduce the usage of defaultConfig #20619

RahulGautamSingh opened this issue Feb 24, 2023 · 0 comments · Fixed by #22769
Assignees
Labels
priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:refactor Refactoring or improving of existing code

Comments

@RahulGautamSingh
Copy link
Collaborator

RahulGautamSingh commented Feb 24, 2023

Describe the proposed change(s).

So I propose to replace defaultConfig = getConfig -> smaller configs which are narrowed down to contain only the options needed for the specific test

Example of what I mean:

    it('uses semantic commits', () => {
      // TODO #7154 incompatible types
      const branch: BranchUpgradeConfig[] = [
        {
          ...defaultConfig,
          manager: 'some-manager',
          depName: 'some-dep',
          semanticCommits: 'enabled',
          semanticCommitType: 'chore',
          semanticCommitScope: 'package',
          newValue: '1.2.0',
          isSingleVersion: true,
          newVersion: '1.2.0',
          foo: 1,
          group: {
            foo: 2,
          },
        } as BranchUpgradeConfig,
      ];
      const res = generateBranchConfig(branch);
      expect(res.prTitle).toBe(
        'chore(package): update dependency some-dep to v1.2.0'
      );
      expect(res.commitMessage).toBe(
        'chore(package): update dependency some-dep to v1.2.0'
      );
    });

The prev config only needs the default commit message options ie. commitMessage(Action|Prefix|Topic)

Will be using this issue till all non-necessary usage of defaultConfig have been replaced. 👍

@RahulGautamSingh RahulGautamSingh added type:refactor Refactoring or improving of existing code status:requirements Full requirements are not yet known, so implementation should not be started priority-5-triage labels Feb 24, 2023
@RahulGautamSingh RahulGautamSingh self-assigned this Feb 24, 2023
@viceice viceice added priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation and removed status:requirements Full requirements are not yet known, so implementation should not be started priority-5-triage labels Feb 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:refactor Refactoring or improving of existing code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants