mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-30 12:01:06 -05:00
feat(component-testing): Expose CT through CLI module API (#16368)
* Added testingType CLI module option * Removed isComponentTesting custom arg and replaced with testingType * Added default value to docstring * Removed mutating of args * Added Module API manual testing docs
This commit is contained in:
@@ -122,5 +122,27 @@ describe('exec open', function () {
|
||||
expect(spawn.start).to.be.calledWith([])
|
||||
})
|
||||
})
|
||||
|
||||
it('spawns without --testing-type when not specified', () => {
|
||||
return open.start().then(() => {
|
||||
expect(spawn.start).to.be.calledWith([])
|
||||
})
|
||||
})
|
||||
|
||||
it('spawns with --testing-type e2e', () => {
|
||||
return open.start({ testingType: 'e2e' }).then(() => {
|
||||
expect(spawn.start).to.be.calledWith(['--testing-type', 'e2e'])
|
||||
})
|
||||
})
|
||||
|
||||
it('spawns with --testing-type component', () => {
|
||||
return open.start({ testingType: 'component' }).then(() => {
|
||||
expect(spawn.start).to.be.calledWith(['--testing-type', 'component'])
|
||||
})
|
||||
})
|
||||
|
||||
it('throws if --testing-type is invalid', () => {
|
||||
expect(() => open.start({ testingType: 'randomTestingType' })).to.throw()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -82,6 +82,28 @@ describe('exec run', function () {
|
||||
|
||||
snapshot(args)
|
||||
})
|
||||
|
||||
it('defaults to e2e testingType', () => {
|
||||
const args = run.processRunOptions()
|
||||
|
||||
snapshot(args)
|
||||
})
|
||||
|
||||
it('passes e2e testingType', () => {
|
||||
expect(run.processRunOptions({ testingType: 'e2e' })).to.deep.eq([
|
||||
'--run-project', undefined, '--testing-type', 'e2e',
|
||||
])
|
||||
})
|
||||
|
||||
it('passes component testingType', () => {
|
||||
expect(run.processRunOptions({ testingType: 'component' })).to.deep.eq([
|
||||
'--run-project', undefined, '--testing-type', 'component',
|
||||
])
|
||||
})
|
||||
|
||||
it('throws if testingType is invalid', () => {
|
||||
expect(() => run.processRunOptions({ testingType: 'randomTestingType' })).to.throw()
|
||||
})
|
||||
})
|
||||
|
||||
context('.start', function () {
|
||||
|
||||
Reference in New Issue
Block a user