forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror_ui_spec.ts
49 lines (42 loc) · 1.47 KB
/
error_ui_spec.ts
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
39
40
41
42
43
44
45
46
47
48
49
import systemTests, { expect } from '../lib/system-tests'
import Fixtures from '../lib/fixtures'
const verifyPassedAndFailedAreSame = (expectedFailures) => {
return ({ stdout }) => {
const passes = stdout.match(/✓ ✓ VERIFY/g)
expect(passes?.length || 0, 'number of passes should equal the number of failures').to.equal(expectedFailures)
}
}
describe('e2e error ui', function () {
systemTests.setup()
beforeEach(async () => {
await Fixtures.scaffoldProject('e2e')
})
;[
'webpack-preprocessor',
'webpack-preprocessor-ts-loader',
'webpack-preprocessor-ts-loader-compiler-options',
'webpack-preprocessor-awesome-typescript-loader',
]
.forEach((project) => {
systemTests.it(`handles sourcemaps in webpack for project: ${project}`, {
browser: '!webkit', // TODO(webkit): fix+unskip
project,
spec: 'failing.*',
expectedExitCode: 1,
onRun (exec) {
return exec().then(verifyPassedAndFailedAreSame(1))
},
})
})
// https://github.com/cypress-io/cypress/issues/16255
systemTests.it('handles errors when test files are outside of project root', {
browser: '!webkit', // TODO(webkit): fix+unskip
project: 'integration-outside-project-root/project-root',
spec: '../../../e2e/failing.cy.js',
expectedExitCode: 1,
onRun: async (exec) => {
await Fixtures.scaffoldProject('integration-outside-project-root')
return exec().then(verifyPassedAndFailedAreSame(1))
},
})
})