Skip to content

How do you keep the coverage tasks registered when using multiple config files? #563

@gwvt

Description

@gwvt

How do you keep the coverage tasks registered when using multiple config files as documented at https://docs.cypress.io/api/plugins/configuration-api#Customize-available-browsers?

In plugins/index.js as documented there:

module.exports = (on, config) => {
  const environment = config.env.configFile || "development";
  const configurationForEnvironment = fetchConfigurationByFile(environment);

  return configurationForEnvironment || config;
};

How do you incorporate

  require('@cypress/code-coverage/task')(on, config);

to register the coverage tasks on the returned config object? Config by file works but without coverage. Coverage works without config by file (i.e., just returning config). I can't get both to work together...

Originally posted by @gwvt in #179 (comment)

Activity

changed the title [-]How do you keep the coverage tasks registered when using multiple config files as documented at https://docs.cypress.io/api/plugins/configuration-api#Customize-available-browsers?[/-] [+]How do you keep the coverage tasks registered when using multiple config files?[/+] on May 21, 2022
suresh-raja-nxtgen

suresh-raja-nxtgen commented on Jul 18, 2022

@suresh-raja-nxtgen

Hi @gwvt , Please add "codeCoverageTasksRegistered": true in your environment specific config file

gwvt

gwvt commented on Jul 20, 2022

@gwvt
Author
jonnyeom

jonnyeom commented on May 21, 2024

@jonnyeom

@gwvt This doesnt seem to be working for me?

Is "codeCoverageTasksRegistered: true" same as calling the registerCodeCoverageTasks from @cypress/code-coverage/task?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @admah@gwvt@jonnyeom@suresh-raja-nxtgen

        Issue actions

          How do you keep the coverage tasks registered when using multiple config files? · Issue #563 · cypress-io/code-coverage