@@ -11,6 +11,19 @@ beforeEach(() => {
1111 jest . spyOn ( core , 'setFailed' ) . mockImplementation ( jest . fn ( ) )
1212 jest . spyOn ( core , 'startGroup' ) . mockImplementation ( jest . fn ( ) )
1313 jest . spyOn ( core , 'getBooleanInput' ) . mockReturnValue ( false )
14+ jest . spyOn ( util , 'getBody' ) . mockReturnValue ( `
15+ Bumps [fake/package](https://github.com/) from 0.0.0 to 0.0.1.
16+ <details>
17+ <summary>Release notes</summary>
18+ <blockquote>
19+ <h2>0.0.1</h2>
20+ <h2>Summary</h2>
21+ <p>This is a fake description for a fake update</p>
22+ <h2>What's Changed</h2>
23+ * Nothing
24+ </blockquote>
25+ </details>
26+ ` )
1427} )
1528
1629test ( 'it early exits with an error if github-token is not set' , async ( ) => {
@@ -22,10 +35,10 @@ test('it early exits with an error if github-token is not set', async () => {
2235 expect ( core . setFailed ) . toHaveBeenCalledWith (
2336 expect . stringContaining ( 'github-token is not set!' )
2437 )
25- /* eslint-disable no-unused-expressions */
38+
2639 expect ( dependabotCommits . getMessage ) . not . toHaveBeenCalled
2740 expect ( dependabotCommits . getAlert ) . not . toHaveBeenCalled
28- /* eslint-enable no-unused-expressions */
41+
2942} )
3043
3144test ( 'it does nothing if the PR is not verified as from Dependabot' , async ( ) => {
@@ -40,9 +53,9 @@ test('it does nothing if the PR is not verified as from Dependabot', async () =>
4053 expect ( core . setFailed ) . toHaveBeenCalledWith (
4154 expect . stringContaining ( 'PR is not from Dependabot, nothing to do.' )
4255 )
43- /* eslint-disable no-unused-expressions */
56+
4457 expect ( dependabotCommits . getAlert ) . not . toHaveBeenCalled
45- /* eslint-enable no-unused-expressions */
58+
4659} )
4760
4861test ( 'it does nothing if there is no metadata in the commit' , async ( ) => {
@@ -57,9 +70,9 @@ test('it does nothing if there is no metadata in the commit', async () => {
5770 expect ( core . setFailed ) . toHaveBeenCalledWith (
5871 expect . stringContaining ( 'PR does not contain metadata, nothing to do.' )
5972 )
60- /* eslint-disable no-unused-expressions */
73+
6174 expect ( dependabotCommits . getAlert ) . not . toHaveBeenCalled
62- /* eslint-enable no-unused-expressions */
75+
6376} )
6477
6578test ( 'it sets the updated dependency as an output for subsequent actions when given a commit message for application' , async ( ) => {
@@ -499,9 +512,9 @@ test('it sets the action to failed if there is an unexpected exception', async (
499512 expect ( core . setFailed ) . toHaveBeenCalledWith (
500513 expect . stringContaining ( 'Something bad happened!' )
501514 )
502- /* eslint-disable no-unused-expressions */
515+
503516 expect ( dependabotCommits . getAlert ) . not . toHaveBeenCalled
504- /* eslint-enable no-unused-expressions */
517+
505518} )
506519
507520test ( 'it sets the action to failed if there is a request error' , async ( ) => {
@@ -525,7 +538,7 @@ test('it sets the action to failed if there is a request error', async () => {
525538 expect ( core . setFailed ) . toHaveBeenCalledWith (
526539 expect . stringContaining ( '(500) Something bad happened!' )
527540 )
528- /* eslint-disable no-unused-expressions */
541+
529542 expect ( dependabotCommits . getAlert ) . not . toHaveBeenCalled
530- /* eslint-enable no-unused-expressions */
543+
531544} )
0 commit comments