server: send current version of cypress when checking for updates, fixes #456

This commit is contained in:
Brian Mann
2017-09-16 14:53:36 -04:00
parent baccde14a8
commit 49ddf5e28c
2 changed files with 10 additions and 2 deletions

View File

@@ -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(@))

View File

@@ -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 ->