Updated github tests to reflect that the default branch is expected to be "main" for new repos that get created.
Signed-off-by: David Söderlund <ds@dsoderlund.consulting>
This commit is contained in:
@@ -155,7 +155,7 @@ describe('publish:github', () => {
|
||||
expect(initRepoAndPush).toHaveBeenCalledWith({
|
||||
dir: mockContext.workspacePath,
|
||||
remoteUrl: 'https://github.com/clone/url.git',
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
auth: { username: 'x-access-token', password: 'tokenlols' },
|
||||
logger: mockContext.logger,
|
||||
commitMessage: 'initial commit',
|
||||
|
||||
@@ -491,7 +491,7 @@ describe('publish:github', () => {
|
||||
expect(initRepoAndPush).toHaveBeenCalledWith({
|
||||
dir: mockContext.workspacePath,
|
||||
remoteUrl: 'https://github.com/clone/url.git',
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
auth: { username: 'x-access-token', password: 'tokenlols' },
|
||||
logger: mockContext.logger,
|
||||
commitMessage: 'initial commit',
|
||||
@@ -570,7 +570,7 @@ describe('publish:github', () => {
|
||||
expect(initRepoAndPush).toHaveBeenCalledWith({
|
||||
dir: mockContext.workspacePath,
|
||||
remoteUrl: 'https://github.com/clone/url.git',
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
auth: { username: 'x-access-token', password: 'tokenlols' },
|
||||
logger: mockContext.logger,
|
||||
commitMessage: 'initial commit',
|
||||
@@ -615,7 +615,7 @@ describe('publish:github', () => {
|
||||
expect(initRepoAndPush).toHaveBeenCalledWith({
|
||||
dir: mockContext.workspacePath,
|
||||
remoteUrl: 'https://github.com/clone/url.git',
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
auth: { username: 'x-access-token', password: 'tokenlols' },
|
||||
logger: mockContext.logger,
|
||||
commitMessage: 'Test commit message',
|
||||
@@ -1036,7 +1036,7 @@ describe('publish:github', () => {
|
||||
);
|
||||
expect(mockContext.output).toHaveBeenCalledWith(
|
||||
'repoContentsUrl',
|
||||
'https://github.com/html/url/blob/master',
|
||||
'https://github.com/html/url/blob/main',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1088,7 +1088,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1118,7 +1118,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1147,7 +1147,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1175,7 +1175,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1264,7 +1264,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1295,7 +1295,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1329,7 +1329,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1364,7 +1364,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1400,7 +1400,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1436,7 +1436,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1473,7 +1473,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1503,7 +1503,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: {
|
||||
users: ['user'],
|
||||
@@ -1535,7 +1535,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: {
|
||||
teams: ['team'],
|
||||
@@ -1567,7 +1567,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: {
|
||||
apps: ['app'],
|
||||
@@ -1601,7 +1601,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: {
|
||||
users: ['user'],
|
||||
@@ -1637,7 +1637,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: {
|
||||
users: ['user1', 'user2'],
|
||||
@@ -1724,7 +1724,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1753,7 +1753,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
@@ -1782,7 +1782,7 @@ describe('publish:github', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repo',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
bypassPullRequestAllowances: undefined,
|
||||
requiredApprovingReviewCount: 1,
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ describe('github:repo:push examples', () => {
|
||||
expect(initRepoAndPush).toHaveBeenCalledWith({
|
||||
dir: mockContext.workspacePath,
|
||||
remoteUrl: 'https://github.com/clone/url.git',
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
auth: { username: 'x-access-token', password: 'tokenlols' },
|
||||
logger: mockContext.logger,
|
||||
commitMessage: 'initial commit',
|
||||
|
||||
@@ -117,7 +117,7 @@ describe('github:repo:push', () => {
|
||||
expect(initRepoAndPush).toHaveBeenCalledWith({
|
||||
dir: mockContext.workspacePath,
|
||||
remoteUrl: 'https://github.com/clone/url.git',
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
auth: { username: 'x-access-token', password: 'tokenlols' },
|
||||
logger: mockContext.logger,
|
||||
commitMessage: 'initial commit',
|
||||
@@ -188,7 +188,7 @@ describe('github:repo:push', () => {
|
||||
expect(initRepoAndPush).toHaveBeenCalledWith({
|
||||
dir: mockContext.workspacePath,
|
||||
remoteUrl: 'https://github.com/clone/url.git',
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
auth: { username: 'x-access-token', password: 'tokenlols' },
|
||||
logger: mockContext.logger,
|
||||
commitMessage: 'initial commit',
|
||||
@@ -229,7 +229,7 @@ describe('github:repo:push', () => {
|
||||
expect(initRepoAndPush).toHaveBeenCalledWith({
|
||||
dir: mockContext.workspacePath,
|
||||
remoteUrl: 'https://github.com/clone/url.git',
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
auth: { username: 'x-access-token', password: 'tokenlols' },
|
||||
logger: mockContext.logger,
|
||||
commitMessage: 'initial commit',
|
||||
@@ -253,7 +253,7 @@ describe('github:repo:push', () => {
|
||||
);
|
||||
expect(mockContext.output).toHaveBeenCalledWith(
|
||||
'repoContentsUrl',
|
||||
'https://github.com/html/url/blob/master',
|
||||
'https://github.com/html/url/blob/main',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -298,7 +298,7 @@ describe('github:repo:push', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repository',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
requiredStatusCheckContexts: [],
|
||||
requireBranchesToBeUpToDate: true,
|
||||
@@ -327,7 +327,7 @@ describe('github:repo:push', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repository',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
requiredStatusCheckContexts: ['statusCheck'],
|
||||
requireBranchesToBeUpToDate: true,
|
||||
@@ -356,7 +356,7 @@ describe('github:repo:push', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repository',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
requiredStatusCheckContexts: ['statusCheck'],
|
||||
requireBranchesToBeUpToDate: false,
|
||||
@@ -385,7 +385,7 @@ describe('github:repo:push', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repository',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
requiredStatusCheckContexts: [],
|
||||
requireBranchesToBeUpToDate: true,
|
||||
@@ -484,7 +484,7 @@ describe('github:repo:push', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repository',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
requiredStatusCheckContexts: [],
|
||||
requireBranchesToBeUpToDate: true,
|
||||
@@ -513,7 +513,7 @@ describe('github:repo:push', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repository',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
requiredStatusCheckContexts: [],
|
||||
requireBranchesToBeUpToDate: true,
|
||||
@@ -542,7 +542,7 @@ describe('github:repo:push', () => {
|
||||
client: mockOctokit,
|
||||
repoName: 'repository',
|
||||
logger: mockContext.logger,
|
||||
defaultBranch: 'master',
|
||||
defaultBranch: 'main',
|
||||
requireCodeOwnerReviews: false,
|
||||
requiredStatusCheckContexts: [],
|
||||
requireBranchesToBeUpToDate: true,
|
||||
|
||||
Reference in New Issue
Block a user