@@ -122,6 +122,52 @@ describe('util', () => {
122122 } ) ,
123123 ) ;
124124 } ) ;
125+ it ( 'falls back to body when body_path is missing' , ( ) => {
126+ assert . equal (
127+ releaseBody ( {
128+ github_ref : '' ,
129+ github_repository : '' ,
130+ github_token : '' ,
131+ input_body : 'fallback-body' ,
132+ input_body_path : '__tests__/does-not-exist.txt' ,
133+ input_draft : false ,
134+ input_prerelease : false ,
135+ input_files : [ ] ,
136+ input_overwrite_files : undefined ,
137+ input_preserve_order : undefined ,
138+ input_name : undefined ,
139+ input_tag_name : undefined ,
140+ input_target_commitish : undefined ,
141+ input_discussion_category_name : undefined ,
142+ input_generate_release_notes : false ,
143+ input_make_latest : undefined ,
144+ } ) ,
145+ 'fallback-body' ,
146+ ) ;
147+ } ) ;
148+ it ( 'returns undefined when body_path is missing and body is not provided' , ( ) => {
149+ assert . equal (
150+ releaseBody ( {
151+ github_ref : '' ,
152+ github_repository : '' ,
153+ github_token : '' ,
154+ input_body : undefined ,
155+ input_body_path : '__tests__/does-not-exist.txt' ,
156+ input_draft : false ,
157+ input_prerelease : false ,
158+ input_files : [ ] ,
159+ input_overwrite_files : undefined ,
160+ input_preserve_order : undefined ,
161+ input_name : undefined ,
162+ input_tag_name : undefined ,
163+ input_target_commitish : undefined ,
164+ input_discussion_category_name : undefined ,
165+ input_generate_release_notes : false ,
166+ input_make_latest : undefined ,
167+ } ) ,
168+ undefined ,
169+ ) ;
170+ } ) ;
125171 } ) ;
126172 describe ( 'parseConfig' , ( ) => {
127173 it ( 'parses basic config' , ( ) => {
0 commit comments