Files
cypress/system-tests/test/error_ui_spec.ts
T
renovate[bot] 6ac467a692 chore(deps): update dependency chai to v3 (#31558)
* chore(deps): update dependency chai to v3

* empty commit

* update some tests to new syntax

* update tests + bump cache

* update system test expect

* update more chai usage

* update more chai usage

* cleanup

* fix some leftover empty functions

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2025-05-08 13:29:51 -04:00

49 lines
1.4 KiB
TypeScript

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).to.equal(expectedFailures, 'number of passes should equal the number of failures')
}
}
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',
]
.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))
},
})
})