Merge branch 'develop' into v6.0-release

This commit is contained in:
Jennifer Shehane
2020-10-30 13:02:17 +06:30
committed by GitHub
32 changed files with 919 additions and 555 deletions
+14 -10
View File
@@ -35,7 +35,7 @@ exports['shows help for open --foo 1'] = `
-P, --project <project-path> path to the project
--dev runs cypress in development and bypasses
binary check
-h, --help output usage information
-h, --help display help for command
-------
stderr:
-------
@@ -82,7 +82,7 @@ exports['shows help for run --foo 1'] = `
-s, --spec <spec> runs specific spec file(s). defaults to "all"
-t, --tag <tag> named tag(s) for recorded runs in the Cypress Dashboard
--dev runs cypress in development and bypasses binary check
-h, --help output usage information
-h, --help display help for command
-------
stderr:
-------
@@ -116,7 +116,7 @@ exports['cli unknown option shows help for cache command - unknown option --foo
use
--size Used with the list command to show the sizes of the cached
folders
-h, --help output usage information
-h, --help display help for command
-------
stderr:
-------
@@ -150,7 +150,7 @@ exports['cli unknown option shows help for cache command - unknown sub-command f
use
--size Used with the list command to show the sizes of the cached
folders
-h, --help output usage information
-h, --help display help for command
-------
stderr:
-------
@@ -182,7 +182,7 @@ exports['cli unknown option shows help for cache command - no sub-command 1'] =
use
--size Used with the list command to show the sizes of the cached
folders
-h, --help output usage information
-h, --help display help for command
-------
stderr:
-------
@@ -206,7 +206,7 @@ exports['cli help command shows help 1'] = `
Options:
-v, --version prints Cypress version
-h, --help output usage information
-h, --help display help for command
Commands:
help Shows CLI help and exits
@@ -242,7 +242,7 @@ exports['cli help command shows help for -h 1'] = `
Options:
-v, --version prints Cypress version
-h, --help output usage information
-h, --help display help for command
Commands:
help Shows CLI help and exits
@@ -278,7 +278,7 @@ exports['cli help command shows help for --help 1'] = `
Options:
-v, --version prints Cypress version
-h, --help output usage information
-h, --help display help for command
Commands:
help Shows CLI help and exits
@@ -315,7 +315,7 @@ exports['cli unknown command shows usage and exits 1'] = `
Options:
-v, --version prints Cypress version
-h, --help output usage information
-h, --help display help for command
Commands:
help Shows CLI help and exits
@@ -421,7 +421,7 @@ exports['cli CYPRESS_INTERNAL_ENV allows and warns when staging environment 1']
Options:
-v, --version prints Cypress version
-h, --help output usage information
-h, --help display help for command
Commands:
help Shows CLI help and exits
@@ -451,3 +451,7 @@ exports['cli version and binary version with npm log warn'] = `
Cypress package version: 1.2.3
Cypress binary version: X.Y.Z
`
exports['prints explanation when no cache'] = `
No cached binary versions were found.
`
+7 -1
View File
@@ -408,8 +408,14 @@ module.exports = {
size: opts.size,
})
return cache.list(opts.size).catch((e) => {
return cache.list(opts.size)
.catch({ code: 'ENOENT' }, () => {
logger.always('No cached binary versions were found.')
process.exit(0)
})
.catch((e) => {
debug('cache list command failed with "%s"', e.message)
util.logErrorExit1(e)
})
}
+1 -1
View File
@@ -32,7 +32,7 @@
"chalk": "^4.1.0",
"check-more-types": "^2.24.0",
"cli-table3": "~0.6.0",
"commander": "^4.1.1",
"commander": "^5.1.0",
"common-tags": "^1.8.0",
"debug": "^4.1.1",
"eventemitter2": "^6.4.2",
+14
View File
@@ -513,6 +513,20 @@ describe('cli', () => {
})
context('cypress cache list', () => {
it('prints explanation when no cache', (done) => {
const err = new Error()
err.code = 'ENOENT'
sinon.stub(cache, 'list').rejects(err)
this.exec('cache list')
process.exit.callsFake(() => {
snapshot('prints explanation when no cache', logger.print())
done()
})
})
it('catches rejection and exits', (done) => {
const err = new Error('cache list failed badly')
+1 -1
View File
@@ -1766,7 +1766,7 @@ declare namespace Cypress {
*
* @see https://on.cypress.io/task
*/
task(event: string, arg?: any, options?: Partial<Loggable & Timeoutable>): Chainable<Subject>
task<S = unknown>(event: string, arg?: any, options?: Partial<Loggable & Timeoutable>): Chainable<S>
/**
* Enables you to work with the subject yielded from the previous command.
+12
View File
@@ -608,3 +608,15 @@ namespace CypressShadowTests {
.get('.foo')
.find('.bar', {includeShadowDom: true})
}
namespace CypressTaskTests {
cy.task<number>('foo') // $ExpectType Chainable<number>
cy.task<number>('foo').then((val) => {
val // $ExpectType number
})
cy.task('foo') // $ExpectType Chainable<unknown>
cy.task('foo').then((val) => {
val // $ExpectType unknown
})
}