@@ -110,6 +110,52 @@ describe('util', () => {
110110 } ) ,
111111 ) ;
112112 } ) ;
113+ it ( 'falls back to body when body_path is missing' , ( ) => {
114+ assert . equal (
115+ releaseBody ( {
116+ github_ref : '' ,
117+ github_repository : '' ,
118+ github_token : '' ,
119+ input_body : 'fallback-body' ,
120+ input_body_path : '__tests__/does-not-exist.txt' ,
121+ input_draft : false ,
122+ input_prerelease : false ,
123+ input_files : [ ] ,
124+ input_overwrite_files : undefined ,
125+ input_preserve_order : undefined ,
126+ input_name : undefined ,
127+ input_tag_name : undefined ,
128+ input_target_commitish : undefined ,
129+ input_discussion_category_name : undefined ,
130+ input_generate_release_notes : false ,
131+ input_make_latest : undefined ,
132+ } ) ,
133+ 'fallback-body' ,
134+ ) ;
135+ } ) ;
136+ it ( 'returns undefined when body_path is missing and body is not provided' , ( ) => {
137+ assert . equal (
138+ releaseBody ( {
139+ github_ref : '' ,
140+ github_repository : '' ,
141+ github_token : '' ,
142+ input_body : undefined ,
143+ input_body_path : '__tests__/does-not-exist.txt' ,
144+ input_draft : false ,
145+ input_prerelease : false ,
146+ input_files : [ ] ,
147+ input_overwrite_files : undefined ,
148+ input_preserve_order : undefined ,
149+ input_name : undefined ,
150+ input_tag_name : undefined ,
151+ input_target_commitish : undefined ,
152+ input_discussion_category_name : undefined ,
153+ input_generate_release_notes : false ,
154+ input_make_latest : undefined ,
155+ } ) ,
156+ undefined ,
157+ ) ;
158+ } ) ;
113159 } ) ;
114160 describe ( 'parseConfig' , ( ) => {
115161 it ( 'parses basic config' , ( ) => {
0 commit comments