Files
cypress/system-tests/test/controllers_spec.js
Lachlan Miller abea165832 fix: do not include non specs when globbing using --spec in run mode (#21462)
* fix: do not include non specs when globbing using --spec in run mode

* update pattern

* fix test

* update cdp spec

* wip - updates

* update snapshots

* update non-proxied spec

* update snaps

* update snaps

* rename specs

* update spec

* wip - snapshots

* snaps

* snaps

* update spec names

* update

* update test

* snaps

* update snap and spec

* snaps

* correct spec pattern

* snaps

* revert

* update spec and snapshots

* fix test

* update tests

* fix test

* update test

* update snapshot

* update snaps

* include coffee in specPattern

* update snapshots

* update snaps

* rename specs

* snaps

* update test

* update snapshot

* update

* snaps

* update snap

* update snaps

* fix test

* unskip test

* snaps

* add test
2022-05-17 18:11:42 +10:00

39 lines
1.2 KiB
JavaScript

const fs = require('fs-extra')
const path = require('path')
const systemTests = require('../lib/system-tests').default
const Fixtures = require('../lib/fixtures')
describe('e2e plugins', () => {
systemTests.setup()
it('fails when spec does not exist', function () {
return systemTests.exec(this, {
spec: 'spec.cy.js',
project: 'non-existent-spec',
sanitizeScreenshotDimensions: true,
snapshot: true,
expectedExitCode: 1,
})
})
it('handles specs with $, &, and + in file name', function () {
const relativeSpecPath = path.join('dir&1%', '%dir2&', 's%p+ec&.js')
const e2eProject = Fixtures.projectPath('e2e')
const specPath = path.join(e2eProject, 'cypress', 'e2e', relativeSpecPath)
return fs.outputFile(specPath, 'it(\'passes\', () => {})')
.then(() => {
return systemTests.exec(this, {
spec: specPath,
sanitizeScreenshotDimensions: true,
snapshot: true,
})
}).then(({ stdout }) => {
expect(stdout).to.include('1 found (s%p+ec&.js)')
expect(stdout).to.include('Searched: cypress/e2e/dir&1%/%dir2&/s%p+ec&.js')
expect(stdout).to.include('Running: s%p+ec&.js')
})
})
})