-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy pathcontrollers_spec.js
More file actions
38 lines (33 loc) · 1.18 KB
/
controllers_spec.js
File metadata and controls
38 lines (33 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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')
})
})
})