mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-08 15:59:46 -05:00
Merge branch 'develop' into v5.0-release
This commit is contained in:
Vendored
+4
@@ -2530,6 +2530,10 @@ declare namespace Cypress {
|
||||
* Absolute path to the root of the project
|
||||
*/
|
||||
projectRoot: string
|
||||
/**
|
||||
* Cypress version.
|
||||
*/
|
||||
version: string
|
||||
}
|
||||
|
||||
interface DebugOptions {
|
||||
|
||||
@@ -13,6 +13,7 @@ const pluginConfig2: Cypress.PluginConfig = (on, config) => {
|
||||
config.screenshotsFolder // $ExpectType: string | false
|
||||
config.videoCompression // $ExpectType: number | false
|
||||
config.projectRoot // $ExpectType: string
|
||||
config.version // $ExpectType: string
|
||||
|
||||
on('before:browser:launch', (browser, options) => {
|
||||
browser.displayName // $ExpectType string
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"gulp-rename": "1.4.0",
|
||||
"mocha": "3.5.3",
|
||||
"mock-require": "3.0.3",
|
||||
"rimraf": "2.6.3",
|
||||
"rimraf": "3.0.2",
|
||||
"sinon": "7.3.2",
|
||||
"sinon-chai": "3.3.0",
|
||||
"vinyl-source-stream": "2.0.0",
|
||||
|
||||
@@ -5,6 +5,7 @@ const debug = require('debug')('cypress:server:plugins')
|
||||
const Promise = require('bluebird')
|
||||
const errors = require('../errors')
|
||||
const util = require('./util')
|
||||
const pkg = require('@packages/root')
|
||||
|
||||
let pluginsProcess = null
|
||||
let registeredEvents = {}
|
||||
@@ -87,6 +88,7 @@ const init = (config, options) => {
|
||||
_.extend(config, {
|
||||
projectRoot: options.projectRoot,
|
||||
configFile: options.configFile,
|
||||
version: pkg.version,
|
||||
})
|
||||
|
||||
ipc.send('load', config)
|
||||
|
||||
@@ -92,7 +92,8 @@ const pipesToCommas = (str) => {
|
||||
|
||||
const tryJSONParse = (str) => {
|
||||
try {
|
||||
return JSON.parse(str)
|
||||
// https://github.com/cypress-io/cypress/issues/6891
|
||||
return JSON.parse(str) === Infinity ? null : JSON.parse(str)
|
||||
} catch (err) {
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ const Fixtures = require('../support/helpers/fixtures')
|
||||
const e2eProject = Fixtures.projectPath('e2e')
|
||||
const pluginExtension = Fixtures.projectPath('plugin-extension')
|
||||
const pluginConfig = Fixtures.projectPath('plugin-config')
|
||||
const pluginConfigVersion = Fixtures.projectPath('plugin-config-version')
|
||||
const pluginFilterBrowsers = Fixtures.projectPath('plugin-filter-browsers')
|
||||
const workingPreprocessor = Fixtures.projectPath('working-preprocessor')
|
||||
const pluginsRootAsyncError = Fixtures.projectPath('plugins-root-async-error')
|
||||
@@ -68,6 +69,12 @@ describe('e2e plugins', function () {
|
||||
})
|
||||
})
|
||||
|
||||
it('passes version correctly', function () {
|
||||
return e2e.exec(this, {
|
||||
project: pluginConfigVersion,
|
||||
})
|
||||
})
|
||||
|
||||
it('catches invalid viewportWidth returned from plugins', function () {
|
||||
// the test project returns config object with a bad value
|
||||
return e2e.exec(this, {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
it('test', () => {
|
||||
expect(true).to.eq(true)
|
||||
})
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
const semver = require('semver')
|
||||
|
||||
module.exports = (on, config) => {
|
||||
if (!semver.valid(config.version)) {
|
||||
throw new Error('config.version is invalid')
|
||||
}
|
||||
}
|
||||
@@ -159,6 +159,16 @@ describe('lib/util/args', () => {
|
||||
return snapshot('invalid env error', stripAnsi(err.message))
|
||||
}
|
||||
})
|
||||
|
||||
// https://github.com/cypress-io/cypress/issues/6891
|
||||
it('handles values containing exponential operators', function () {
|
||||
const options = this.setup('--env', 'foo=bar,hash=769e98018')
|
||||
|
||||
expect(options.config.env).to.deep.eq({
|
||||
foo: 'bar',
|
||||
hash: '769e98018',
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
context('--reporterOptions', () => {
|
||||
|
||||
@@ -118,7 +118,7 @@ describe('lib/plugins/child/run_plugins', () => {
|
||||
})
|
||||
|
||||
runPlugins(this.ipc, 'plugins-file', 'proj-root')
|
||||
this.ipc.on.withArgs('load').yield()
|
||||
this.ipc.on.withArgs('load').yield({})
|
||||
|
||||
this.ipc.send = _.once((event, errorType, pluginsFile, stack) => {
|
||||
expect(event).to.eq('load:error')
|
||||
@@ -150,7 +150,7 @@ describe('lib/plugins/child/run_plugins', () => {
|
||||
|
||||
runPlugins(this.ipc, 'plugins-file', 'proj-root')
|
||||
|
||||
return this.ipc.on.withArgs('load').yield()
|
||||
return this.ipc.on.withArgs('load').yield({})
|
||||
})
|
||||
|
||||
context('file:preprocessor', () => {
|
||||
|
||||
@@ -21682,7 +21682,7 @@ rimraf@2.6.3, rimraf@~2.6.2:
|
||||
dependencies:
|
||||
glob "^7.1.3"
|
||||
|
||||
rimraf@^3.0.0, rimraf@^3.0.2:
|
||||
rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
|
||||
integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
|
||||
|
||||
Reference in New Issue
Block a user