Skip to content

Commit 10c86e6

Browse files
committed
feat: add explicit check against codeCoverage.expectFrontendCoverageOnly before attempting to collect backend coverage
1 parent 4cfcc9a commit 10c86e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

support.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,11 @@ const registerHooks = () => {
166166
const baseUrl = Cypress.config('baseUrl') || cy.state('window').origin
167167
// @ts-ignore
168168
const runningEndToEndTests = baseUrl !== Cypress.config('proxyUrl')
169+
const expectFrontendCoverageOnly = Cypress._.get(Cypress.env('codeCoverage'), 'expectFrontendCoverageOnly', false)
169170
const specType = Cypress._.get(Cypress.spec, 'specType', 'integration')
170171
const isIntegrationSpec = specType === 'integration'
171172

172-
if (runningEndToEndTests && isIntegrationSpec) {
173+
if (!expectFrontendCoverageOnly && runningEndToEndTests && isIntegrationSpec) {
173174
// we can only request server-side code coverage
174175
// if we are running end-to-end tests,
175176
// otherwise where do we send the request?

0 commit comments

Comments
 (0)