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

Custom git.pushRepo test fails when upstream is set #730

Closed
SuaYoo opened this issue Jan 19, 2021 · 1 comment
Closed

Custom git.pushRepo test fails when upstream is set #730

SuaYoo opened this issue Jan 19, 2021 · 1 comment

Comments

@SuaYoo
Copy link
Contributor

SuaYoo commented Jan 19, 2021

Minor dev issue: the 'should release to git.pushRepo' unit test fails in my fork. Looks like getting or reading the actual upstream URL isn't being stubbed.

To replicate locally:

  1. Set upstream URL to anything: git remote add upstream git@github.com:SuaYoot/test-upstream.git
  2. Run tests: npm test. Observe test fails with something like:
  github › should release to git.pushRepo

  Rejected promise returned by test. Reason:

  Error {
    message: `500 (request to https://api.github.com/repos/SuaYoo/test-upstream/releases failed, reason: Nock: No match for request {␊
      "method": "POST",␊
      "url": "https://api.github.com/repos/SuaYoo/test-upstream/releases",␊
      "headers": {␊
        "accept": [␊
          "application/vnd.github.v3+json"␊
        ],␊
        "user-agent": [␊
          "release-it/14.2.2 octokit-rest.js/18.0.12 octokit-core.js/3.2.4 Node.js/11.15.0 (darwin; x64)"␊
        ],␊
        "authorization": [␊
          "token 1"␊
        ],␊
        "content-type": [␊
          "application/json; charset=utf-8"␊
        ],␊
        "content-length": [␊
          "75"␊
        ],␊
        "accept-encoding": [␊
          "gzip,deflate"␊
        ],␊
        "connection": [␊
          "close"␊
        ]␊
      },␊
      "body": "{\\"tag_name\\":\\"1.0.1\\",\\"name\\":\\"\\",\\"body\\":null,\\"draft\\":false,\\"prerelease\\":false}"␊
    })`,
  }

  › })
  › GitHub.handleError (lib/plugin/github/GitHub.js:123:25)
  › retry (lib/plugin/github/GitHub.js:222:21)
  1. Remove upstream: git remote remove upstream
  2. Run tests again. Observe that tests now pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants