diff --git a/packages/publisher/electron-release-server/src/PublisherERS.ts b/packages/publisher/electron-release-server/src/PublisherERS.ts index 085b6c74dd..ba991a44f0 100644 --- a/packages/publisher/electron-release-server/src/PublisherERS.ts +++ b/packages/publisher/electron-release-server/src/PublisherERS.ts @@ -81,7 +81,7 @@ export default class PublisherERS extends PublisherBase { const artifacts = makeResult.artifacts.filter((artifactPath) => path.basename(artifactPath).toLowerCase() !== 'releases'); const existingVersion = versions.find((version) => { - version.name === packageJSON.version && (!version.flavor || version.flavor === flavor); + return version.name === packageJSON.version && (!version.flavor || version.flavor === flavor); }); let channel = 'stable'; diff --git a/packages/publisher/electron-release-server/test/PublisherERS_spec.ts b/packages/publisher/electron-release-server/test/PublisherERS_spec.ts index 95852b059f..e3e6b6d1b6 100644 --- a/packages/publisher/electron-release-server/test/PublisherERS_spec.ts +++ b/packages/publisher/electron-release-server/test/PublisherERS_spec.ts @@ -20,7 +20,7 @@ describe('PublisherERS', () => { // mock login fetch.postOnce('path:/api/auth/login', { body: { token }, status: 200 }); // mock fetch all existing versions - fetch.getOnce('path:/api/version', { body: [{ name: '2.0.0', assets: [] }], status: 200 }); + fetch.getOnce('path:/api/version', { body: [{ name: '2.0.0', assets: [], flavor: 'default' }], status: 200 }); // mock creating a new version fetch.postOnce('path:/api/version', { status: 200 }); // mock asset upload @@ -115,7 +115,7 @@ describe('PublisherERS', () => { // mock login fetch.postOnce('path:/api/auth/login', { body: { token }, status: 200 }); // mock fetch all existing versions - fetch.getOnce('path:/api/version', { body: [{ name: '2.0.0', assets: [{ name: 'existing-artifact' }] }], status: 200 }); + fetch.getOnce('path:/api/version', { body: [{ name: '2.0.0', assets: [{ name: 'existing-artifact' }], flavor: 'default' }], status: 200 }); const PublisherERS = proxyquire.noCallThru().load('../src/PublisherERS', { 'node-fetch': fetch,