mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-01 12:30:01 -05:00
@@ -1,3 +1,108 @@
|
||||
exports['cli help command shows help 1'] = `
|
||||
|
||||
command: bin/cypress help
|
||||
code: 0
|
||||
failed: false
|
||||
killed: false
|
||||
signal: null
|
||||
timedOut: false
|
||||
|
||||
stdout:
|
||||
-------
|
||||
Usage: cypress [options] [command]
|
||||
|
||||
|
||||
Commands:
|
||||
|
||||
help Shows CLI help and exits
|
||||
version Prints Cypress version
|
||||
run [options] Runs Cypress tests from the CLI without the GUI
|
||||
open [options] Opens Cypress in the interactive GUI.
|
||||
install Installs the Cypress executable matching this package's version
|
||||
verify Verifies that Cypress is installed correctly and executable
|
||||
|
||||
Options:
|
||||
|
||||
-h, --help output usage information
|
||||
-v, --version Prints Cypress version
|
||||
-------
|
||||
stderr:
|
||||
-------
|
||||
|
||||
-------
|
||||
|
||||
`
|
||||
|
||||
exports['cli help command shows help for -h 1'] = `
|
||||
|
||||
command: bin/cypress -h
|
||||
code: 0
|
||||
failed: false
|
||||
killed: false
|
||||
signal: null
|
||||
timedOut: false
|
||||
|
||||
stdout:
|
||||
-------
|
||||
Usage: cypress [options] [command]
|
||||
|
||||
|
||||
Commands:
|
||||
|
||||
help Shows CLI help and exits
|
||||
version Prints Cypress version
|
||||
run [options] Runs Cypress tests from the CLI without the GUI
|
||||
open [options] Opens Cypress in the interactive GUI.
|
||||
install Installs the Cypress executable matching this package's version
|
||||
verify Verifies that Cypress is installed correctly and executable
|
||||
|
||||
Options:
|
||||
|
||||
-h, --help output usage information
|
||||
-v, --version Prints Cypress version
|
||||
-------
|
||||
stderr:
|
||||
-------
|
||||
|
||||
-------
|
||||
|
||||
`
|
||||
|
||||
exports['cli help command shows help for --help 1'] = `
|
||||
|
||||
command: bin/cypress --help
|
||||
code: 0
|
||||
failed: false
|
||||
killed: false
|
||||
signal: null
|
||||
timedOut: false
|
||||
|
||||
stdout:
|
||||
-------
|
||||
Usage: cypress [options] [command]
|
||||
|
||||
|
||||
Commands:
|
||||
|
||||
help Shows CLI help and exits
|
||||
version Prints Cypress version
|
||||
run [options] Runs Cypress tests from the CLI without the GUI
|
||||
open [options] Opens Cypress in the interactive GUI.
|
||||
install Installs the Cypress executable matching this package's version
|
||||
verify Verifies that Cypress is installed correctly and executable
|
||||
|
||||
Options:
|
||||
|
||||
-h, --help output usage information
|
||||
-v, --version Prints Cypress version
|
||||
-------
|
||||
stderr:
|
||||
-------
|
||||
|
||||
-------
|
||||
|
||||
`
|
||||
|
||||
exports['cli unknown command shows usage and exits 1'] = `
|
||||
|
||||
command: bin/cypress foo
|
||||
@@ -16,6 +121,7 @@ exports['cli unknown command shows usage and exits 1'] = `
|
||||
|
||||
Commands:
|
||||
|
||||
help Shows CLI help and exits
|
||||
version Prints Cypress version
|
||||
run [options] Runs Cypress tests from the CLI without the GUI
|
||||
open [options] Opens Cypress in the interactive GUI.
|
||||
|
||||
+8
-1
@@ -29,7 +29,7 @@ const descriptions = {
|
||||
version: 'Prints Cypress version',
|
||||
}
|
||||
|
||||
const knownCommands = ['version', 'run', 'open', 'install', 'verify', '-v', '--version']
|
||||
const knownCommands = ['version', 'run', 'open', 'install', 'verify', '-v', '--version', 'help', '-h', '--help']
|
||||
|
||||
const text = (description) => {
|
||||
if (!descriptions[description]) {
|
||||
@@ -51,6 +51,13 @@ module.exports = {
|
||||
// in usage help docs
|
||||
program._name = 'cypress'
|
||||
|
||||
program
|
||||
.command('help')
|
||||
.description('Shows CLI help and exits')
|
||||
.action(() => {
|
||||
program.help()
|
||||
})
|
||||
|
||||
program
|
||||
.option('-v, --version', text('version'))
|
||||
.command('version')
|
||||
|
||||
@@ -20,6 +20,20 @@ describe('cli', function () {
|
||||
this.exec = (args) => cli.init(`node test ${args}`.split(' '))
|
||||
})
|
||||
|
||||
context('help command', () => {
|
||||
it('shows help', () =>
|
||||
execa('bin/cypress', ['help']).then(snapshot)
|
||||
)
|
||||
|
||||
it('shows help for -h', () =>
|
||||
execa('bin/cypress', ['-h']).then(snapshot)
|
||||
)
|
||||
|
||||
it('shows help for --help', () =>
|
||||
execa('bin/cypress', ['--help']).then(snapshot)
|
||||
)
|
||||
})
|
||||
|
||||
context('unknown command', () => {
|
||||
it('shows usage and exits', () =>
|
||||
execa('bin/cypress', ['foo']).then(snapshot)
|
||||
|
||||
Reference in New Issue
Block a user