66 commentCreatedWithLabelsPayload ,
77 initNock ,
88 initProbot ,
9- nockCommentCreated ,
9+ nockCreateComment ,
1010 nockCommit ,
1111 nockCommitTreeSha ,
1212 nockConfig ,
@@ -31,7 +31,7 @@ beforeEach(() => {
3131
3232test ( 'creates a branch when a chatops command is given' , async ( ) => {
3333 nockNonExistingBranch ( 'issue-1-Test_issue' )
34- nockExistingBranch ( 'master ' , '12345678' )
34+ nockExistingBranch ( 'main ' , '12345678' )
3535 nockConfig ( 'mode: chatops' )
3636 let createEndpointCalled = false
3737 let body = ''
@@ -58,7 +58,7 @@ test('creates a branch when a chatops command is given', async () => {
5858
5959test ( 'creates a branch when a chatops command is given when issue is created' , async ( ) => {
6060 nockNonExistingBranch ( 'issue-1-Test_issue' )
61- nockExistingBranch ( 'master ' , '12345678' )
61+ nockExistingBranch ( 'main ' , '12345678' )
6262 nockConfig ( 'mode: chatops' )
6363 let createEndpointCalled = false
6464 let body = ''
@@ -85,7 +85,7 @@ test('creates a branch when a chatops command is given when issue is created', a
8585
8686test ( 'creates a branch when mode is immediate and an issue is created' , async ( ) => {
8787 nockNonExistingBranch ( 'issue-1-Test_issue' )
88- nockExistingBranch ( 'master ' , '12345678' )
88+ nockExistingBranch ( 'main ' , '12345678' )
8989 nockConfig ( 'mode: immediate' )
9090 let createEndpointCalled = false
9191
@@ -108,7 +108,7 @@ test('creates a branch when mode is immediate and an issue is created', async ()
108108
109109test ( 'create branch anyway when a chatops command is given and mode is not chatops' , async ( ) => {
110110 nockNonExistingBranch ( 'issue-1-Test_issue' )
111- nockExistingBranch ( 'master ' , '12345678' )
111+ nockExistingBranch ( 'main ' , '12345678' )
112112 nockConfig ( 'mode: auto' )
113113 let createEndpointCalled = false
114114
@@ -131,7 +131,7 @@ test('create branch anyway when a chatops command is given and mode is not chato
131131
132132test ( 'creates a branch when a chatops command is given, no comment' , async ( ) => {
133133 nockNonExistingBranch ( 'issue-1-Test_issue' )
134- nockExistingBranch ( 'master ' , '12345678' )
134+ nockExistingBranch ( 'main ' , '12345678' )
135135 nockConfig ( 'mode: chatops\nsilent: true' )
136136 let createEndpointCalled = false
137137
@@ -149,7 +149,7 @@ test('creates a branch when a chatops command is given, no comment', async () =>
149149
150150test ( 'do not create a branch for issue labels that are configured to be skipped' , async ( ) => {
151151 nockNonExistingBranch ( 'issue-1-Test_issue' )
152- nockExistingBranch ( 'master ' , '12345678' )
152+ nockExistingBranch ( 'main ' , '12345678' )
153153 const ymlConfig = `mode: chatops\nbranches:
154154 - label: question
155155 skip: true`
@@ -188,7 +188,7 @@ test('ignore chatops command if not at start of line', async () => {
188188
189189test ( 'chatops command with title argument' , async ( ) => {
190190 nockNonExistingBranch ( 'issue-1-Simple_NPE_fix' )
191- nockExistingBranch ( 'master ' , '12345678' )
191+ nockExistingBranch ( 'main ' , '12345678' )
192192 nockExistingBranch ( 'issue-1-Test_issue' , '87654321' )
193193 nockConfig ( 'mode: chatops\nexperimental:\n branchNameArgument: true' )
194194 let createEndpointCalled = false
@@ -218,7 +218,7 @@ test('chatops command with title argument', async () => {
218218
219219test ( 'chatops command with title argument and custom branch name' , async ( ) => {
220220 nockNonExistingBranch ( '1-foo-Simple_NPE_fix' )
221- nockExistingBranch ( 'master ' , '12345678' )
221+ nockExistingBranch ( 'main ' , '12345678' )
222222 nockExistingBranch ( 'issue-1-Test_issue' , '87654321' )
223223 nockConfig ( // eslint-disable-next-line no-template-curly-in-string
224224 'branchName: \'${issue.number}-foo-${issue.title}\'\nmode: chatops\nexperimental:\n branchNameArgument: true' )
@@ -269,11 +269,11 @@ test('warn about existing branches', async () => {
269269
270270test ( 'open a pull request when a chatops command is given' , async ( ) => {
271271 nockNonExistingBranch ( 'issue-1-Test_issue' )
272- nockExistingBranch ( 'master ' , '12345678' )
273- nockExistingBranch ( 'master ' , '12345678' )
272+ nockExistingBranch ( 'main ' , '12345678' )
273+ nockExistingBranch ( 'main ' , '12345678' )
274274 nockConfig ( 'mode: chatops\nopenPR: true' )
275275 nockCreateBranch ( )
276- nockCommentCreated ( )
276+ nockCreateComment ( )
277277 nockExistingBranch ( 'issue-1-Test_issue' , '87654321' )
278278 nockCommitTreeSha ( '87654321' , '12344321' )
279279 nockCommit ( )
@@ -285,7 +285,7 @@ test('open a pull request when a chatops command is given', async () => {
285285
286286test ( 'open a pull request but do not create a branch for issue with release label' , async ( ) => {
287287 nockNonExistingBranch ( 'issue-1-Test_issue' )
288- nockExistingBranch ( 'master ' , '12345678' )
288+ nockExistingBranch ( 'main ' , '12345678' )
289289 nockExistingBranch ( 'release' , '98765432' )
290290 let config = ''
291291 config += 'mode: chatops\n'
@@ -296,7 +296,7 @@ test('open a pull request but do not create a branch for issue with release labe
296296 config += ' prTarget: release\n'
297297 config += ' skipBranch: true\n'
298298 nockConfig ( config )
299- nockCommentCreated ( )
299+ nockCreateComment ( )
300300 nockExistingBranch ( 'develop' , '87654321' )
301301 nockCommitTreeSha ( '87654321' , '12344321' )
302302 nockCommit ( )
@@ -308,8 +308,8 @@ test('open a pull request but do not create a branch for issue with release labe
308308
309309test ( 'open a pull request, copy labels and assignee from issue' , async ( ) => {
310310 nockNonExistingBranch ( 'issue-1-Test_issue' )
311- nockExistingBranch ( 'master ' , '12345678' )
312- nockExistingBranch ( 'master ' , '12345678' )
311+ nockExistingBranch ( 'main ' , '12345678' )
312+ nockExistingBranch ( 'main ' , '12345678' )
313313 nockConfig ( `
314314 mode: chatops
315315 openPR: true
@@ -330,9 +330,9 @@ test('open a pull request, copy labels and assignee from issue', async () => {
330330
331331test ( 'do not open a pull request when the branch already exists' , async ( ) => {
332332 nockExistingBranch ( 'issue-1-Test_issue' , '87654321' )
333- nockExistingBranch ( 'master ' , '12345678' )
333+ nockExistingBranch ( 'main ' , '12345678' )
334334 nockConfig ( 'mode: chatops\nopenPR: true' )
335- nockCommentCreated ( )
335+ nockCreateComment ( )
336336
337337 await probot . receive ( { id : '' , name : 'issue_comment' , payload : commentCreatedPayload as any } )
338338} )
0 commit comments