@@ -6,6 +6,7 @@ const changesetBot = require('.');
6
6
7
7
const pullRequestOpen = require ( './test/fixtures/pull_request.opened' ) ;
8
8
const pullRequestSynchronize = require ( './test/fixtures/pull_request.synchronize' ) ;
9
+ const releasePullRequestOpen = require ( './test/fixtures/release_pull_request.opened' ) ;
9
10
10
11
nock . disableNetConnect ( ) ;
11
12
@@ -102,11 +103,11 @@ describe('changeset-bot', () => {
102
103
. post ( '/repos/pyu/testing-things/issues/1/comments' , ( { body } ) => {
103
104
expect ( body ) . toEqual ( outdent `
104
105
### 🦋 Changeset is good to go
105
-
106
+
106
107
Latest commit: ABCDE
107
-
108
+
108
109
**We got this.**
109
-
110
+
110
111
Not sure what this means? [Click here to learn what changesets are](https://github.com/Noviny/changesets/blob/master/docs/adding-a-changeset.md).` ) ;
111
112
return true ;
112
113
} )
@@ -137,11 +138,11 @@ describe('changeset-bot', () => {
137
138
### 💥 No Changeset
138
139
139
140
Latest commit: ABCDE
140
-
141
+
141
142
Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂
142
-
143
+
143
144
**If these changes should be published to npm, you need to add a changeset.**
144
-
145
+
145
146
[Click here to learn what changesets are, and how to add one](https://github.com/Noviny/changesets/blob/master/docs/adding-a-changeset.md).` ) ;
146
147
return true ;
147
148
} )
@@ -152,4 +153,17 @@ describe('changeset-bot', () => {
152
153
payload : pullRequestOpen ,
153
154
} ) ;
154
155
} ) ;
156
+
157
+ it ( "shouldn't add a comment to a release pull request" , async ( ) => {
158
+ nock ( 'https://api.github.com' )
159
+ . reply ( ( ) => {
160
+ // shouldn't reach this, but if it does - let it fail
161
+ expect ( true ) . toBe ( false )
162
+ } ) ;
163
+
164
+ await probot . receive ( {
165
+ name : 'pull_request' ,
166
+ payload : releasePullRequestOpen ,
167
+ } ) ;
168
+ } ) ;
155
169
} ) ;
0 commit comments