File tree 2 files changed +27
-1
lines changed
2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,9 @@ export default class MakerZIP extends MakerBase<MakerZIPConfig> {
48
48
if ( targetPlatform === 'darwin' && this . config . macUpdateManifestBaseUrl ) {
49
49
const parsed = new URL ( this . config . macUpdateManifestBaseUrl ) ;
50
50
parsed . pathname += '/RELEASES.json' ;
51
- const response = await got . get ( parsed . toString ( ) ) ;
51
+ const response = await got . get ( parsed . toString ( ) , {
52
+ throwHttpErrors : false ,
53
+ } ) ;
52
54
let currentValue : SquirrelMacReleases = {
53
55
currentRelease : '' ,
54
56
releases : [ ] ,
Original file line number Diff line number Diff line change @@ -143,6 +143,30 @@ describe('MakerZip', () => {
143
143
expect ( foo . releases [ 0 ] . updateTo ) . to . have . property ( 'url' ) ;
144
144
} ) ;
145
145
146
+ it ( 'should generate a valid RELEASES.json manifest with no current file' , async ( ) => {
147
+ maker . config = {
148
+ macUpdateManifestBaseUrl : 'fake://test/foo' ,
149
+ } ;
150
+ getStub . returns ( Promise . resolve ( { statusCode : 404 , body : 'GARBAGE' } ) ) ;
151
+ const output = await maker . make ( {
152
+ dir : darwinDir ,
153
+ makeDir,
154
+ appName,
155
+ targetArch,
156
+ targetPlatform : 'darwin' ,
157
+ packageJSON,
158
+ forgeConfig : null as any ,
159
+ } ) ;
160
+
161
+ const foo = await fs . readJson ( output [ 1 ] ) ;
162
+ expect ( foo ) . to . have . property ( 'currentRelease' , '1.2.3' ) ;
163
+ expect ( foo ) . to . have . property ( 'releases' ) ;
164
+ expect ( foo . releases ) . to . be . an ( 'array' ) . with . lengthOf ( 1 ) ;
165
+ expect ( foo . releases [ 0 ] ) . to . have . property ( 'version' ) ;
166
+ expect ( foo . releases [ 0 ] ) . to . have . property ( 'updateTo' ) ;
167
+ expect ( foo . releases [ 0 ] . updateTo ) . to . have . property ( 'url' ) ;
168
+ } ) ;
169
+
146
170
it ( 'should extend the current RELEASES.json manifest if it exists' , async ( ) => {
147
171
maker . config = {
148
172
macUpdateManifestBaseUrl : 'fake://test/foo' ,
You can’t perform that action at this time.
0 commit comments