mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-03 21:40:28 -05:00
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import e2e, { expect } from '../support/helpers/e2e'
|
|
import Fixtures from '../support/helpers/fixtures'
|
|
import path from 'path'
|
|
|
|
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 () {
|
|
e2e.setup()
|
|
|
|
;[
|
|
'webpack-preprocessor',
|
|
'webpack-preprocessor-ts-loader',
|
|
'webpack-preprocessor-ts-loader-compiler-options',
|
|
'webpack-preprocessor-awesome-typescript-loader',
|
|
]
|
|
.forEach((project) => {
|
|
e2e.it(`handles sourcemaps in webpack for project: ${project}`, {
|
|
project: Fixtures.projectPath(project),
|
|
spec: 'failing_spec.*',
|
|
expectedExitCode: 1,
|
|
onRun (exec) {
|
|
return exec().then(verifyPassedAndFailedAreSame(1))
|
|
},
|
|
})
|
|
})
|
|
|
|
// https://github.com/cypress-io/cypress/issues/16255
|
|
e2e.it('handles errors when integration folder is outside of project root', {
|
|
project: path.join(Fixtures.projectPath('integration-outside-project-root'), 'project-root'),
|
|
spec: '../../../integration/failing_spec.js',
|
|
expectedExitCode: 1,
|
|
onRun (exec) {
|
|
return exec().then(verifyPassedAndFailedAreSame(1))
|
|
},
|
|
})
|
|
})
|