forked from nylas/nylas-mail
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(update): autoupdater adds an
updateLevel
param
Summary: There's now an `updateLevel` that can be set in the config file. It has the valid values of "major", "minor", "patch", and "commit". By default it upgrades on the "patch" level. If you want to be on the bleeding edge, manually change the config file to add `updateLevel: 'commit'` Test Plan: A new `auto-update-manager-spec` :) Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D1567
- Loading branch information
Showing
7 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
"calendar-bar", | ||
"salesforce" | ||
] | ||
'updateLevel': 'patch' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
AutoUpdateManager = require '../src/browser/auto-update-manager' | ||
|
||
describe "AutoUpdateManager", -> | ||
c1 = get: -> | ||
c2 = get: -> "major" | ||
c3 = get: -> "minor" | ||
c4 = get: -> "patch" | ||
c5 = get: -> "commit" | ||
c6 = get: -> "foo" | ||
|
||
base = "https://edgehill.nylas.com/update-check?version=" | ||
|
||
beforeEach -> | ||
@feedUrl = (version, config) -> | ||
m = new AutoUpdateManager(version, config) | ||
spyOn(m, "setupAutoUpdater") | ||
return m.feedUrl | ||
|
||
describe "with attached commit version", -> | ||
beforeEach -> | ||
@v = "3.222.1-abc" | ||
|
||
it "correctly sets the feedURL", -> | ||
expect(@feedUrl(@v, c1)).toBe "#{base}3.222.1-abc&level=patch" | ||
expect(@feedUrl(@v, c2)).toBe "#{base}3.222.1-abc&level=major" | ||
expect(@feedUrl(@v, c3)).toBe "#{base}3.222.1-abc&level=minor" | ||
expect(@feedUrl(@v, c4)).toBe "#{base}3.222.1-abc&level=patch" | ||
expect(@feedUrl(@v, c5)).toBe "#{base}3.222.1-abc&level=commit" | ||
expect(@feedUrl(@v, c6)).toBe "#{base}3.222.1-abc&level=patch" | ||
|
||
describe "with no attached commit", -> | ||
beforeEach -> | ||
@v = "3.222.1" | ||
|
||
it "correctly sets the feedURL", -> | ||
expect(@feedUrl(@v, c1)).toBe "#{base}3.222.1&level=patch" | ||
expect(@feedUrl(@v, c2)).toBe "#{base}3.222.1&level=major" | ||
expect(@feedUrl(@v, c3)).toBe "#{base}3.222.1&level=minor" | ||
expect(@feedUrl(@v, c4)).toBe "#{base}3.222.1&level=patch" | ||
expect(@feedUrl(@v, c5)).toBe "#{base}3.222.1&level=commit" | ||
expect(@feedUrl(@v, c6)).toBe "#{base}3.222.1&level=patch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters