Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gwvt opened this issue May 20, 2022 · 3 comments
Closed

Comments

@gwvt
Copy link

gwvt commented May 20, 2022

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)

@gwvt gwvt 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? May 21, 2022
@suresh-raja-nxtgen
Copy link

suresh-raja-nxtgen commented Jul 18, 2022

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

@gwvt
Copy link
Author

gwvt commented Jul 20, 2022

Thank you @suresh-raja-nxtgen!

@admah admah closed this as completed Jul 22, 2022
@jonnyeom
Copy link

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants