-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: print bundled Node and Electron versions in
cypress version
(#…
- Loading branch information
Showing
18 changed files
with
266 additions
and
62 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
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
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
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 |
---|---|---|
@@ -1,35 +1,69 @@ | ||
const { expect } = require('chai') | ||
|
||
require('../../spec_helper') | ||
|
||
const util = require(`${lib}/util`) | ||
const state = require(`${lib}/tasks/state`) | ||
const versions = require(`${lib}/exec/versions`) | ||
|
||
describe('lib/exec/versions', function () { | ||
const binaryDir = '/cache/1.2.3/Cypress.app' | ||
|
||
beforeEach(function () { | ||
sinon.stub(state, 'getBinaryDir').returns('/cache/1.2.3/Cypress.app') | ||
sinon.stub(state, 'getBinaryPkgVersionAsync').withArgs('/cache/1.2.3/Cypress.app').resolves('1.2.3') | ||
sinon.stub(state, 'getBinaryDir').returns(binaryDir) | ||
sinon.stub(state, 'getBinaryPkgAsync').withArgs(binaryDir).resolves({ | ||
version: '1.2.3', | ||
electronVersion: '10.1.2', | ||
electronNodeVersion: '12.16.3', | ||
}) | ||
|
||
sinon.stub(util, 'pkgVersion').returns('4.5.6') | ||
}) | ||
|
||
describe('.getVersions', function () { | ||
it('gets the correct binary and package version', function () { | ||
return versions.getVersions().then(({ package, binary }) => { | ||
expect(package).to.eql('4.5.6') | ||
expect(binary).to.eql('1.2.3') | ||
expect(package, 'package version').to.eql('4.5.6') | ||
expect(binary, 'binary version').to.eql('1.2.3') | ||
}) | ||
}) | ||
|
||
it('gets the correct Electron and bundled Node version', function () { | ||
return versions.getVersions().then(({ electronVersion, electronNodeVersion }) => { | ||
expect(electronVersion, 'electron version').to.eql('10.1.2') | ||
expect(electronNodeVersion, 'node version').to.eql('12.16.3') | ||
}) | ||
}) | ||
|
||
it('gets correct binary version if CYPRESS_RUN_BINARY', function () { | ||
sinon.stub(state, 'parseRealPlatformBinaryFolderAsync').resolves('/my/cypress/path') | ||
process.env.CYPRESS_RUN_BINARY = '/my/cypress/path' | ||
state.getBinaryPkgVersionAsync | ||
state.getBinaryPkgAsync | ||
.withArgs('/my/cypress/path') | ||
.resolves('7.8.9') | ||
.resolves({ | ||
version: '7.8.9', | ||
}) | ||
|
||
return versions.getVersions().then(({ package, binary }) => { | ||
expect(package).to.eql('4.5.6') | ||
expect(binary).to.eql('7.8.9') | ||
}) | ||
}) | ||
|
||
it('reports default versions if not found', function () { | ||
// imagine package.json only has version there | ||
state.getBinaryPkgAsync.withArgs(binaryDir).resolves({ | ||
version: '90.9.9', | ||
}) | ||
|
||
return versions.getVersions().then((versions) => { | ||
expect(versions).to.deep.equal({ | ||
'package': '4.5.6', | ||
'binary': '90.9.9', | ||
'electronVersion': 'not found', | ||
'electronNodeVersion': 'not found', | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.
84d1afd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
84d1afd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AppVeyor has built the
win32 ia32
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
84d1afd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AppVeyor has built the
win32 x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally: