mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-13 18:50:18 -06:00
server: send current version of cypress when checking for updates, fixes #456
This commit is contained in:
@@ -40,6 +40,7 @@ NwUpdater.prototype.checkNewVersion = (cb) ->
|
||||
request.get({
|
||||
url: @manifest.manifestUrl,
|
||||
headers: {
|
||||
"x-cypress-version": pkg.version
|
||||
"x-machine-id": id
|
||||
}
|
||||
}, gotManifest.bind(@))
|
||||
|
||||
@@ -47,6 +47,15 @@ describe "lib/updater", ->
|
||||
|
||||
@updater = Updater({})
|
||||
|
||||
it "sends x-cypress-version", (done) ->
|
||||
@updater.getClient().checkNewVersion =>
|
||||
expect(@get).to.be.calledWithMatch({
|
||||
headers: {
|
||||
"x-cypress-version": pkg.version
|
||||
}
|
||||
})
|
||||
done()
|
||||
|
||||
it "sends x-machine-id", (done) ->
|
||||
nmi.machineId()
|
||||
.then (id) =>
|
||||
@@ -57,7 +66,6 @@ describe "lib/updater", ->
|
||||
}
|
||||
})
|
||||
done()
|
||||
return
|
||||
|
||||
it "sends x-machine-id as null on error", (done) ->
|
||||
@sandbox.stub(nmi, "machineId").rejects(new Error())
|
||||
@@ -70,7 +78,6 @@ describe "lib/updater", ->
|
||||
})
|
||||
|
||||
done()
|
||||
return
|
||||
|
||||
context "#check", ->
|
||||
beforeEach ->
|
||||
|
||||
Reference in New Issue
Block a user