From 85521e950261c3a93f74f10b6e81b1087c67155c Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Wed, 8 Apr 2020 17:19:04 -0400 Subject: [PATCH] fix: do not ask for backend code coverage from non-integration specs --- support.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/support.js b/support.js index 9351290f..b061b6d4 100644 --- a/support.js +++ b/support.js @@ -135,7 +135,10 @@ const registerHooks = () => { // we should grab it once after all tests finish const baseUrl = Cypress.config('baseUrl') || cy.state('window').origin const runningEndToEndTests = baseUrl !== Cypress.config('proxyUrl') - if (runningEndToEndTests) { + const specType = Cypress._.get(Cypress.spec, 'specType', 'integration') + const isIntegrationSpec = specType === 'integration' + + if (runningEndToEndTests && isIntegrationSpec) { // we can only request server-side code coverage // if we are running end-to-end tests, // otherwise where do we send the request?