renovate/lib/platform/bitbucket/__snapshots__/index.spec.ts.snap
2020-03-05 21:57:24 +01:00

340 lines
7.7 KiB
Text

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`platform/bitbucket addReviewers should add the given reviewers to the PR 1`] = `
Array [
Array [
"/2.0/repositories/some/repo/pullrequests/5",
Object {
"body": Object {
"reviewers": Array [
Object {
"username": "someuser",
},
Object {
"username": "someotheruser",
},
],
"title": "title",
},
},
],
]
`;
exports[`platform/bitbucket createPr() posts PR 1`] = `
Array [
Array [
"/2.0/repositories/some/repo/pullrequests",
Object {
"body": Object {
"close_source_branch": true,
"description": "body",
"destination": Object {
"branch": Object {
"name": "master",
},
},
"reviewers": Array [
Object {
"uuid": "{1234-5678}",
},
],
"source": Object {
"branch": Object {
"name": "branch",
},
},
"title": "title",
},
},
],
]
`;
exports[`platform/bitbucket deleteBranch() should handle closing PRs when none exist 1`] = `Array []`;
exports[`platform/bitbucket deleteBranch() should handle closing PRs when some exist 1`] = `
Array [
Array [
"/2.0/repositories/some/repo/pullrequests/5/decline",
],
]
`;
exports[`platform/bitbucket ensureIssue() creates new issue 1`] = `
Array [
Array [
"/2.0/repositories/some/empty",
],
Array [
"/2.0/repositories/some/empty/issues?q=title%3D%22title%22%20AND%20(state%20%3D%20%22new%22%20OR%20state%20%3D%20%22open%22)%20AND%20reporter.username%3D%22abc%22",
],
]
`;
exports[`platform/bitbucket ensureIssue() creates new issue 2`] = `
Array [
Array [
"/2.0/repositories/some/empty/issues",
Object {
"body": Object {
"content": Object {
"markup": "markdown",
"raw": "body",
},
"title": "title",
},
},
],
]
`;
exports[`platform/bitbucket ensureIssue() noop for existing issue 1`] = `
Array [
Array [
"/2.0/repositories/some/repo/issues?q=title%3D%22title%22%20AND%20(state%20%3D%20%22new%22%20OR%20state%20%3D%20%22open%22)%20AND%20reporter.username%3D%22abc%22",
],
]
`;
exports[`platform/bitbucket ensureIssue() updates existing issues 1`] = `
Array [
Array [
"/2.0/repositories/some/repo/issues?q=title%3D%22title%22%20AND%20(state%20%3D%20%22new%22%20OR%20state%20%3D%20%22open%22)%20AND%20reporter.username%3D%22abc%22",
],
]
`;
exports[`platform/bitbucket ensureIssue() updates existing issues 2`] = `Array []`;
exports[`platform/bitbucket ensureIssueClosing() does not throw 1`] = `
Array [
Array [
"/2.0/repositories/some/repo/issues?q=title%3D%22title%22%20AND%20(state%20%3D%20%22new%22%20OR%20state%20%3D%20%22open%22)%20AND%20reporter.username%3D%22abc%22",
],
]
`;
exports[`platform/bitbucket ensureIssueClosing() does not throw 2`] = `Array []`;
exports[`platform/bitbucket findIssue() does not throw 1`] = `
Object {
"body": "content",
"number": 25,
}
`;
exports[`platform/bitbucket findIssue() does not throw 2`] = `
Array [
Array [
"/2.0/repositories/some/repo/issues?q=title%3D%22title%22%20AND%20(state%20%3D%20%22new%22%20OR%20state%20%3D%20%22open%22)%20AND%20reporter.username%3D%22abc%22",
],
]
`;
exports[`platform/bitbucket findPr() finds pr 1`] = `
Object {
"body": "summary",
"branchName": "branch",
"createdAt": "2018-07-02T07:02:25.275030+00:00",
"number": 5,
"state": "open",
"targetBranch": "master",
"title": "title",
}
`;
exports[`platform/bitbucket getBranchPr() bitbucket finds PR for branch 1`] = `
Object {
"body": "summary",
"branchName": "branch",
"canMerge": true,
"createdAt": "2018-07-02T07:02:25.275030+00:00",
"displayNumber": "Pull Request #5",
"isConflicted": false,
"isModified": false,
"isStale": false,
"number": 5,
"state": "open",
"targetBranch": "master",
"title": "title",
}
`;
exports[`platform/bitbucket getPr() canRebase 1`] = `
Object {
"body": "summary",
"branchName": "branch",
"canMerge": true,
"createdAt": "2018-07-02T07:02:25.275030+00:00",
"displayNumber": "Pull Request #3",
"isConflicted": false,
"isModified": true,
"isStale": false,
"number": 3,
"state": "open",
"targetBranch": "master",
"title": "title",
}
`;
exports[`platform/bitbucket getPr() canRebase 2`] = `
Object {
"body": "summary",
"branchName": "branch",
"canMerge": true,
"createdAt": "2018-07-02T07:02:25.275030+00:00",
"displayNumber": "Pull Request #5",
"isConflicted": false,
"isModified": false,
"isStale": false,
"number": 5,
"state": "open",
"targetBranch": "master",
"title": "title",
}
`;
exports[`platform/bitbucket getPr() canRebase 3`] = `
Object {
"body": "summary",
"branchName": "branch",
"canMerge": true,
"createdAt": "2018-07-02T07:02:25.275030+00:00",
"displayNumber": "Pull Request #5",
"isConflicted": false,
"isModified": true,
"isStale": false,
"number": 5,
"state": "open",
"targetBranch": "master",
"title": "title",
}
`;
exports[`platform/bitbucket getPr() canRebase 4`] = `
Array [
Array [
"/2.0/repositories/some/repo/pullrequests/3",
],
Array [
"/2.0/repositories/some/repo/pullrequests/3/diff",
Object {
"json": false,
},
],
Array [
"https://api.bitbucket.org/2.0/repositories/some/repo/pullrequests/3/commits?pagelen=2",
],
Array [
"/2.0/repositories/some/repo/pullrequests/5",
],
Array [
"/2.0/repositories/some/repo/pullrequests/5/diff",
Object {
"json": false,
},
],
Array [
"https://api.bitbucket.org/2.0/repositories/some/repo/pullrequests/5/commits?pagelen=2",
],
Array [
"/2.0/repositories/some/repo/pullrequests/5",
],
Array [
"/2.0/repositories/some/repo/pullrequests/5/diff",
Object {
"json": false,
},
],
Array [
"https://api.bitbucket.org/2.0/repositories/some/repo/pullrequests/5/commits?pagelen=2",
],
]
`;
exports[`platform/bitbucket getPr() exists 1`] = `
Object {
"body": "summary",
"branchName": "branch",
"canMerge": true,
"createdAt": "2018-07-02T07:02:25.275030+00:00",
"displayNumber": "Pull Request #5",
"isConflicted": false,
"isModified": false,
"isStale": false,
"number": 5,
"state": "open",
"targetBranch": "master",
"title": "title",
}
`;
exports[`platform/bitbucket getPrBody() returns diff files 1`] = `"**foo**bartext"`;
exports[`platform/bitbucket getPrFiles() returns diff files 1`] = `
Array [
"requirements.txt",
]
`;
exports[`platform/bitbucket initPlatform() should init 1`] = `
Object {
"endpoint": "https://api.bitbucket.org/",
}
`;
exports[`platform/bitbucket initRepo() works 1`] = `
Object {
"baseBranch": "master",
"isFork": false,
}
`;
exports[`platform/bitbucket mergePr() posts Merge 1`] = `
Array [
Array [
"/2.0/repositories/some/repo/pullrequests/5/merge",
Object {
"body": Object {
"close_source_branch": true,
"merge_strategy": "merge_commit",
"message": "auto merged",
},
},
],
]
`;
exports[`platform/bitbucket setBaseBranch() updates file list 1`] = `Array []`;
exports[`platform/bitbucket setBranchStatus() posts status 1`] = `
Array [
Array [
"/2.0/repositories/some/repo/commit/branch_hash/statuses/build",
Object {
"body": Object {
"description": "description",
"key": "context",
"name": "context",
"state": "FAILED",
"url": "targetUrl",
},
},
],
]
`;
exports[`platform/bitbucket updatePr() puts PR 1`] = `
Array [
Array [
"/2.0/repositories/some/repo/pullrequests/5",
Object {
"body": Object {
"description": "body",
"title": "title",
},
},
],
]
`;